木头云 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
..
archive fix(test): Fix buffer overflow in data_set caused by array placement new 2025-12-03 08:13:44 +00:00
concur Add intrusive_stack 2025-12-03 08:11:57 +00:00
imp Fix the issue caused by inconsistent lifecycle of the global IPC object. 2025-12-03 08:13:44 +00:00
mem Refactoring the generic memory allocator 2025-12-03 08:13:44 +00:00
CMakeLists.txt Add intrusive_stack 2025-12-03 08:11:57 +00:00
test_buffer.cpp fix(test): replace C++17 structured bindings with C++14 compatible code 2025-11-30 11:16:03 +00:00
test_condition.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_ipc_channel.cpp fix(test): correct receiver loop count in MultipleSendersReceivers 2025-11-30 06:38:38 +00:00
test_locks.cpp fix(test): correct test logic and semantics in multiple test cases 2025-11-30 06:06:54 +00:00
test_mutex.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_semaphore.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_shm.cpp fix(test): correct test logic and semantics in multiple test cases 2025-11-30 06:06:54 +00:00