This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3] Remove Linuxism from tst-tls-atexit
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>, libc-alpha at sourceware dot org
- Cc: roland at hack dot frob dot com
- Date: Mon, 20 Jul 2015 09:05:05 -0400
- Subject: Re: [PATCH v3] Remove Linuxism from tst-tls-atexit
- Authentication-results: sourceware.org; auth=none
- References: <1436883383-6903-1-git-send-email-siddhesh at redhat dot com> <1436941393-20089-1-git-send-email-siddhesh at redhat dot com>
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.