public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/21032] pthread_key_create() destructors and segfault after a DSO unloading
       [not found] <bug-21032-131@http.sourceware.org/bugzilla/>
@ 2021-02-20 22:33 ` aa1ronham at gmail dot com
  2023-02-08 12:07 ` leo at yuriev dot ru
  1 sibling, 0 replies; 2+ messages in thread
From: aa1ronham at gmail dot com @ 2021-02-20 22:33 UTC (permalink / raw)
  To: glibc-bugs

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

aa1ronham at gmail dot com <aa1ronham at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aa1ronham at gmail dot com

--- Comment #2 from aa1ronham at gmail dot com <aa1ronham at gmail dot com> ---
Created attachment 13236
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13236&action=edit
Minimal reproduction

I've attached a minimal reproduction of the issue (GitHub repository:
https://github.com/Aaron1011/pthread_dlopen)

It does the following:
1. Spawn a new thread from `main()`, and block on it using `pthread_join`
2. From the new thread, load a simple shared library, and call a function in
it.
3. In the shared library, call `pthread_key_create` with a destrutor function,
and call `pthread_setspecific` with a non-NULL value to force the destrutor to
actually run on thread exit.
4. Back in the main program (on the thread), call `dlclose` on the shared
library.
5. Return from the thread function

This causes the following segfault:

```
[Current thread is 1 (Thread 0x7facc3ff4640 (LWP 701108))]
gef➤  bt
#0  0x00007facc4229129 in ?? ()
#1  0x00007facc41cd411 in __nptl_deallocate_tsd.part.0 () from
/usr/lib/libpthread.so.0
#2  0x00007facc41ce2ba in start_thread () from /usr/lib/libpthread.so.0
#3  0x00007facc40f7053 in clone () from /usr/lib/libc.so.6
gef➤  q
```

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug nptl/21032] pthread_key_create() destructors and segfault after a DSO unloading
       [not found] <bug-21032-131@http.sourceware.org/bugzilla/>
  2021-02-20 22:33 ` [Bug nptl/21032] pthread_key_create() destructors and segfault after a DSO unloading aa1ronham at gmail dot com
@ 2023-02-08 12:07 ` leo at yuriev dot ru
  1 sibling, 0 replies; 2+ messages in thread
From: leo at yuriev dot ru @ 2023-02-08 12:07 UTC (permalink / raw)
  To: glibc-bugs

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

Leo Yuriev <leo at yuriev dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |NOTABUG
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Leo Yuriev <leo at yuriev dot ru> ---
Not a bug for glibc, but the feature )

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-08 12:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21032-131@http.sourceware.org/bugzilla/>
2021-02-20 22:33 ` [Bug nptl/21032] pthread_key_create() destructors and segfault after a DSO unloading aa1ronham at gmail dot com
2023-02-08 12:07 ` leo at yuriev dot ru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).