Skip to content

feat(signal): support POSIX-compliant SIGCONT and SIGSTOP handling#6

Open
TomGoh wants to merge 8 commits intoStarry-OS:mainfrom
TomGoh:feat/sigstop-cont
Open

feat(signal): support POSIX-compliant SIGCONT and SIGSTOP handling#6
TomGoh wants to merge 8 commits intoStarry-OS:mainfrom
TomGoh:feat/sigstop-cont

Conversation

@TomGoh
Copy link
Copy Markdown

@TomGoh TomGoh commented Dec 1, 2025

Changes:

  • check_signals_slow would return Option<(SignalInfo, Option<SignalOSAction>)> instead of Option<(SignalInfo, SignalOSAction)> to allow reporting signals without OS actions (e.g., ignored SIGCONT, which should be handled as normal when the target process is stopped).
  • Add special handling path in check_signals_slow() to return ignored SIGCONT with a None action, enabling side effects without handler execution.
  • Add signal management utilities: remove_signal(), has_signal(), flush_stop_signals() for process/thread signal managers.
  • Implement PendingSignals::remove_signal() and has_signal() for direct queue manipulation in support for upper process/thread layer operations.
  • Add SignalEventFlags bitflag struct to save a pending stop/continue event of a process.
  • Add signal_events and last_stop_signal field in ProcessSignalManager to save stoppage due to signals for a process. When a process is stopped or continued due to signals, the corresponding event would be set in the signal_event flag and the stopping signal would be saved in last_stop_signal.
  • Add set_stop_signal, set_cont_signal, peek_pending_stop_event, peek_pending_cont_event, consume_stop_event, and consume_cont_event for ProcessSignalManager. The stop/continue event would be set and the signal would be saved in the set_x_signal function. peek_pending_x_event would only examine whether there is a pending event and the saved signal, but does not make any modifications. consume_x_event would clear the saved signal and clear the signal_event flag.

Changes:
- Return  instead of  to allow reporting signals without OS actions (e.g., ignored SIGCONT)
- Add special handling in check_signals_slow() to return ignored SIGCONT with None action, enabling side effects without handler execution
- Add signal management utilities: remove_signal(), has_signal(), flush_stop_signals() for process/thread signal managers
- Implement PendingSignals::remove_signal() and has_signal() for direct queue manipulation
Fix the bug that when a process/thread set the disposition for SIGCONT to Ignore the delivery of SIGCONT to this process/thread when stopped is missing
…anism

Changes:
- Add SignalEventFlags struct and signal event to keep track of process stopping and continue events.
- Add signal event setter, peek and consume functions for signal events
  Changes:
  - Remove signal_events and last_stop_signal fields
  - Remove SignalEventFlags bitflags
  - Remove set_stop_signal, set_cont_signal methods
  - Remove peek/consume methods for stop/continue events
  - Clean up unused imports (AtomicU8, Ordering, bitflags)

  Rationale: Wait events moved to Process::ThreadGroup for POSIX compliance
@TomGoh TomGoh force-pushed the feat/sigstop-cont branch from b427177 to 5b503e3 Compare December 8, 2025 02:30
@TomGoh TomGoh marked this pull request as ready for review December 8, 2025 02:52
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