public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/6982] New: atexit() hooks are not called on exec()
@ 2008-10-24 18:47 anpaza at mail dot ru
  2008-10-24 18:52 ` [Bug libc/6982] " drepper at redhat dot com
  2008-10-24 18:54 ` anpaza at mail dot ru
  0 siblings, 2 replies; 3+ messages in thread
From: anpaza at mail dot ru @ 2008-10-24 18:47 UTC (permalink / raw)
  To: glibc-bugs

"man 3 exit" says, amongst other:

...
The  exit()  function  causes  normal process termination and the value of
status & 0377 is returned to the parent (see wait(2)).

All functions registered with atexit(3) and on_exit(3) are called, in  the
reverse  order  of  their  registration.
...

However, the atexit() hooks are never called if you invoke any of the exec*()
functions.

Steps to Reproduce:
1. Copy the example from 'man 3 atexit' to test.c
2. Modify it so that instead of "exit(EXIT_SUCCESS)" at the end we have, for
example:

execl ("/bin/ls", "ls");

3. Compile and run the example

Actual results:

$ ./a.out 
ATEXIT_MAX = 2147483647
a.out  test.c

Expected results:

$ ./a.out 
ATEXIT_MAX = 2147483647
That was all, folks
a.out  test.c

I think it is a serious bug as it does not allow applications that rely on it
to cleanup things that won't automatically cleanup during a normal process
destruction.

-- 
           Summary: atexit() hooks are not called on exec()
           Product: glibc
           Version: 2.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: anpaza at mail dot ru
                CC: glibc-bugs at sources dot redhat dot com


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug libc/6982] atexit() hooks are not called on exec()
  2008-10-24 18:47 [Bug libc/6982] New: atexit() hooks are not called on exec() anpaza at mail dot ru
@ 2008-10-24 18:52 ` drepper at redhat dot com
  2008-10-24 18:54 ` anpaza at mail dot ru
  1 sibling, 0 replies; 3+ messages in thread
From: drepper at redhat dot com @ 2008-10-24 18:52 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2008-10-24 18:51 -------
They are not meant to be called at exec time.  Just read the standards.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug libc/6982] atexit() hooks are not called on exec()
  2008-10-24 18:47 [Bug libc/6982] New: atexit() hooks are not called on exec() anpaza at mail dot ru
  2008-10-24 18:52 ` [Bug libc/6982] " drepper at redhat dot com
@ 2008-10-24 18:54 ` anpaza at mail dot ru
  1 sibling, 0 replies; 3+ messages in thread
From: anpaza at mail dot ru @ 2008-10-24 18:54 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From anpaza at mail dot ru  2008-10-24 18:53 -------
(In reply to comment #1)
> They are not meant to be called at exec time.  Just read the standards.
So it's a bug in the man page?


-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2008-10-24 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-24 18:47 [Bug libc/6982] New: atexit() hooks are not called on exec() anpaza at mail dot ru
2008-10-24 18:52 ` [Bug libc/6982] " drepper at redhat dot com
2008-10-24 18:54 ` anpaza at mail dot ru

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).