[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a exit() bug in multithreaded program

From: Dan Kegel
Subject: Re: a exit() bug in multithreaded program
Date: Thu, 29 May 2003 10:17:34 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020615 Debian/1.0.0-3

SHEN Feng wrote:
> In the function exit(), the global variable __exit_funcs isn't protected
> for multithreaded program. But __exit_funcs at __new_exit_fn() in
> cxa_atexit.c is protected by a lock. The function __new_exit_fn() is
> called by atexit() and on_exit(). So __exit_funcs at exit() should also
> be protected by the lock. It’s a bug.
> I have had a test on this function. The test function exit_test.c and
> the result file exit_test_result_redhat.log are attached. From them we
> can concluded that the exit() may be unsafe in multithreaded program.

Hi Feng,
you didn't mention which version of glibc or the operating system;
that makes it a bit harder to help.

Assuming you're using the version shipped with Red Hat 9,
this sounds vaguely related to a problem mentioned on the NPTL mailing list:
You might want to subscribe there; see
- Dan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]