- src/libipc/platform/win/get_sa.h:
* Fix malformed log.error() calls on lines 19 and 23
* Remove extra comma and parenthesis: GetLastError(, -> GetLastError()
* Fix closing parenthesis and bracket placement
* Line 19: GetLastError(, "]"))) -> GetLastError()), "]"
* Line 23: GetLastError(, "]"))) -> GetLastError()), "]"
- src/libipc/platform/win/mutex.h:
* Add missing LIBIPC_LOG() to try_lock() function at line 84
* The function uses log.error() at line 95 and needs logger initialization
These fixes resolve Windows compilation errors related to malformed
log calls and missing LIBIPC_LOG() macro.
- src/libipc/ipc.cpp:
* Add LIBIPC_LOG() to chunk_storages::get_info() member function
* This was missing, causing 'log' to be undeclared at line 245
* The get_info() function uses log.error() for chunk storage errors
This completes the fix for all missing LIBIPC_LOG() initializations
in the ipc.cpp file.
- src/libipc/prod_cons.h:
* Add LIBIPC_LOG() to second force_push() template function
* This was missing, causing 'log' to be undeclared at line 379
- src/libipc/ipc.cpp:
* Add LIBIPC_LOG() to static send() function (line 590)
* Capture log by reference in outer lambda: [tm, &log]
* Capture log by reference in inner lambda: [tm, &log, info, que, msg_id]
* This fixes 'log' was not declared error in lambda at line 598
* The log variable is now properly captured from the outer send() scope
These fixes ensure that all functions using log.debug/error/warning
have proper LIBIPC_LOG() initialization and lambda captures.
- src/libipc/platform/posix/condition.h:
* Replace all %d and %s format specifiers with stream-based syntax
* Update log.error() calls to use proper streaming (e.g., "[", eno, "]")
- src/libipc/platform/posix/semaphore_impl.h:
* Remove %d format specifiers from log.error() calls
* Fix malformed parentheses (e.g., .c_str(, ""))
* Remove unnecessary empty string arguments
* Use stream-based logging consistently
- src/libipc/platform/win/mutex.h:
* Fix malformed GetLastError() parentheses
* Remove %lu format specifier, use explicit cast instead
* Update to stream-based logging syntax
- src/libipc/platform/win/semaphore.h:
* Fix malformed GetLastError() parentheses
* Remove %lu format specifier, use explicit cast instead
* Update to stream-based logging syntax
All format specifiers (%d, %s, %zd, %p, %lu) have been removed and replaced
with proper C++ stream-based logging that is type-safe and consistent with
the new imp/log interface.
- Add LIBIPC_LOG() to functions in platform files that use log.error/warning/debug
- Fixed files:
- POSIX platform: mutex.h, semaphore_impl.h, shm_posix.cpp
- Windows platform: get_sa.h, mutex.h, semaphore.h, shm_win.cpp
- Sync layer: condition.cpp, mutex.cpp, semaphore.cpp
All functions using the new log interface now properly initialize the logger with LIBIPC_LOG()
- Add LIBIPC_LOG() to calc_wait_time() function
- Add LIBIPC_LOG() to make_timespec() function
- Both functions use log.error() and need the logger initialization
- Fix multi-parameter log calls with complex formatting in POSIX and Windows platforms
- Replace remaining ipc::error() and ipc::log() calls with log.error() and log.warning()
- Handle special cases:
- POSIX condition.h: pthread_cond_timedwait multi-param formatting
- POSIX get_wait_time.h: calc_wait_time multi-param formatting
- POSIX semaphore_impl.h: sem_timedwait multi-param formatting
- Windows mutex.h: WaitForSingleObject with hex formatting, WAIT_ABANDONED as warning
- Windows semaphore.h: WaitForSingleObject and ReleaseSemaphore calls
- Use std::hex/std::dec for hexadecimal formatting in Windows platform
- All log interface migrations now complete
- Replace include "libipc/utility/log.h" with "libipc/imp/log.h"
- Add LIBIPC_LOG() at the beginning of functions that use logging
- Replace all ipc::error() calls with log.error()
- Replace all ipc::log() calls with log.debug() or log.error() based on context
- Modified functions:
- cc_acc(): error logging for shm acquire failure
- make_handle(): error logging for chunk storage operations
- find_storage(): error logging for invalid storage id
- release_storage(): error logging for invalid storage id
- recycle_storage(): error logging for invalid storage id
- clear_message(): error logging for invalid message size
- send(): error logging for various send failures, debug logging for force_push
- recv(): error logging for various recv failures
- Use type-safe streaming interface instead of printf-style formatting
- Remove manual newline characters from log messages
- Total changes: 19 log call sites updated
- Update force_push() log calls to use log.debug() instead of log.warning()
- Debug level is more appropriate for internal force_push diagnostic messages
- Add codecov.yml configuration to exclude 3rdparty, test, and demo directories
- Update GitHub Actions workflow with exclude parameter in codecov-action
- Ensures only project source code is included in coverage metrics
This provides double protection:
1. codecov.yml filters on CodeCov service side
2. workflow exclude filters during upload
Add CodeCov test coverage configuration:
- Add LIBIPC_CODECOV option to CMakeLists.txt with coverage compilation flags
- Add CodeCov badge to README.md for coverage status display
Note: The codecov.yml workflow file needs to be added manually
or requires workflows permission to push.
Fixed two critical issues from the rebase:
1. Added LIBIPC_OS_FREEBSD macro definition in detect_plat.h to enable
FreeBSD platform detection alongside other OS checks
2. Added missing #include "libipc/imp/detect_plat.h" in detail.h to
properly include platform detection macros
These fixes ensure FreeBSD compilation will work correctly with the
unified platform detection system.
The acquire() function allocates id_info_t using mem::$new<id_info_t>(),
so the release() function must use mem::$delete(ii) to deallocate it,
not mem::free(ii). This ensures proper allocation/deallocation pairing.
Issue: Memory allocated with mem::$new must be freed with mem::$delete
to maintain consistent memory management semantics.
After rebasing onto master, test.h was moved to test/archive/.
Updated include paths in test subdirectories:
- test/imp/*.cpp: "test.h" -> "../archive/test.h"
- test/mem/*.cpp: "test.h" -> "../archive/test.h"
- test/concur/*.cpp: "test.h" -> "../archive/test.h"
This ensures all test files can properly find the test header
after the directory reorganization in master branch.
ISSUE:
MSVC compiler reports warning C4138: '*/' found outside of comment
for patterns like 'void */*p*/' where the pointer asterisk is immediately
followed by a comment start.
AFFECTED FILES:
- include/libipc/mem/new.h (line 30)
- src/libipc/platform/win/mutex.h (line 54)
- src/libipc/platform/win/semaphore.h (line 53)
CHANGES:
Changed 'type */*param*/' to 'type * /*param*/' (added space before comment)
Examples:
- void */*p*/ → void * /*p*/
- char const */*name*/ → char const * /*name*/
This resolves the MSVC warning while maintaining code functionality
and keeping the commented-out parameter names for documentation.
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.
IMPROVEMENTS:
1. Add explicit zero-argument overload to avoid SFINAE ambiguity
2. Require at least one argument (A1) for parameterized overloads
3. Better separation between direct initialization and aggregate initialization
BENEFITS:
- Clearer intent: zero-argument construction is explicitly handled
- Avoids potential SFINAE ambiguity when empty parameter pack is used
- More maintainable: easier to understand which overload is selected
- Consistent with modern C++ best practices for variadic templates
TECHNICAL DETAILS:
- Zero-arg overload: Always uses T() for value initialization
- One-or-more-arg overload: Uses SFINAE to choose between:
* T(args...) for types with matching constructor
* T{args...} for aggregate types or types with initializer_list ctor
This is a code quality improvement and does not fix any compilation issues,
but provides better template overload resolution.
ROOT CAUSE:
The allocate() function was incorrectly constructing objects during memory
allocation, violating C++ allocator requirements. MSVC's std::_Tree_node has
a deleted default constructor, causing compilation failure.
CHANGES:
- container_allocator::allocate() now only allocates raw memory without
constructing objects (removed mem::$new and ipc::construct calls)
- container_allocator::deallocate() now only frees memory without
destroying objects (removed mem::$delete and ipc::destroy_n calls)
WHY THIS FIXES THE ISSUE:
C++ allocator semantics require strict separation:
* allocate() -> raw memory allocation only
* construct() -> object construction with proper arguments
* destroy() -> object destruction
* deallocate() -> memory deallocation only
Standard containers (like std::map) call construct() with proper arguments
(key, value) to initialize nodes, not allocate(). Since std::_Tree_node in
MSVC has no default constructor (= delete), attempting to construct it
without arguments always fails.
Fixes MSVC 2017 compilation error:
error C2280: 'std::_Tree_node<...>::_Tree_node(void)':
attempting to reference a deleted function