Skip to content

Make SIGILL fatal instead of looping in its signal handler - #1926

Open
willbuckner wants to merge 1 commit into
eggheads:developfrom
willbuckner:will/sigill
Open

Make SIGILL fatal instead of looping in its signal handler#1926
willbuckner wants to merge 1 commit into
eggheads:developfrom
willbuckner:will/sigill

Conversation

@willbuckner

Copy link
Copy Markdown

Found by: michaelortmann
Patch by: willbuckner
Fixes: #1640

One-line summary: Make SIGILL fatal instead of looping in its signal handler

Additional description (if needed):

got_ill() logged the signal and returned. Returning from a SIGILL handler re-executes the faulting instruction, so a real illegal instruction re-raised the signal immediately, spamming the log in an endless loop, and no core dump or stack trace was ever produced.

Treat SIGILL like SIGBUS/SIGSEGV: write the DEBUG file, log the crash and re-raise the signal with its default action restored so the bot dies with a core dump.

Restore the default action explicitly instead of relying on SA_RESETHAND alone: at least on macOS the handler stays installed when the signal is re-raised from within the handler, which would turn the re-raise into another endless loop.

This removes the (now pointless) sigill Tcl evnt bind; the bot no longer survives SIGILL.

Test cases demonstrating functionality (if applicable): N/A

Found by: michaelortmann
Fixes: eggheads#1640

got_ill() logged the signal and returned. Returning from a SIGILL
handler re-executes the faulting instruction, so a real illegal
instruction re-raised the signal immediately, spamming the log in an
endless loop, and no core dump or stack trace was ever produced.

Treat SIGILL like SIGBUS/SIGSEGV: write the DEBUG file, log the
crash and re-raise the signal with its default action restored so
the bot dies with a core dump.

Restore the default action explicitly instead of relying on
SA_RESETHAND alone: at least on macOS the handler stays installed
when the signal is re-raised from within the handler, which would
turn the re-raise into another endless loop.

This removes the (now pointless) sigill Tcl evnt bind; the bot no
longer survives SIGILL.
@vanosg

vanosg commented Aug 16, 2026

Copy link
Copy Markdown
Member

ok, I'll bite... Wcc?

@willbuckner

Copy link
Copy Markdown
Author

yes :P

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.

SIGILL -> endless loop

2 participants