RDKEMW-12824: Propagate signal from DobbyInit to DobbyDaemon #434
Open
ks734 wants to merge 5 commits into
Open
RDKEMW-12824: Propagate signal from DobbyInit to DobbyDaemon #434ks734 wants to merge 5 commits into
ks734 wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to correctly propagate “signal-killed” container termination causes from DobbyInit (PID 1 in the container PID namespace) up to DobbyDaemon, by encoding the terminating signal as an exit code (128 + signum) and reconstructing a WIFSIGNALED-style wait status in the daemon.
Changes:
DobbyInit: record a received/observed terminating signal and_exit(128 + sig)after reaping children.DobbyManager: detectWEXITSTATUSin the128+sigrange and synthesize aWIFSIGNALED-compatible wait status (optionally settingWCOREDUMP).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
daemon/lib/source/DobbyManager.cpp |
Decodes 128+sig exits into synthesized WIFSIGNALED statuses (plus optional WCOREDUMP). |
daemon/init/source/InitMain.cpp |
Tracks signal receipt/child signal death and exits via the 128+sig convention. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
goruklu
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a container is killed by a signal, DobbyDaemon expects to see a WIFSIGNALED wait status from the container's runc process. However, DobbyInit is PID 1 of the container's PID namespace and the kernel protects it from signals with default disposition - even raise() is silently dropped, making the conventional "reset to SIG_DFL + raise()" approach impossible.
As a result, DobbyInit was exiting with code 0 regardless of the signal received, causing DobbyDaemon to incorrectly treat signal-killed containers as clean exits (WIFEXITED, status 0x0000).
Adopt the POSIX shell convention: record the signal number in a volatile sig_atomic_t from the signal handler, and after all children have been reaped call _exit(128 + signum). On the DobbyDaemon side, detect exit codes in the range 129-192 and synthesise the equivalent WIFSIGNALED wait status.
Test Procedure
Sending a SIGABRT or SIGSEGV or any other fatal message to DobbyInit or another process within the running container results in the app crashing as expected.
Expected:
Type of Change
Requires Bitbake Recipe changes?
meta-rdk-ext/recipes-containers/dobby/dobby.bb) must be modified to support the changes in this PR (beyond updatingSRC_REV)