--die-with-parent is a massive footgun
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, linux
- Domain
- operating-systems
Research direction
Start by locating the documentation for the --die-with-parent option and read the related discussion in #633. Confirm how the documentation describes parent-thread termination and the race, then update it to reflect the reported behavior and clarify the risks; the issue also raises whether the option should be removed, which needs maintainer direction.
Written by the indexing model from the issue text.
Description
I recently stumbled upon the same issue that was reported in this blog post: https://www.recall.ai/blog/pdeathsig-is-almost-never-what-you-want.
The problem is how PR_SET_PDEATHSIG works (from here):
The parent-death signal is sent upon subsequent termination of the parent thread
Thus it is triggered by the death of the parent thread, not the parent process. This means that if the parent process chooses to launch a subprocess using a thread that isn't the main thread, and then that thread happens to die, then bwrap and its children will receive a SIGKILL, even though the parent process is still alive. This can lead to some very hard to debug process deaths.
I was running bwrap --die-with-parent in a Docker container via docker exec. Docker ultimately invokes runc to create processes, and runc is evidently multi-threaded, because I would occasionally get these SIGKILL process deaths.
I don't think this is adequately explained in Bubblewrap's documentation, which says this:
--die-with-parent Kills with SIGKILL child process (COMMAND) when bwrap or bwrap's parent dies.
Considering this flag is also inherently racy (see #633) I feel like it's dangerous to use and maybe should even be removed.
- Dominant language
- C
- Stars
- 8.9k
- Forks
- 391
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 13
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from containers/bubblewrap
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
containers/bubblewrap#767 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
containers/bubblewrap#743 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
containers/bubblewrap#298 · 4 comments · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
containers/bubblewrap#808 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 40/100
containers/bubblewrap#804 ·
Maintainers usually reply within 1 day
All issues in containers/bubblewrap
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
trezor/trezor-firmware#7997 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
area/ysql kind/bug priority/medium status/awaiting-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yugabyte/yugabyte-db#34415 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
KhronosGroup/OpenCL-Headers#318 ·
-
0.kind: build failure
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day