This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/16549] pthread_cond_wait and pthread_cond_timedwait do not suspend the calling thread


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]