-
Notifications
You must be signed in to change notification settings - Fork 20
Process substitution hangs out on Bash 4.4 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Oh wow, this is a bizarre one! 👍 I'm guessing this is an issue with the way we compile Bash, but it's hard to say for certain since Alpine upstream doesn't have Bash 4.4 yet (https://pkgs.alpinelinux.org/packages?name=bash); it could very well be some kind of odd musl-related issue. Definitely needs more digging to figure out what's going on. 😞 |
It appears to only exhibit when we're interactive, too: $ docker run -it --rm bash:4.4 -c 'cat <(ls)'
bin
dev
etc
home
lib
media
mnt
proc
root
run
sbin
srv
sys
tmp
usr
var
$ Edit: nothing to do with TTY though! $ docker run -i --rm bash:4.4 <<<'cat <(ls)'
bin
dev
etc
home
lib
media
mnt
proc
root
run
sbin
srv
sys
tmp
usr
var
(hangs) |
Turns out this is likely an Alpine-related issue! See gliderlabs/docker-alpine#363 and https://bugs.alpinelinux.org/issues/8236. |
See also https://bugs.alpinelinux.org/issues/8098. Downgrading and compiling bash from source works though and is currently the workaround used here. |
Bizarrely, this issue does not occur on https://labs.play-with-docker.com/ IOW, on play-with-docker start an alpine:edge container and attempt to reproduce. However, the reproducers do hang in my local dev environments. This seems to rule out process substitution by itself. |
I think it was closed after fixing so the patches was actually applied. I am not able to reproduce it on my work desktop, nor in lxc containers, so the issue was probably resolved with some of the upstream bash patches. But I can still reproduce it in docker, so this is weird. Another workaround may be to not use bash at all with configure script: CONFIG_SHELL=/bin/ash ./configure ... |
I think we should report this upstream. This will be difficult to debug and code is non-trivial to follow and understand. I am not convinced the bug is in alpine or musl, even if the problem does not show on glibc distros. Could be some wrong assumptions regarding signal handling or similar. |
Turns out to be a bug in musl after all. A fix is on the way... |
Actually its a bug in bash too. It can be reproduced with glibc too: ulimit -u 9223372036854775807
bash -c 'sleep 1 & wait $!' Will fix bash too while at it. |
You're a hero, @ncopa ❤️ For the peanut gallery, this was fixed in Alpine's I think while Chet figures out what he's going to do about this bug officially upstream, we should likely temporarily apply Alpine's patch for 4.4 (since 4.3 and below are unaffected). |
- `bash`: apply Alpine patch to 4.4 for process substitution hang (tianon/docker-bash#4) - `golang`: add `alpine3.7` variant of 1.9 (docker-library/golang#192) - `rabbitmq`: add 3.7, which includes a new configuration file format (docker-library/rabbitmq#197) - `ruby`: remove `2.5-rc-alpine3.6` variant (superseded by `2.5-rc-alpine3.7`)
looks like it does not solve it for 32 bit architectures. https://bugs.alpinelinux.org/issues/8447 |
I'll reopen, thanks 👍 ❤️ |
I followed up upstream with a new proposed patch, which I also pushed to alpine linux. |
I've done some testing, and this is no longer required on Bash 5+!
I've tried reproducing this (on 5.0 and 4.4) by removing the patch we're applying and it doesn't seem to be reproducible anymore (on any of Alpine 3.9, Alpine 3.10, amd64, i386). Was this fixed in one of the minor patches to Bash 4.4 perhaps? |
Looking through https://ftp.gnu.org/gnu/bash/bash-4.4-patches/, nothing after we first started experiencing this seems related at a glance. 😕 Is it possible a change in |
Confirmed, I had to go all the way back to Alpine 3.6 in order to reproduce the original issue. |
Changes: - tianon/docker-bash@3682e16: Update to Alpine 3.10 - tianon/docker-bash@fe0fe8a: Add "devel" commit description to Dockerfile - tianon/docker-bash@11b071d: Add "devel" variant from Chet's "devel" branch - tianon/docker-bash@9282546: Remove workaround for tianon/docker-bash#4 on 5+ - tianon/docker-bash@af7a2fd: Update generated README
Changes: - tianon/docker-bash@a9c27dc: Add aliases to "devel" like "devel-20190705" (based on Chet's commit message) - tianon/docker-bash@3682e16: Update to Alpine 3.10 - tianon/docker-bash@fe0fe8a: Add "devel" commit description to Dockerfile - tianon/docker-bash@11b071d: Add "devel" variant from Chet's "devel" branch - tianon/docker-bash@9282546: Remove workaround for tianon/docker-bash#4 on 5+ - tianon/docker-bash@af7a2fd: Update generated README
Hello! Not sure whether this is a docker-bash issue or an alpine issue, so excuse me if this is not the right place.
When using Process substiution in the standard way, terminal just hangs out. It seems Bash enters some infinite loop or something, because the process starts consuming too much cpu.
I manually installed bash 4.4 on an ubuntu docker image (16.04) and it works fine
The text was updated successfully, but these errors were encountered: