(release/25.2) xquartz: Replace assert() around side-effecting calls with unconditional error handling - #3575
Conversation
…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>
… 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: #3575
Solid correctness fix — no objections. What it does: replaces Error handling pattern:
ABI impact: none. Darwin-only (XQuartz) code, no struct or export changes. NVIDIA blobs unaffected. Backport candidate: debatable — this is a latent bugfix (NDEBUG builds were silently broken), but only affects Darwin/XQuartz. Maintainer decides if the release lines carry it. Verdict: passes review. |
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