木头云 52ff081770 fix(test): Fix buffer overflow in data_set caused by array placement new
ROOT CAUSE:
Array placement new (::new(buffer) T[N]) adds a hidden cookie (array size)
before the array elements in some compiler implementations (particularly MSVC).
The cookie is used for proper array destruction. However, the data_set buffer
was sized only for sizeof(T[N]), not accounting for the cookie overhead.

ISSUE:
- Buffer allocated: sizeof(rand_buf[LoopCount])
- Actual space needed: sizeof(cookie) + sizeof(rand_buf[LoopCount])
- Result: Cookie and part of array written beyond buffer boundary
- Consequence: Memory corruption, leading to invalid pointers in buffer objects

SYMPTOM:
In IPC.1v1 test, memcpy(buf, data, size) crashed because 'data' pointer
(from buffer::data()) pointed to corrupted/invalid memory address.

SOLUTION:
Replace array placement new with individual element placement new:
- Cast buffer to array pointer directly (no cookie needed)
- Construct each element individually with placement new
- Manually destroy each element in destructor

This approach:
- Eliminates cookie overhead
- Provides precise control over object lifetime
- Works consistently across all compilers

Fixes crash in IPC.1v1 test case on MSVC.
2025-12-03 08:13:44 +00:00
..
CMakeLists.txt.old chore(test): archive existing test cases to test/archive 2025-11-30 04:04:10 +00:00
test_ipc.cpp fix(test): Fix buffer overflow in data_set caused by array placement new 2025-12-03 08:13:44 +00:00
test_platform.cpp Optimized partial implementation using fmt 2025-12-03 08:11:57 +00:00
test_queue.cpp chore(test): archive existing test cases to test/archive 2025-11-30 04:04:10 +00:00
test_shm.cpp chore(test): archive existing test cases to test/archive 2025-11-30 04:04:10 +00:00
test_sync.cpp Update platform-specific feature macros to new interfaces in imp 2025-12-03 08:11:57 +00:00
test_thread_utility.cpp chore(test): archive existing test cases to test/archive 2025-11-30 04:04:10 +00:00
test_waiter.cpp chore(test): archive existing test cases to test/archive 2025-11-30 04:04:10 +00:00
test.h Update platform-specific feature macros to new interfaces in imp 2025-12-03 08:11:57 +00:00
thread_pool.h chore(test): archive existing test cases to test/archive 2025-11-30 04:04:10 +00:00