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

[Bug libc/6982] New: atexit() hooks are not called on exec()


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


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