This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [ranty@atdot.org: Bug#76242: libc6: broken pthread.h]
- To: Ben Collins <bcollins at debian dot org>
- Subject: Re: [ranty@atdot.org: Bug#76242: libc6: broken pthread.h]
- From: Kaz Kylheku <kaz at ashi dot footprints dot net>
- Date: Sat, 4 Nov 2000 12:50:32 -0800 (PST)
- cc: libc-alpha at sourceware dot cygnus dot com
On Sat, 4 Nov 2000, Ben Collins wrote:
> Date: Sat, 4 Nov 2000 15:14:46 -0500
> From: Ben Collins <bcollins@debian.org>
> To: libc-alpha@sourceware.cygnus.com
> Subject: [ranty@atdot.org: Bug#76242: libc6: broken pthread.h]
>
> Still exists in 2.1.97...
>
> ----- Forwarded message from ranty@atdot.org -----
[ snip ]
> There is a typo in pthread.h
> this patch fixes it:
[ snip ]
> #define pthread_cleanup_push(routine,arg) \
> { struct _pthread_cleanup_buffer _buffer; \
> - _pthread_cleanup_push (&_buffer, (routine), (arg));
> + _pthread_cleanup_push (&_buffer, (routine), (arg));}
Heh, Ulrich will have a good laugh over this ``fix'', as I'm having now. :)
The whole point of pthread_cleanup_push is to open a statement block, which is
closed by the matching pthread_cleanup_pop. So the error, I imagine, must be in
some program written by ranty@atdot.org, which likely does not have proper
nesting of pushes and pops.
The above fix will cause undefined behavior, because the auto variable _buffer
is pushed onto the cleanup stack, and then it is destroyed when the statement
block terminates. Definitely not the kind of thing you want glibc to be doing!
:)