Skip to content
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

SIGINT throws bats into endless loop on Bash 5.2 (RC) #654

Closed
gioele opened this issue Sep 18, 2022 · 3 comments · Fixed by #656
Closed

SIGINT throws bats into endless loop on Bash 5.2 (RC) #654

gioele opened this issue Sep 18, 2022 · 3 comments · Fixed by #656
Labels
Component: Bash Code Everything regarding the bash code Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems Status: Confirmed The reproducer worked as described Type: Bug
Milestone

Comments

@gioele
Copy link
Contributor

gioele commented Sep 18, 2022

Describe the bug

In versions 1.8.0, test "73 CTRL-C aborts and fails the current test" hangs when run on a recent Debian sid system.

Test 73 gets stuck without producing any output. Killing the test with CTRL-C makes the test suit starting the abort procedure, but then the test process gets stuck in Running state. Sending SIGKILL to the test process unblocks the test suite abort procedure.

ok 71 Parallel mode works on MacOS with over subscription (issue #433)
ok 72 Failure in free code (see #399)
[nothing shown on the terminal; the test process spins using 100% CPU until CTRL-C is pressed]
^Cnot ok 73 CTRL-C aborts and fails the current test
# (in test file test/bats.bats, line 767)
#   `wait $SUBPROCESS_PID && return 1' failed with status 130

# Received SIGINT, aborting ...

^C^C^C^C^C^C^C^C^C^C^C^C# bats warning: Executed 73 instead of expected 274 tests

To Reproduce

Steps to reproduce the behavior:

  1. docker run --rm -it -v /tmp/d debian:sid
  2. apt update && apt install git
  3. cd /tmp && git clone https://github.com/bats-core/bats-core && cd bats-core
  4. mkdir -p ~/.parallel && touch ~/.parallel/will-cite
  5. bin/bats --tap test

Expected behavior

Test 73 should run successfully.

Environment (please complete the following information):

  • Bats Version 1.8.0
  • OS: Debian sid
  • Bash version: 5.2.0(1)-rc2
@gioele gioele added Priority: NeedsTriage Issue has not been vetted yet Type: Bug labels Sep 18, 2022
@martin-schulze-vireso
Copy link
Member

Thanks for the report. This works with a previous Bats version?

@martin-schulze-vireso martin-schulze-vireso added Component: Bash Code Everything regarding the bash code Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems Status: Unconfirmend No reproducer was provided or the reproducer did not work for maintainers. and removed Priority: NeedsTriage Issue has not been vetted yet labels Sep 18, 2022
@gioele
Copy link
Contributor Author

gioele commented Sep 18, 2022

This happens also in version 1.7.0, but there the test number is 79.

ok 78 Failure in free code (see #399)
^Cnot ok 79 CTRL-C aborts and fails the current test
# (in test file test/bats.bats, line 833)
#   `wait $SUBPROCESS_PID && return 1' failed with status 130

# Received SIGINT, aborting ...

^C^C^C^C^C

@martin-schulze-vireso
Copy link
Member

I was able to reproduce this with the bash:rc Docker Image, which provides Bash 5.2.

@martin-schulze-vireso martin-schulze-vireso added Status: Confirmed The reproducer worked as described Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems and removed Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems Status: Unconfirmend No reproducer was provided or the reproducer did not work for maintainers. labels Sep 18, 2022
@martin-schulze-vireso martin-schulze-vireso changed the title Test 73 "CTRL-C aborts and fails the current test" hangs when run on a recent Debian sid system SIGINT throws bats into endless loop on Bash 5.2 (RC) Sep 18, 2022
martin-schulze-vireso added a commit to martin-schulze-vireso/bats-core that referenced this issue Sep 18, 2022
due to wait in wait because of read in trap
@martin-schulze-vireso martin-schulze-vireso added this to the 1.9.0 milestone Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Bash Code Everything regarding the bash code Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems Status: Confirmed The reproducer worked as described Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants