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/20544] RFE: atexit, __cxa_atexit, on_exit detect NULL function pointer argument


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

John Reiser <jreiser at BitWagon dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|RFE: detect NULL function   |RFE: atexit, __cxa_atexit,
                   |argumen atexit,             |on_exit detect NULL
                   |__cxa_atexit, on_exit       |function pointer argument

--- Comment #1 from John Reiser <jreiser at BitWagon dot com> ---
Request For Enhancement(RFE): Please detect a NULL function pointer argument to
functions atexit(), __cxa_atexit(), on_exit().  Such an argument will cause
SIGSEGV when the exit function attempts to call the function as the program
exits.  This is an error by the caller of atexit or __cxa_atexit or on_exit. 
It would be nice to detect the error as early as possible.

The suggested action upon detecting a NULL function pointer is to not enqueue
the NULL pointer, then return an error value (typically -1) from atexit,
__cxa_atexit, or on_exit.

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

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