Skip to content

Fix SIGILL handler: terminate instead of infinite loop#4094

Draft
atobiszei wants to merge 3 commits intomainfrom
atobisze_sigill
Draft

Fix SIGILL handler: terminate instead of infinite loop#4094
atobiszei wants to merge 3 commits intomainfrom
atobisze_sigill

Conversation

@atobiszei
Copy link
Copy Markdown
Collaborator

Problem:
The SIGILL handler (onIllegal) called setShutdownRequest(2) and returned. SIGILL is a synchronous signal - the CPU raises it when encountering an illegal instruction. Unlike SIGINT/SIGTERM (asynchronous, delivered between instructions), returning from a SIGILL handler resumes execution at the same faulting instruction. This caused:

  1. An infinite loop: fault -> handler -> return -> same fault -> ...
  2. The process appeared "hanged" and had to be kill -9d

🛠 Summary

JIRA/Issue if applicable.
Describe the changes.

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

…loop

Problem:
The SIGILL handler (onIllegal) called setShutdownRequest(2) and returned.
SIGILL is a synchronous signal - the CPU raises it when encountering an
illegal instruction. Unlike SIGINT/SIGTERM (asynchronous, delivered between
instructions), returning from a SIGILL handler resumes execution at the
same faulting instruction. This caused:
1. An infinite loop: fault -> handler -> return -> same fault -> ...
2. The process appeared "hanged" and had to be kill -9d
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.

1 participant