Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 May 2023 11:56:04 +0000
From:      bugzilla-noreply@freebsd.org
To:        threads@FreeBSD.org
Subject:   [Bug 271490] Deadlock between _rtld_atfork_pre and _thr_attr_init
Message-ID:  <bug-271490-13406-CbdqcpWFBZ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-271490-13406@https.bugs.freebsd.org/bugzilla/>
References:  <bug-271490-13406@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271490

--- Comment #9 from KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au> ---
Ahah! I managed to make an isolated program which causes the issue. See the
file `reproduction.c` I added as an attachment.

This will eventually hang not printing anything, and attaching GDB to the c=
hild
process (not the parent) will show a similar stack trace going through
`_rtld_atfork_pre`:

```
clang -std=3Dc11 reproduction.c -lpthread -o reproduction
while true; do ./reproduction; done;
```

However, this will _NOT_ hang:

```
while true; do LD_BIND_NOW=3Dyes ./reproduction; done;
```

(on my machine, in any case).

The trick seems to be doing a multithreaded fork, followed by _another_
multithreaded fork.

Thanks again for having a look at this Konstantin!

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-271490-13406-CbdqcpWFBZ>