Skip to content

pthread_mutex_init/condattr_init return values unchecked in SHM-direct #131

Description

@mcurrier2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions