clang frontend crash while a second crafter-build ran on the machine (5.0.0; seen twice; the shared input not located) #49
Labels
No labels
bug
claude:blocked
claude:done
claude:failed
claude:in-progress
claude:ready
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Catcrafts/Crafter.Build#49
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happened. During
crafter-build(the//stable5.0.0 flatpak) on imsd-messages, compilinginterfaces/ImsdMessages.Ui-App.cppm, clang died with "clang frontend command failed due to signal". The stack dump has it instantiatingstd::optional<ImsdMessages::Ui::FrameDriver>out of the std module (optional:957/optional:384) while parsing theAppclass. The project'scrafter-build teststarted right after and compiled the same unit without a word; the build has been green on every other run of the same commit.At that moment a second crafter-build was running on the machine from another terminal:
flatpak run --branch=local net.catcrafts.CrafterBuild(also 5.0.0) on another project, andcrafter-build --local testin the Crafter.Build checkout (its fixture projects under~/.cache/review-gate0/flatpak-debug-tools/tmp/). The same symptom under the same condition was seen once before, 2026-10-21 (noted then as "//local and //stable at once").What I could and could not establish.
~/.var/app/net.catcrafts.CrafterBuild/cache/crafter.build/— the toolchain dirs (each with a.lock) andexternal/(the dependencies' clones and built modules).external/was rewritten except the unpinned dependencies'.git/FETCH_HEADs, which this project's own build and test steps write at their start (confirmed by the timestamps of the later steps). Each project'sstd.pcmis in its ownbin/dir.Stack excerpt
Ask. Whether two crafter-build runs on one machine (any branches, any projects) share a file one of them writes while the other compiles — the toolchain dir past its
.lock's span, a dependency's checkout or module inexternal/, anything under the cache — and if so, a lock for the build's span or per-build artifact dirs. If nothing is shared, this is a clang crash to report upstream with a reproducer, and the two coincidences are just that.Second occurrence, 2026-11-01 21:57 — the same unit, the same point, again while a
crafter-build --localfrom another terminal ran (Crafter.Build's own checkout,~/repos/Crafter/Crafter.Build/bin/crafter.build-exe-…/crafter-build --local), and againcrafter-build testright after compiled the same unit without a word.This time the inner frames are on record (the first time only the driver's outer frames were read before the log was overwritten):
So it is a segfault inside clang's AST (
getCanonicalTagTypeon aTagDecl) while instantiating a libc++ template out of the std module for the project's largest module interface — not an I/O error on a module file. The std module this unit imports is the project's own (./bin/imsd-messages-ui-…/std.pcm, built earlier in the same run), which the other build cannot touch; what the two runs share is the toolchain under~/.var/app/net.catcrafts.CrafterBuild/cache/crafter.build/x86_64-unknown-linux-gnu-native-23.1.2-7dd3cdd8/(libc++'s headers and module sources, past its.lock's span?) and the machine's memory and page cache. Two for two under a concurrent build, zero crashes in the ~40 solitary builds of the same tree today; an LLVM bug with modules that only shows under load is as consistent with this as a shared file. The step's log is kept this time (captures/2026-11-01-first-push-r37/fixset/p30m-build-crash.login the fp6 journal).Third occurrence, 2026-11-01 22:14 — with NO other crafter-build running on the machine, which retires the concurrent-build theory of this issue's title. Same unit (
ImsdMessages.Ui-App.cppm, theAppclass), a different point and a different frame:Three crashes in about fifteen builds of this tree since 20:39, all segfaults inside clang's AST while instantiating a libc++
optional<T>out of the std module for the project's largest module interface, each at a different member, each gone on the immediate retry; none in the day's earlier builds of the same project. So: a non-deterministic clang 23.1.2 frontend crash with C++26 modules (dangling or uninitialised AST state when deserialising the std module's templates — the two frames,getCanonicalTagTypeon aTagDeclandcastFromDeclContext, both read a decl that is not there), not a shared file. What Crafter.Build could do about it is a retry of a compile step that dies by signal (once; the log says so) before failing the build; the crash itself belongs upstream with a reproducer, which a non-deterministic one does not give. The logs:captures/2026-11-01-first-push-r37/fixset/p30m-build-crash.logandp31m-build-crash.login the fp6 journal.