public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/14333] New: Fix the race between atexit() and exit()
@ 2012-07-06  1:53 penght at cn dot fujitsu.com
  2012-10-11 14:17 ` [Bug libc/14333] " carlos_odonell at mentor dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: penght at cn dot fujitsu.com @ 2012-07-06  1:53 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14333

             Bug #: 14333
           Summary: Fix the race between atexit() and exit()
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: unassigned@sourceware.org
        ReportedBy: penght@cn.fujitsu.com
                CC: carlos@systemhalted.org, drepper.fsp@gmail.com
    Classification: Unclassified


Created attachment 6511
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6511
The Patch can fix the race betweent atexit() and exit()

exit() uses global variable __exit_funcs indirectly, which are not protected.
It is not safe in multithread circumstance.

When call exit() and atexit() simultaneously in multithread circumstance,
the following case will cause unsafe.
The case has main process A and thread B.

a. thread B call atexit()
b. process A call exit() to traverse the __exit_funcs list
c. thread B call calloc() to create a new entry p, and next to listp:
   p->next = *listp;
d. process A modify listp to cur's next, then free cur:
   *listp = cur->next;
e. thread B modify listp to p:
   *listp = p;
f. when get f, the f is undefined:
   const struct exit_function *const f =
     &cur->fns[--cur->idx];
g. programme may be Segmentation fault

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/14333] Fix the race between atexit() and exit()
  2012-07-06  1:53 [Bug libc/14333] New: Fix the race between atexit() and exit() penght at cn dot fujitsu.com
@ 2012-10-11 14:17 ` carlos_odonell at mentor dot com
  2012-10-12  2:40 ` penght at cn dot fujitsu.com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: carlos_odonell at mentor dot com @ 2012-10-11 14:17 UTC (permalink / raw)
  To: glibc-bugs


http://sourceware.org/bugzilla/show_bug.cgi?id=14333

Carlos O'Donell <carlos_odonell at mentor dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos_odonell at mentor
                   |                            |dot com

--- Comment #1 from Carlos O'Donell <carlos_odonell at mentor dot com> 2012-10-11 14:16:56 UTC ---
We're seeing failures on hppa in this area while running some of gcc's
testsuite and it looks like a similar issue. John David Anglin is investigating
for me on the gcc side.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/14333] Fix the race between atexit() and exit()
  2012-07-06  1:53 [Bug libc/14333] New: Fix the race between atexit() and exit() penght at cn dot fujitsu.com
  2012-10-11 14:17 ` [Bug libc/14333] " carlos_odonell at mentor dot com
@ 2012-10-12  2:40 ` penght at cn dot fujitsu.com
  2012-10-12  2:41 ` penght at cn dot fujitsu.com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: penght at cn dot fujitsu.com @ 2012-10-12  2:40 UTC (permalink / raw)
  To: glibc-bugs


http://sourceware.org/bugzilla/show_bug.cgi?id=14333

Peng Haitao <penght at cn dot fujitsu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #6511|1                           |0
           is patch|                            |
   Attachment #6511|0                           |1
        is obsolete|                            |

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/14333] Fix the race between atexit() and exit()
  2012-07-06  1:53 [Bug libc/14333] New: Fix the race between atexit() and exit() penght at cn dot fujitsu.com
  2012-10-11 14:17 ` [Bug libc/14333] " carlos_odonell at mentor dot com
  2012-10-12  2:40 ` penght at cn dot fujitsu.com
@ 2012-10-12  2:41 ` penght at cn dot fujitsu.com
  2012-10-18  3:10 ` siddhesh at redhat dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: penght at cn dot fujitsu.com @ 2012-10-12  2:41 UTC (permalink / raw)
  To: glibc-bugs


http://sourceware.org/bugzilla/show_bug.cgi?id=14333

--- Comment #2 from Peng Haitao <penght at cn dot fujitsu.com> 2012-10-12 02:41:37 UTC ---
Created attachment 6682
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6682
The Patch can fix the race betweent atexit() and exit()

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/14333] Fix the race between atexit() and exit()
  2012-07-06  1:53 [Bug libc/14333] New: Fix the race between atexit() and exit() penght at cn dot fujitsu.com
                   ` (2 preceding siblings ...)
  2012-10-12  2:41 ` penght at cn dot fujitsu.com
@ 2012-10-18  3:10 ` siddhesh at redhat dot com
  2012-10-22  7:53 ` penght at cn dot fujitsu.com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: siddhesh at redhat dot com @ 2012-10-18  3:10 UTC (permalink / raw)
  To: glibc-bugs


http://sourceware.org/bugzilla/show_bug.cgi?id=14333

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |siddhesh at redhat dot com

--- Comment #3 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2012-10-18 03:09:57 UTC ---
Please post the patch on libc-alpha.  If you've posted before and not got a
response, then please repost it.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/14333] Fix the race between atexit() and exit()
  2012-07-06  1:53 [Bug libc/14333] New: Fix the race between atexit() and exit() penght at cn dot fujitsu.com
                   ` (3 preceding siblings ...)
  2012-10-18  3:10 ` siddhesh at redhat dot com
@ 2012-10-22  7:53 ` penght at cn dot fujitsu.com
  2012-12-03 23:59 ` carlos at systemhalted dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: penght at cn dot fujitsu.com @ 2012-10-22  7:53 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14333

--- Comment #4 from Peng Haitao <penght at cn dot fujitsu.com> 2012-10-22 07:52:53 UTC ---
(In reply to comment #3)
> Please post the patch on libc-alpha.  If you've posted before and not got a
> response, then please repost it.

I have reposted the patch to libc-alpha, please review.
URL: http://sourceware.org/ml/libc-alpha/2012-10/msg00567.html

Thanks.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/14333] Fix the race between atexit() and exit()
  2012-07-06  1:53 [Bug libc/14333] New: Fix the race between atexit() and exit() penght at cn dot fujitsu.com
                   ` (4 preceding siblings ...)
  2012-10-22  7:53 ` penght at cn dot fujitsu.com
@ 2012-12-03 23:59 ` carlos at systemhalted dot org
  2014-06-18  4:27 ` fweimer at redhat dot com
  2014-06-25 10:53 ` fweimer at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: carlos at systemhalted dot org @ 2012-12-03 23:59 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14333

Carlos O'Donell <carlos at systemhalted dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|carlos_odonell at mentor    |
                   |dot com                     |

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/14333] Fix the race between atexit() and exit()
  2012-07-06  1:53 [Bug libc/14333] New: Fix the race between atexit() and exit() penght at cn dot fujitsu.com
                   ` (5 preceding siblings ...)
  2012-12-03 23:59 ` carlos at systemhalted dot org
@ 2014-06-18  4:27 ` fweimer at redhat dot com
  2014-06-25 10:53 ` fweimer at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2014-06-18  4:27 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14333

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/14333] Fix the race between atexit() and exit()
  2012-07-06  1:53 [Bug libc/14333] New: Fix the race between atexit() and exit() penght at cn dot fujitsu.com
                   ` (6 preceding siblings ...)
  2014-06-18  4:27 ` fweimer at redhat dot com
@ 2014-06-25 10:53 ` fweimer at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2014-06-25 10:53 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14333

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-25 10:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-06  1:53 [Bug libc/14333] New: Fix the race between atexit() and exit() penght at cn dot fujitsu.com
2012-10-11 14:17 ` [Bug libc/14333] " carlos_odonell at mentor dot com
2012-10-12  2:40 ` penght at cn dot fujitsu.com
2012-10-12  2:41 ` penght at cn dot fujitsu.com
2012-10-18  3:10 ` siddhesh at redhat dot com
2012-10-22  7:53 ` penght at cn dot fujitsu.com
2012-12-03 23:59 ` carlos at systemhalted dot org
2014-06-18  4:27 ` fweimer at redhat dot com
2014-06-25 10:53 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).