Description
In shared_memory_direct.rs (~lines 181–211) and shared_memory_blocking.rs (~lines 110–131), the pthread_mutexattr_init, pthread_condattr_init, pthread_mutex_init, and pthread_cond_init return values are not checked during initialization.
Impact
If any of these calls fail (e.g., due to resource limits), the shared memory segment will have uninitialized synchronization primitives, leading to undefined behavior when accessed.
Suggested Fix
Check each return value and return Err on non-zero, similar to how the code already checks return values in the send/receive paths.
Found during release polish review
Description
In
shared_memory_direct.rs(~lines 181–211) andshared_memory_blocking.rs(~lines 110–131), thepthread_mutexattr_init,pthread_condattr_init,pthread_mutex_init, andpthread_cond_initreturn values are not checked during initialization.Impact
If any of these calls fail (e.g., due to resource limits), the shared memory segment will have uninitialized synchronization primitives, leading to undefined behavior when accessed.
Suggested Fix
Check each return value and return
Erron non-zero, similar to how the code already checks return values in the send/receive paths.Found during release polish review