This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix for bz14333 -- race between atexit() and exit()
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: Torvald Riegel <triegel at redhat dot com>, Andreas Schwab <schwab at suse dot de>, Joseph Myers <joseph at codesourcery dot com>, GLIBC Devel <libc-alpha at sourceware dot org>, Ricky Zhou <rickyz at google dot com>
- Date: Tue, 19 Sep 2017 19:42:31 -0600
- Subject: Re: [patch] Fix for bz14333 -- race between atexit() and exit()
- Authentication-results: sourceware.org; auth=none
- References: <CALoOobNCZqgvcLJhuJt5eSWseuTfHJ9oVsG9TpPvytyfzF56mg@mail.gmail.com> <alpine.DEB.2.20.1707111900580.9395@digraph.polyomino.org.uk> <CALoOobOgwZx2K-FWFi5zmqjk4vfxB4B2+Bv6koou7Ks9WCT4Yw@mail.gmail.com> <mvmwp7d7i29.fsf@suse.de> <CALoOobMnZ=dE52uWT-PXSb+Sz8SRbjG7FKCmuG+kZ47db76PUg@mail.gmail.com> <1500467179.27895.55.camel@redhat.com> <CALoOobPx5KHn7rGQKTy3UnEq_YnzXnGKrKCLmJHPd5bkipb79g@mail.gmail.com> <1500926864.30433.42.camel@redhat.com> <CALoOobO1sCK2jMJ69_r-m47PshpM3OnReWkAp6QA=vr6OycrJw@mail.gmail.com> <CALoOobPuWkBOjqMnb9OWf1-3G4=vXqL_Z0LTs7HWACn=Ew+mng@mail.gmail.com> <abd5aba0-4ffe-4794-f390-d57b1522b937@redhat.com> <CALoOobP4KGou=4OL7hVEDOTPesUyNnZE4CoaRhJCCU=RBGPyQQ@mail.gmail.com> <d4b7473f-92eb-db93-7b74-edc4805acffd@redhat.com> <CALoOobM=EkhzY9ye0bsGfFqqfz2kHGV10oJpER3ey_bMCNCj1A@mail.gmail.com> <2d7b1ff8-a87e-657d-4047-57ea99d40918@redhat.com> <CALoOobPPjvPWrngw4iYwuSfs2drPPEhyANvUt8YbO2QvkJiBvw@mail.gmail.com>
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.