You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SIGSEGV in ScriptModel::updateValuesUnique → QObjectWrapper::wrap during delegate incubation
Summary
quickshell crashes with SIGSEGV when a ScriptModel is updated with a list whose
elements are maps/objects. The endInsertRows() inside ScriptModel::updateValuesUnique() synchronously drives a Repeater/QQmlDelegateModel
to incubate a delegate, and evaluating one of the delegate's bindings crashes inside
Qt's QML engine while wrapping a QVariantMap-of-objects
(VariantAssociationObject → Sequence::createElementWrappers → QObjectWrapper::wrap).
The full symbolicated stack (see the attached report.txt) shows the trigger is a Wayland screen change: QGuiApplication::screenAdded → QuickshellTracked::updateScreens()
→ Variants::updateVariants() → ScriptModel::updateValuesUnique(). In practice this is reproducible on demand by unplugging an external display (see Reproduction). The dms.service unit respawns quickshell automatically after each crash, so it self-recovers.
Full symbolicated trace attached as report.txt (quickshell's own crash report; frames
above #56 come from it — the raw coredump unwind stopped earlier).
What seems to be going on
A Wayland screen event (screenAdded) makes quickshell run QuickshellTracked::updateScreens(),
which drives Variants::updateVariants() and ultimately a ScriptModel update. ScriptModel::updateValuesUnique emits endInsertRows()synchronously, so a bound Repeater incubates a new delegate inside the model mutation. A binding on that
delegate reads a model value that is a QVariantMap containing QObject* (or a sequence
of them). Qt 6.11's newer VariantAssociationObject / Sequence reference-wrapper path
(fromQVariantMap → createElementWrappers → QObjectWrapper::wrap) then dereferences
something invalid — plausibly an object being torn down / re-created as part of the same
screen-driven update, i.e. a reentrancy/lifetime issue between the synchronous endInsertRows and delegate incubation. (I have not yet pinned the exact invalid object;
I plan to confirm with an AddressSanitizer build.)
This is ultimately a Qt QML-engine fault, but it is reachable from unprivileged QML via ScriptModel, so quickshell may be able to avoid it (e.g. deferring row-insert
notifications, or not exposing raw QObject-bearing maps to the sequence wrapper).
Possibly related
crash during manipulatin inside DMS settings #722 "crash during manipulation inside DMS settings" — same family (Qt QML engine
crash triggered from DMS) but a different signature (QV4::Object::insertMember from a
mouse-release, Qt 6.10.2 / qs 0.2.1). Likely distinct.
Reproduction
Reproducible on demand:
Run DMS under quickshell on niri/Wayland with an external display connected alongside
the laptop's internal panel (here: an Apple Studio Display on a Framework laptop).
Unplug the external display.
quickshell crashes with the SIGSEGV above as the output set changes.
Journal correlation for one crash (decisive — crash coincides with the output count change):
12:41:33 niri: putting output eDP-1 at x=0 y=0 # external removed, internal now sole output
12:41:37 dms: NiriService: Loaded 1 outputs # output count 3 -> 1
12:41:38 quickshell: SIGSEGV in ScriptModel::updateValuesUnique
Multiple coredumps today with identical signatures (PIDs 36367 and 41818). Coredumps
available on request.
SIGSEGV in
ScriptModel::updateValuesUnique→QObjectWrapper::wrapduring delegate incubationSummary
quickshell crashes with
SIGSEGVwhen aScriptModelis updated with a list whoseelements are maps/objects. The
endInsertRows()insideScriptModel::updateValuesUnique()synchronously drives aRepeater/QQmlDelegateModelto incubate a delegate, and evaluating one of the delegate's bindings crashes inside
Qt's QML engine while wrapping a
QVariantMap-of-objects(
VariantAssociationObject→Sequence::createElementWrappers→QObjectWrapper::wrap).The full symbolicated stack (see the attached
report.txt) shows the trigger is aWayland screen change:
QGuiApplication::screenAdded→QuickshellTracked::updateScreens()→
Variants::updateVariants()→ScriptModel::updateValuesUnique(). In practice this isreproducible on demand by unplugging an external display (see Reproduction). The
dms.serviceunit respawns quickshell automatically after each crash, so it self-recovers.Environment
avengemedia/danklinux), build-id4b6aa2750d87405501fe4fc2868fab345bf41d3dBacktrace (faulting thread, key frames)
Full symbolicated trace attached as
report.txt(quickshell's own crash report; framesabove
#56come from it — the raw coredump unwind stopped earlier).What seems to be going on
A Wayland screen event (
screenAdded) makes quickshell runQuickshellTracked::updateScreens(),which drives
Variants::updateVariants()and ultimately aScriptModelupdate.ScriptModel::updateValuesUniqueemitsendInsertRows()synchronously, so a boundRepeaterincubates a new delegate inside the model mutation. A binding on thatdelegate reads a model value that is a
QVariantMapcontainingQObject*(or a sequenceof them). Qt 6.11's newer
VariantAssociationObject/Sequencereference-wrapper path(
fromQVariantMap→createElementWrappers→QObjectWrapper::wrap) then dereferencessomething invalid — plausibly an object being torn down / re-created as part of the same
screen-driven update, i.e. a reentrancy/lifetime issue between the synchronous
endInsertRowsand delegate incubation. (I have not yet pinned the exact invalid object;I plan to confirm with an AddressSanitizer build.)
This is ultimately a Qt QML-engine fault, but it is reachable from unprivileged QML via
ScriptModel, so quickshell may be able to avoid it (e.g. deferring row-insertnotifications, or not exposing raw
QObject-bearing maps to the sequence wrapper).Possibly related
crash triggered from DMS) but a different signature (
QV4::Object::insertMemberfrom amouse-release, Qt 6.10.2 / qs 0.2.1). Likely distinct.
Reproduction
Reproducible on demand:
the laptop's internal panel (here: an Apple Studio Display on a Framework laptop).
Journal correlation for one crash (decisive — crash coincides with the output count change):
Multiple coredumps today with identical signatures (PIDs 36367 and 41818). Coredumps
available on request.
Full backtrace (66 frames)