Repository navigation
libobs: Preserve process-pipe wait errors - #501
Merged
Merged
Conversation
With SIGCHLD ignored, the real waitpid fails with ECHILD. Seed its status slot to expose the invalid read deterministically: destroy returns 0 instead of -1. Normal exit and EINTR-retry controls pass. The original source also fails an unwrapped Linux probe when compiled with automatic-variable zero initialization. Upstream issue filing was blocked by integration permissions; fork issues are disabled. AI assistance: gpt-6-astra-pro.
Only decode the child status after a successful waitpid. Otherwise the uninitialized status can overwrite -1 with an arbitrary exit code. Normal exits, signal exits and the existing EINTR retry are unchanged. All three Linux regression cases pass with GCC and Clang, including 100 ASan/UBSan/LSan runs. Reverting the condition restores the failure. An unwrapped SIGCHLD=SIG_IGN probe also returns -1 with the fix. The full OBS gate and other platforms were not tested. AI assistance: gpt-6-astra-pro.
zackees
marked this pull request as ready for review
October 13, 2026 19:56
This was referenced Oct 13, 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.
Refs #500
What and why
Preserve permanent
waitpidfailures fromos_process_pipe_destroy. Previously, after a failed wait,WIFEXITED(status)read an uninitialized status slot and could overwrite-1with an apparent successful exit code. Decode the status only when the wait succeeded. Keep normal exits, signal exits, and the existing EINTR retry unchanged.Add a Linux regression around the real
pipe-posix.c. WithSIGCHLD=SIG_IGN, the kernel auto-reaps the child and producesECHILD; the wait wrapper seeds the status slot to make the invalid read deterministic. Normal exit and one EINTR retry are controls.RED → GREEN
0831d51e4af6bbe24a06e282a60be8407d1f01ce. The branch author reports the auto-reaped-child case returns 0 instead of -1; normal-exit and EINTR controls pass. An unwrapped Linux probe using automatic-variable zero initialization also fails on the original source.6266a29a0f4d6d2a54439303d208194ec50eaf28. The branch author reports all three cases pass with GCC and Clang, including 100 ASan/UBSan/LSan runs. Reverting the condition restores the failure; the unwrapped SIGCHLD=SIG_IGN probe returns -1 with the fix.Remaining validation
Draft: the branch author states the full OBS gate and other platforms were not tested. The required local-gate attestation is not present in the pushed head. Full repository integration, lint, and the required test lanes remain unverified.
Checklist
masterAI assistance: branch commits credit
gpt-6-astra-pro; Codex inspected and submitted the existing branch on the account owner's request. The related bug report was filed before this PR because upstream issue creation was blocked for the fork author by connector permissions.