Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

child bwrap process is left as zombie

Open
#697 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
c, docker, linux

Research direction

Start with the --unshare-pid path and reproduce the issue using the Docker commands and ps aux output described here. Trace how the child bwrap process is handled after the user command exits, then verify that the child is reaped and no [bwrap] zombie remains without an init process.

Written by the indexing model from the issue text.

Description

Hi! Apologies in advance if this isn't really a bug / my findings are wrong.

Bubblewrap clones itself to create a child, then clones again and exec's the user binary in this grandchild process.
I noticed that with --unshare-pid the parent doesn't wait() for the child, so the child is left as a zombie.

I think a fix would just look like waiting for this child, since we should be able to do that from outside the pid namespace(?).

Minimal reproduction (tested on arm64-darwin):

CONTAINER=$(docker run --privileged --detach alpine:3.22 sleep 10m)
docker exec $CONTAINER apk add bubblewrap
docker exec $CONTAINER bwrap --version
docker exec $CONTAINER bwrap --unshare-pid --dev-bind / / -- echo hi
docker exec $CONTAINER ps aux

This outputs

bubblewrap 0.11.0
hi
PID   USER     TIME  COMMAND
    1 root      0:00 sleep 10m
   27 root      0:00 [bwrap]            <- this is the zombie
   29 root      0:00 ps aux

Running without --unshare-pid the process is cleaned up fine.

This isn't causing problems for me - I only noticed it because my container didn't have an init process to reap this zombie child. The workaround was just to run with docker run --init to add an init process.

Dominant language
C
Stars
8.8k
Forks
387
Avg merge
2d 18h
Merged PRs (30d)
17

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from containers/bubblewrap

All issues in containers/bubblewrap

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.