-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Closed
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.

Description
In libstd/sys/unix there are numerous cases where return code is checked for
error using following pattern:
let result = libc::pthread_mutexattr_init(&mut attr as *mut _);
debug_assert_eq!(result, 0);
That means, that error checking is performed only when compiled in
non-optimized mode or after explicitly enabling debug assertions. This is a
little bit worrying, especially when used on platforms where those functions
can indeed fail and break safety.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.