bug-glibc
[Top][All Lists]
Advanced

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

a exit() bug in multithreaded program


From: SHEN Feng
Subject: a exit() bug in multithreaded program
Date: Thu, 29 May 2003 16:53:33 +0800

Hi,

 

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.

 

B.R.
                  SHEN Feng

Attachment: exit_test_result_redhat.log
Description: Binary data

Attachment: exit_test.c
Description: Binary data


reply via email to

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