mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] MT fork and key_lock in pthread_key_create.c
@ 2022-10-06  6:37 Alexey Izbyshev
  2022-10-06  7:02 ` [musl] " Alexey Izbyshev
  2022-10-06 18:21 ` [musl] " Rich Felker
  0 siblings, 2 replies; 15+ messages in thread
From: Alexey Izbyshev @ 2022-10-06  6:37 UTC (permalink / raw)
  To: musl

Hi,

I noticed that fork() doesn't take key_lock that is used to protect the 
global table of thread-specific keys. I couldn't find mentions of this 
lock in the MT fork discussion in the mailing list archive. Was this 
lock overlooked?

Also, I looked at how __aio_atfork() handles a similar case with 
maplock, and it seems wrong. It takes the read lock and then simply 
unlocks it both in the parent and in the child. But if there were other 
holders of the read lock at the time of fork(), the lock won't end up in 
the unlocked state in the child. It should probably be completely 
nulled-out in the child instead.

Thanks,
Alexey

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

end of thread, other threads:[~2022-10-11 17:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06  6:37 [musl] MT fork and key_lock in pthread_key_create.c Alexey Izbyshev
2022-10-06  7:02 ` [musl] " Alexey Izbyshev
2022-10-06 19:20   ` Rich Felker
2022-10-06 19:50     ` Rich Felker
2022-10-07  1:26       ` Rich Felker
2022-10-07 10:53         ` Alexey Izbyshev
2022-10-07 21:18           ` Rich Felker
2022-10-08 16:07             ` Alexey Izbyshev
2022-10-07  8:18       ` Alexey Izbyshev
2022-10-06 20:04     ` Jeffrey Walton
2022-10-06 20:09       ` Rich Felker
2022-10-06 18:21 ` [musl] " Rich Felker
2022-10-08  1:36   ` Rich Felker
2022-10-08 17:03     ` Alexey Izbyshev
2022-10-11 17:50       ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).