[patch] Fix for bz14333 -- race between atexit() and exit()
Carlos O'Donell
carlos@redhat.com
Wed Sep 20 01:42:00 GMT 2017
On 09/19/2017 04:33 PM, Paul Pluzhnikov wrote:
> On Tue, Sep 19, 2017 at 2:32 PM, Carlos O'Donell <carlos@redhat.com> wrote:
>
>> Can you run the above test case with your patch?
> ...
>> I expect it to print:
>> second
>> first
>
> The bad news: it still prints:
>
> second
> first
> second
>
> The good news: there is a trivial fix: the loop in stdlib/exit.c must
> *also* mark f->flavor as ef_free, and with that fix we get expected
> output.
>
> I'll add your test to the set of tests and send updated patch.
My test has an implicit timing dependency. We wait 10 seconds to allow
the other thread to make progress against the exit() call, we should
change that to use another semaphore so it proceeds in a tick-tock
fashion without any timing requirement.
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list