This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/16549] pthread_cond_wait and pthread_cond_timedwait do not suspend the calling thread
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 11 Feb 2014 17:50:12 +0000
- Subject: [Bug nptl/16549] pthread_cond_wait and pthread_cond_timedwait do not suspend the calling thread
- Auto-submitted: auto-generated
- References: <bug-16549-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=16549
Rich Felker <bugdal at aerifal dot cx> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugdal at aerifal dot cx
--- Comment #6 from Rich Felker <bugdal at aerifal dot cx> ---
I think this bug should be closed as invalid. Using a pointer to a member of a
packed structure always results in undefined behavior. This is the case even
for things like scanf("%d", &packedstruct.foo). It happens to "work" on x86,
but on other systems it will either fault or silently corrupt adjacent members
(by ignoring the low bits of the address). It's not glibc's job to fix the
application's UB from invalid use of packed attribute/pragma.
I've seen and generally agree with the argument that it's nicer for UB to
quickly crash than to misbehave in more subtle ways, but to make that behavior
consistent, there are hundreds if not thousands of functions which would need
to check their argument alignments. Cond vars are not special. Putting such
checks all over the place would be impractical; if that level of checking is
desired, it belongs in a compiler feature.
--
You are receiving this mail because:
You are on the CC list for the bug.