Skip to content

Stop the progress loop from holding the caller's stderr - #611

Open
amosbird wants to merge 1 commit into
dkms-project:mainfrom
amosbird:fix-progress-loop-sigint
Open

amosbird wants to merge 1 commit into
dkms-project:mainfrom
amosbird:fix-progress-loop-sigint

Conversation

@amosbird

@amosbird amosbird commented Oct 7, 2026

Copy link
Copy Markdown

Summary

  • The background progress loop (sleep 3; echo .) ignores SIGINT. After Ctrl+C, bash re-raises SIGINT and skips the EXIT trap, so the loop keeps running and holds the caller's stderr open. Anything waiting for that pipe to close (a package-manager hook, for example) hangs.
  • Redirect the loop's stderr to /dev/null, exit 130 on SIGINT so the existing EXIT trap runs, and pass each jobs -p pid to kill separately. A quoted "$j" is one argument when jobs -p prints more than one line.

Test plan

  • make a module, send SIGINT to the dkms process group, and confirm dkms exits 130 and does not leave the progress loop behind
  • Run dkms under a parent that reads its stderr until EOF; the parent should return as soon as dkms exits
  • A normal non-verbose build still prints progress dots on stdout

Made with Cursor

The background "sleep 3" loop ignores SIGINT. Ctrl+C kills the build
and, without a SIGINT trap, bash re-raises SIGINT and skips the EXIT
trap, so the loop survives and keeps stderr open. Callers that wait
for that pipe, such as package-manager hooks, hang until it is killed.

Redirect the loop's stderr to /dev/null, exit 130 on SIGINT so the
EXIT trap runs, and pass each jobs -p pid to kill separately.

Co-authored-by: Cursor <cursoragent@cursor.com>
@scaronni

scaronni commented Oct 7, 2026

Copy link
Copy Markdown
Member

I'm a bit confused by the "Test plan" checklist, are you actually adding tests to the pull request or what?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants