[PATCH v3] Remove Linuxism from tst-tls-atexit
Carlos O'Donell
carlos@redhat.com
Mon Jul 20 13:05:00 GMT 2015
On 07/15/2015 02:23 AM, Siddhesh Poyarekar wrote:
> v3: I renamed some functions to make it clearer what they were doing.
> I also added foo_var to test reachability of the DSO address space
> without side-effects.
> +static void
> +segv_handler (int sig)
> {
> - handle = dlopen ("$ORIGIN/tst-tls-atexit-lib.so", RTLD_LAZY);
> - if (handle == NULL)
> - {
> - printf ("Unable to load DSO: %s\n", dlerror ());
> - return (void *) (uintptr_t) 1;
> - }
> + /* All good. */
> + _exit (0);
> +}
We could crash for any number of reasons in printf.
May I suggest walking _r_debug->r_map and checking l_name
to see if the DSO is still loaded? Just like the debugger would do?
This doesn't require a SIGSEGV handler at all?
Cheers,
Carlos.
More information about the Libc-alpha
mailing list