/bin/sh hang in some circonstance

Stacy Harper contact at stacyharper.net
Mon Aug 30 11:15:40 UTC 2021

Hello there,

There is an issue with busybox 1.34.0 :

I detailed the issue here :


But to recap :

Shell will hang on this simple script :

    test() {
        . /tmp/bb_test

    echo "export TEST=foo" > /tmp/bb_test

    test 2>/dev/null

    echo "$TEST"

Run with :

sudo -u <me> -n "$PWD"/busybox sh -c "$PWD"/test

So the issue seems to occurs when :

- The script source another file
- The output is redirected
- In non-interactive mode

I already bisected git and it looks that the first commit that
got the issue is :


ash: add process substitution in bash-compatibility mode

More information about the busybox mailing list