This is the mail archive of the libc-alpha@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]

Re: [PATCH] Fix the race between atexit() and exit()


On Tue, Jun 3, 2008 at 8:08 AM, Anoop <acv@linux.vnet.ibm.com> wrote:
> POSIX requires that at normal program termination, all functions
> registered by the atexit() function shall be called. A race exits among
> __cxa_atexit() and exit() on __exit_funcs can cause a successfully
> registered handler not to be called. I have a test-case which reveals this
> bug, which can be posted if required. The following patch solves this by
> extending the locking
> used by __new_exitfn() to exit() and failing atexit() registrations once the
> exit() code completed traversing the __exit_funcs list.
>
> Feedbacks appreciated.

1. Describe in detail the conditions of the race and your proposed fix.
2. Provide the test case.
3. Run the testsuite for your target to show there were no
regressions. Mention the target.
4. When quoting POSIX  please provide references.

Cheers,
Carlos.


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