Commit a7bb35d
Fix dyld crash on macOS < 15 from unguarded quick_exit reference (#2564)
* Fix dyld crash on macOS < 15 from unguarded quick_exit reference
quick_exit only entered libSystem in macOS 15.0, and the SDK declares it
with no availability annotation:
void quick_exit(int) __dead2; // _stdlib.h
It is gated on __DARWIN_C_LEVEL/C11 -- a compile-time feature gate, not an
OS-version gate -- so the compiler has no version information to act on. It
cannot warn (-Wunguarded-availability) and cannot weak-link. Building
against the macOS 15 SDK with an older deployment target therefore emits a
hard reference and links cleanly against the SDK's libSystem stub, but the
binary aborts on load on macOS < 15:
dyld: Symbol not found: _quick_exit
Referenced from: .../lib/libInterface_Application.dylib
Expected in: /usr/lib/libSystem.B.dylib
Xcode 16 ships only the macOS 15 SDK, so on macOS 14 this silently produces
a binary that cannot load on the machine that built it. SCIRun_test hit this
via the two regression-mode exits added in a0e0954.
Extract the call behind Core::quickExit, which falls back to _Exit when the
deployment target is below macOS 15.0. _Exit is C99 and always present, and
since nothing registers at_quick_exit handlers the two are equivalent here.
The literal 150000 is deliberate rather than __MAC_15_0: that constant is
undefined on SDKs older than 15 and would evaluate to 0, inverting the test
and reintroducing the crash on exactly the configurations it guards.
Verified on macOS 14.5 / Xcode 16.2: no _quick_exit references remain in the
build, both preprocessor branches compile (min 14.5 -> _Exit, min 15.0 ->
quick_exit), and lldb confirms the regression-mode path reaches _Exit and
propagates its exit code.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Add macOS 14 GUI build with an executable smoke test
CI had no job building the GUI on macOS < 15, for two independent reasons:
every mac-gui job runs on macOS-latest (currently the macos-26 image), and
the only macOS 14 jobs are headless -- where src/CMakeLists.txt:632 skips
ADD_SUBDIRECTORY(Interface) entirely. So nothing compiled src/Interface
against an older SDK and deployment target.
That gap is what let the previous commit's bug ship green: a macOS-15-only
libSystem symbol (quick_exit) linked cleanly on the macOS 26 runners and
aborted at load on macOS 14.
Add mac-gui-14-arm, pinned to the oldest available image (macos-13 is
retired; macos-14 is deprecated but still offered). Pinned rather than
tracking macOS-latest on purpose: the newest macOS is already covered
several times over, and only the oldest image exercises a lower deployment
target.
Also add a run-smoke-test input that executes the built binary. A green
build cannot detect this class of failure -- the dynamic loader resolves
linked libraries before main, so a reference to a symbol the host lacks
links cleanly and only aborts on execution. --help is sufficient, since the
loader has already resolved every dependency by the time main runs, and it
routes to ConsoleApplication (src/Main/scirunMain.cc) so no window server is
needed. --version is deliberately not used: it currently falls through to
GuiApplication and crashes on exit on macOS.
Unlike the existing test steps, the smoke step omits continue-on-error: it
must be able to fail the job, or it gates nothing. It selects SCIRun_test
where present (built on APPLE only, per src/Main/CMakeLists.txt) and falls
back to SCIRun elsewhere, failing loudly if neither exists.
Verified against a deliberately reverted build: the smoke test exits 134
with the original "dyld: Symbol not found: _quick_exit", and exits 0 with
the fix in place.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Enable the smoke test on the macOS headless builds
These jobs already build SCIRun_test -- src/Main/CMakeLists.txt adds it
unconditionally under IF(APPLE), regardless of BUILD_HEADLESS -- so
executing it costs seconds on top of an existing build and catches
load-time failures the build itself cannot.
Scope note: these jobs cannot catch the quick_exit class of bug on their
own. Headless builds skip ADD_SUBDIRECTORY(Interface) (src/CMakeLists.txt),
so they never compile the GUI libraries where that symbol was referenced;
mac-gui-14-arm remains the only job covering those. What these add is the
same load-time check over the Core/Dataflow/Modules dylibs, across macOS
14/15/26 and both arm64 and x86_64.
--help routes to ConsoleApplication in headless builds (the BUILD_HEADLESS
branch of src/Main/scirunMain.cc), so no window server is involved.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Always take _Exit on Apple instead of gating on deployment target
The version gate this replaces could not have worked. Nothing in the build sets
CMAKE_OSX_DEPLOYMENT_TARGET, so __MAC_OS_X_VERSION_MIN_REQUIRED follows the build
host and reads 150000 on exactly the macOS 15 builders that emit the hard
_quick_exit reference. The trigger is the SDK, not the host: a macOS 14 machine
with Xcode 16 installed builds the broken binary.
Both spellings also fail to compile against SDKs older than 15, which do not
declare quick_exit at all -- bare quick_exit as an undeclared identifier,
std::quick_exit as a reference to an unresolved using declaration, since libc++'s
<cstdlib> has no ::quick_exit to pull in.
_Exit is equivalent here as nothing registers at_quick_exit handlers, so take it
unconditionally on Apple and drop the version arithmetic entirely.
Verified against the 13.3 and 15.2 SDKs: compiles on both, and nm -u shows __Exit
with no _quick_exit reference. For contrast, std::quick_exit against the 15.2 SDK
compiles clean and emits _quick_exit, which is the load-time failure on macOS < 15.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent dcbe7d9 commit a7bb35d
6 files changed
Lines changed: 145 additions & 6 deletions
File tree
- .github/workflows
- src
- Core/Utils
- Interface/Application
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
42 | 63 | | |
43 | 64 | | |
44 | 65 | | |
| |||
69 | 90 | | |
70 | 91 | | |
71 | 92 | | |
| 93 | + | |
72 | 94 | | |
73 | 95 | | |
74 | 96 | | |
75 | 97 | | |
76 | 98 | | |
77 | 99 | | |
78 | 100 | | |
| 101 | + | |
79 | 102 | | |
80 | 103 | | |
81 | 104 | | |
| |||
85 | 108 | | |
86 | 109 | | |
87 | 110 | | |
| 111 | + | |
88 | 112 | | |
89 | 113 | | |
90 | 114 | | |
91 | 115 | | |
92 | 116 | | |
93 | 117 | | |
94 | 118 | | |
| 119 | + | |
95 | 120 | | |
96 | 121 | | |
97 | 122 | | |
| |||
101 | 126 | | |
102 | 127 | | |
103 | 128 | | |
| 129 | + | |
104 | 130 | | |
105 | 131 | | |
106 | 132 | | |
107 | 133 | | |
108 | 134 | | |
109 | 135 | | |
110 | 136 | | |
| 137 | + | |
111 | 138 | | |
112 | 139 | | |
113 | 140 | | |
| |||
117 | 144 | | |
118 | 145 | | |
119 | 146 | | |
| 147 | + | |
120 | 148 | | |
121 | 149 | | |
122 | 150 | | |
123 | 151 | | |
124 | 152 | | |
125 | 153 | | |
126 | 154 | | |
| 155 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
206 | 238 | | |
207 | 239 | | |
208 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
275 | 276 | | |
276 | 277 | | |
277 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
0 commit comments