Skip to content

(release/25.0) xquartz: Replace assert() around side-effecting calls with unconditional error handling - #3608

Open
metux wants to merge 1 commit into
release/25.0from
pr/release/25.0-xquartz-replace-assert-around-side-effecting-calls-with-unconditional-error-handling-_2026-08-20_16-25-26
Open

(release/25.0) xquartz: Replace assert() around side-effecting calls with unconditional error handling#3608
metux wants to merge 1 commit into
release/25.0from
pr/release/25.0-xquartz-replace-assert-around-side-effecting-calls-with-unconditional-error-handling-_2026-08-20_16-25-26

Conversation

@metux

@metux metux commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

darwin.c and bundle_trampoline.c wrapped calls that allocate memory, add input devices, or spawn a process in
assert(), so building with NDEBUG would silently skip the call and leave the guarded variable uninitialized or
unset while still proceeding as if it had succeeded.

darwin.c now calls FatalError() on failure. bundle_trampoline runs before the server attaches to a terminal or
console, so stderr is not visible there; it now logs via os_log_error() and calls abort().

Signed-off-by: Jeremy Huddleston Sequoia jeremyhu@apple.com

…nal error handling

darwin.c and bundle_trampoline.c wrapped calls that allocate memory, add input devices, or spawn a process in
assert(), so building with NDEBUG would silently skip the call and leave the guarded variable uninitialized or
unset while still proceeding as if it had succeeded.

darwin.c now calls FatalError() on failure. bundle_trampoline runs before the server attaches to a terminal or
console, so stderr is not visible there; it now logs via os_log_error() and calls abort().

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
@metux metux self-assigned this Aug 20, 2026
@metux
metux requested a review from a team August 20, 2026 14:27
metux pushed a commit that referenced this pull request Aug 20, 2026
… unconditional error handling

darwin.c and bundle_trampoline.c wrapped calls that allocate memory, add input devices, or spawn a process in
assert(), so building with NDEBUG would silently skip the call and leave the guarded variable uninitialized or
unset while still proceeding as if it had succeeded.

darwin.c now calls FatalError() on failure. bundle_trampoline runs before the server attaches to a terminal or
console, so stderr is not visible there; it now logs via os_log_error() and calls abort().

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
PR: #3608
@metux

metux commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Automated review — generated by Starfleet ship Discovery on behalf of @metux. Not a human review.

Same correctness fix as #3575 / #3595, now on release/25.0 — no objections.

What it does: replaces assert() around side-effecting calls with proper runtime error handling in darwin.c (FatalError()) and bundle_trampoline.c (os_log_error() + abort()). Identical content to #3575 — NDEBUG builds silently skipped allocation/device creation/spawn, leaving variables uninitialized.

ABI impact: none. Darwin-only (XQuartz).

Backport candidate: same as #3575 — latent bugfix, Darwin-only. Maintainer decides.

Verdict: passes review.

@metux metux added the bot-review-passed Automated bot review found no blocking issues label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-review-passed Automated bot review found no blocking issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants