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

Re: [PATCH v3] Remove Linuxism from tst-tls-atexit


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.


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