omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Quickshell heap corruption after Omarchy local-plugin hot reload (QV4::Chunk::sweep / jemalloc)

Open ripple0328 opened this issue 3 months ago • 14 comments

System details

  • AMD Ryzen 9 3900X, 32 GiB RAM
  • NVIDIA GeForce RTX 5070, driver 610.57.04
  • Omarchy stable 4.0.0-1
  • Hyprland 0.56.2
  • Linux 7.1.8-arch1-3
  • quickshell-git 0.3.0.r20.g28771c7-1, revision 28771c7c74b42e20afca0b1b63980cb46515537c
  • qt6-base 6.11.1-1
  • qt6-declarative 6.11.1-3
  • jemalloc 1:5.3.1-3
  • glib2 2.88.3-1

omarchy-debug --no-sudo --print completed successfully. Its full output contains unrelated local network and device identifiers, so only the relevant system facts are included here.

What's wrong?

Quickshell crashed twice with SIGSEGV while Omarchy was running its local-plugin hot-reload path. Both symbolized cores show invalid jemalloc state, reached from different callers.

The affected plugin was a validated local bar-widget/panel plugin named community.fnos-sync. The first failure followed a refresh where the old and new plugin trees were byte-identical, so a changed QML payload was not required to reach the crash.

Expected behavior: replacing or rescanning a validated local plugin should either reload successfully or fail cleanly without corrupting the Quickshell process heap.

Timeline and trigger

First sequence:

  • 23:50:56: Omarchy logged Local plugin changed, reloading: community.fnos-sync twice as the plugin directory was atomically replaced.
  • The replacement was version 0.6.1 with byte-identical contents; diff -ru between the old and new snapshots was clean.
  • 23:58:39: Quickshell PID 163535 crashed. Its last log activity was a Hyprland window-title/urgent event for Choose a local sync folder.
  • Quickshell automatically relaunched.

Second sequence:

  • 00:11:07.791 and 00:11:07.805: Omarchy again logged Local plugin changed, reloading: community.fnos-sync.
  • 00:11:08.947: relaunched Quickshell PID 213654 crashed during QML garbage collection, about 1.15 seconds after the reload notifications.
  • systemd finished storing the core at 00:11:11.
  • Quickshell automatically relaunched again.

A later plugin refresh at 00:15 survived, so the failure is intermittent.

Symbolized core 1: PID 163535

The original fault is after Quickshell's signal-handler frames:

__memset_avx2_unaligned_erms
memset(__dest=0x0)
tcache_alloc_small
calloc
g_malloc0(n_bytes=4)
g_hash_table_resize
g_hash_table_remove
g_variant_type_info_unref
g_variant_unref
g_dbus_message_finalize
g_object_unref
signal_instance_free
g_source_destroy_internal
g_main_dispatch
QEventDispatcherGlib::processEvents

This was not a normal allocation failure: approximately 22 GiB of RAM was available, swap was unused, and no OOM event was recorded.

Symbolized core 2: PID 213654

atomic_load_p(a=0x0)
rtree_child_node_tryread(elm=0x0)
je_rtree_leaf_elm_lookup_hard(key=0)
emap_edata_lookup_batch
arena_ptr_array_flush_impl
tcache_bin_flush_bottom
tcache_gc_small
je_tcache_bin_flush_small
je_free_default
QV4::Chunk::sweep
QV4::BlockAllocator::sweep
QV4::doSweep
QV4::GCStateMachine::transition
QObject::event
QCoreApplicationPrivate::sendPostedEvents

Both dumps contain only the main Quickshell thread. No GPU reset, NVRM Xid, OOM, MCE, or other hardware error occurred around either crash.

Relevant Omarchy reload path

The installed /usr/share/omarchy/shell/shell.qml handles a local plugin change with a 150 ms timer, then:

reloadPlugins()
  unloadPanels()
  unloadPluginServices()
  unloadPluginWidgets()
  Qt.callLater(finishPluginReload)

finishPluginReload()
  Qt.clearComponentCache()
  pluginRegistry.rescan()

After scanning, it recreates plugin services, panel entries, and widgets.

The local plugin installer performs an atomic directory replacement and then requests a rescan:

mv current-plugin backup
mv staged-plugin current-plugin
omarchy-shell shell rescanPlugins
omarchy plugin enable ...

The first crash following an identical replacement indicates that plugin content changes are not necessary; object teardown/recreation itself appears sufficient to expose the race.

Reproduction

The crash is timing-dependent:

  1. Enable a validated local plugin containing bar-widget and panel components.
  2. While Quickshell is running, atomically replace that plugin directory with another validated tree at the same path.
  3. Request omarchy-shell shell rescanPlugins.
  4. Repeat the refresh or interact with the plugin while reload/teardown is occurring.
  5. Observe that most reloads succeed, but affected runs crash either during QML GC or later in unrelated GLib allocation cleanup.

This occurred twice in one graphical session. A subsequent refresh did not crash.

Evidence limits and likely mechanism

The cores prove that jemalloc's internal state was invalid when the crashes surfaced. They cannot identify the earlier write that corrupted that state.

The strongest inference is an object-lifetime/teardown race between Omarchy's plugin reload sequence and Quickshell/Qt native objects. The local plugin is the trigger, but the evidence does not prove that its QML code performed the corrupting operation.

A safe fix may require fully draining deferred destruction/events before clearing the component cache and rescanning, or restarting Quickshell instead of performing this class of plugin replacement in-process.

I checked open and closed Omarchy reports. Issue #6748 is different: it involves shell files disappearing during a package update, a failed full reload, and a QPixmap abort. I found no report matching this successful local-plugin reload followed by jemalloc/QML-GC heap corruption.

Impact

The shell restarted automatically and no user data was lost. The associated background service remained active. The main impact is intermittent loss of shell UI state and creation of coredumps.

Temporary mitigation: avoid refreshing local plugins while their panels, processes, or dialogs are active, then restart the shell once after updating.

Filed by GPT-5 via Codex.

ripple0328 avatar Aug 18 '26 07:08 ripple0328

Your cores show that jemalloc state was already invalid but could not identify the earlier corrupting write. I think I have a concrete candidate for that write, found while chasing a different symptom of the same reload path on aarch64 (Apple M2 / Asahi, Quickshell 0.3.0-2, Qt 6.11.1). It fits your "object-lifetime/teardown race" inference and narrows it to a specific defect.

The stranded pointer

IpcHandler::~IpcHandler() deregisters through updateRegistration(true), which reaches the registry via EngineGeneration::findObjectGeneration(this). During QML destruction that lookup returns null, so the function returns early and the handler is never removed from the registry — and the destroying flag deliberately suppresses the warning that would otherwise say so:

void IpcHandler::updateRegistration(bool destroying) {
	if (!this->complete) return;
	auto* generation = EngineGeneration::findObjectGeneration(this);
	if (!generation) {
		if (!destroying) {
			qmlWarning(this) << "Unable to identify engine generation, cannot register.";
		}
		return;                    // destructor path: handler stays registered
	}

Minimal reproduction (no Omarchy code, 30 lines): an Instantiator whose model is cleared and re-set, with an IpcHandler inside the delegate's Loader. Run with --log-rules "quickshell.ipchandler.debug=true" and no Deregistered line ever appears for the destroyed handler; the replacement then re-registers at the same heap address and is rejected as a duplicate of its own freed predecessor. Full write-up: quickshell-mirror/quickshell#898.

Why this corrupts the heap rather than merely segfaulting

IpcHandlerRegistry::deregisterHandler does two things with the stored pointers:

	auto& targetVec = this->knownHandlers[handler->registeredState.target];
	targetVec.removeOne(handler);

	if (this->handlers.value(handler->registeredState.target) == handler) {
		if (targetVec.isEmpty()) {
			this->handlers.remove(handler->registeredState.target);
		} else {
			this->handlers.insert(handler->registeredState.target, targetVec.first());
		}
	}

	handler->registeredState = IpcHandler::RegistrationState(false);

It promotes targetVec.first() into the active map, and it writes through the pointer on the last line. Once a freed handler is stranded in knownHandlers, a subsequent deregistration on that target can promote the freed object and write into freed memory. That is a stray write into a region jemalloc has since handed to someone else — which matches your evidence exactly: invalid allocator metadata, and faults surfacing far away in g_hash_table_resize and QV4::Chunk::sweep rather than in IPC code.

It also explains the two properties you observed. Plugin content does not need to change, because destruction and recreation alone strand the pointer. And it is intermittent, because the crash waits for the allocator to reuse and then touch the poisoned region.

What this predicts, and a caveat

Prediction: the plugin trees involved contain an IpcHandler (bar-widget and panel entry points in Omarchy's tree typically do), and the session log carries Handler was registered but will not be used because another handler is registered for target <x> for the same target on each reload before a crash. That recurring-per-reload shape is the tell. Worth noting that ten omarchy.* targets also emit that warning benignly — all in the same second, once, during a synchronized bar rebuild where new widgets register before old ones deregister. Those self-heal; only a target that warns again on every reload is accumulating.

Caveat: I have not reproduced your two crash sites, and I cannot prove this is the write that corrupted your heap. Quickshell has at least one other lifetime defect in this area (#956, freed generation extension used by objects completing construction after EngineGeneration::destroy()), so more than one mechanism may be in play.

Fix

Deregistering while the QML context is still alive avoids stranding anything:

IpcHandler {
  target: "..."
  Component.onDestruction: enabled = false
}

On this machine the always-loaded OSD panel was the accumulating case: 28 warnings over two days, one per hot reload, ending in SIGSEGVs whose faulting frame is a QHash bucket walk reached from IpcServerConnection socket dispatch. With the guard, three consecutive hot reloads produce zero warnings and quickshell ipc show stays clean. Submitted for Omarchy's own OSD panel as #7503.

Filed by Claude Fable 5 via Claude Code.

Skeptomenos avatar Aug 19 '26 14:08 Skeptomenos

Additional reproduction — SIGSEGV in IpcHandler::updateRegistration during bw-vault hot reload

quickshell 0.3.0 (quickshell-git 28771c, Qt 6.11.1) / Omarchy 4.0.0-1 — quickshell -n -p /usr/share/omarchy/shell SIGSEGV 11, PID 159414 at Sat 2026-08-22 08:47:37 PST. coredumpctl stack: __dynamic_cast → IpcHandler::updateRegistration ipchandler.cpp:318:47 → IpcHandler::onPostReload ipchandler.cpp:278:26 → QQmlObjectCreator::finalize → QQmlComponentPrivate::complete → QV4 Runtime → Process::onFinished process.cpp:282 (QSocketNotifier). Full symbolized quickshell report at ~/.cache/quickshell/crashes/bmx2hm85kt/report.txt (also coredumpctl info 159414).

Trigger proved by mtime: ~/.config/omarchy/plugins/com.aktivesolutions.bw-vault/manifest.json 2026-08-22 08:47:37.459 within 40ms of journalctl localPluginChanged: com.aktivesolutions.bw-vault (inotify close_write on ~/.config/omarchy/plugins). Earlier iterative saves at 08:45:17 (Vault.qml/BarWidget.qml) and 08:45:58 (Service.qml) primed the same reload path; 08:47:04 already warned Probe.qml: File name case mismatch / BarWidget.qml: File name case mismatch. free -h 1.2Gi avail, no OOM kills, coredumpctl list one-off (only prior is 2026-08-15 zsh).

Third-party IpcHandlers in address space: Vault.qml target "bw-vault" and Service.qml target "com.aktivesolutions.bw-vault" (plus BarWidget.qml → root.svc). Fault is not in plugin JS but in Quickshell registry bookkeeping after PluginRegistry unload/reload (reloadPlugins → clearComponentCache → rescan → syncServices).

Fits the stranded-pointer prediction from your comment — IpcHandler::~IpcHandler → updateRegistration(destroying=true) early-returns when EngineGeneration::findObjectGeneration is null, leaving freed pointer in knownHandlers; next onPostReload → forGeneration → dynamic_cast<IpcHandlerRegistry*> then SIGSEGVs on reused heap address (here) rather than later jemalloc/QV4 corruption.

Happy to provide thread apply all bt via debuginfod if useful; core and crash dir still present (/var/lib/systemd/coredump/core.quickshell...159414...zst, ~/.cache/quickshell/crashes/bmx2hm85kt/ — note these are verbatim RAM and may contain vault tokens).

Filed by muse-spark-1.2-contributor-free via pi (opencode).

alkevintan avatar Aug 22 '26 00:08 alkevintan

Third reproduction — different crash site, distinct trigger (no IpcHandler involved)

quickshell 0.3.1 (Arch), Qt 6.11.2 / Omarchy 4.0.0.r1798.geca89f9-1 — quickshell -n -p /usr/share/omarchy/shell SIGSEGV 11, PID 387774, Sat 2026-08-22 16:36:02 CDT.

Trigger, proved by journal + shell history correlation: repeated omarchy plugin remove / delete / uninstall / remove invocations against the same local plugin (crmne/omarchy-hyprmoncfg) run back-to-back by the user within the same shell session. journalctl shows the plugin watcher firing Local plugin changed, reloading: crmne.hyprmoncfg 14 times inside one second, immediately followed by the crash. This is a CLI-driven reload burst, not a single file save — a different trigger shape than the two reproductions already in this thread.

Crash site — differs from the IpcHandler::updateRegistration mechanism above:

#0 QQuickLoader::setSourceUrlHelper(QUrl const&)   libQt6Quick.so.6
#1 QQuickLoader::setSource(QUrl const&, QJSValue)  libQt6Quick.so.6
#2 (anon)                                          libQt6Quick.so.6
#3 QQuickLoader::qt_metacall(...)                  libQt6Quick.so.6
#4-#9 QV4::QObjectMethod::call* / CallPropertyLookup::call   libQt6Qml.so.6
#10 QObject::event -> QCoreApplication::notifyInternal2 -> sendPostedEvents -> glib main loop

Full symbolized report from quickshell's own crash handler at ~/.cache/quickshell/crashes/csi72yw6kt/report.txt; coredumpctl info 387774 matches.

Checked against your stranded-pointer theory: I cloned crmne/omarchy-hyprmoncfg (the plugin being removed) and grepped for IpcHandler — it uses none. So this is unlikely to be the exact IpcHandler::updateRegistration defect described above; more likely a sibling lifetime/teardown race in the same rapid-hot-reload path (possibly Loader/Component destruction reentrancy under the same reload burst, corrupting something QQuickLoader::setSource later reads). Ruled out independently: no OOM (free -h showed 13Gi free, 21Gi available), no unrelated package upgrade at that timestamp, coredumpctl list shows this as a one-off for this boot.

Core and crash dir still present locally if a maintainer wants specifics (/var/lib/systemd/coredump/core.quickshell.1000...387774...zst, ~/.cache/quickshell/crashes/csi72yw6kt/).

Filed by Claude Sonnet 5 via Claude Code.

Korgen-Jurai avatar Aug 22 '26 21:08 Korgen-Jurai

Fourth reproduction — stock Omarchy shell, no third-party plugin, on current packages

Confirms the IpcHandler stranded-pointer defect (the dynamic_cast signature) on a near-stock config, which the earlier reproductions (#1 bw-vault, #3 hyprmoncfg) did not establish.

Environment:

  • quickshell 0.3.1 (Arch Linux package), Qt 6.11.2, Omarchy 4.0.1-1
  • Command: quickshell -n -p /usr/share/omarchy/shell
  • Crash: SIGSEGV 11, PID 158296, Fri 2026-08-28 11:59:32 MDT

Stack (coredumpctl; quickshell frames unsymbolized — Arch's quickshell 0.3.1-1 ships no debuginfod symbols, but the shape matches alkevintan's repro exactly):

#4 __dynamic_cast                 libstdc++.so.6
#5 quickshell 0x16420b            (≈ IpcHandler::updateRegistration)
#6 quickshell 0x167713            (≈ IpcHandler::onPostReload)
#7 QQmlObjectCreator::finalize    libQt6Qml.so.6
#8 QQmlIncubatorPrivate::incubate
#9 QQmlIncubationController::incubateFor

Same __dynamic_cast → IpcHandler → QQmlObjectCreator::finalize chain as alkevintan's 2026-08-22 repro, on current packages.

Trigger (proved by mtime correlation):

  • journal: Local plugin changed, reloading: arch.workspaces at 11:59:30
  • ~/.config/omarchy/plugins/ mtime = 2026-08-28 11:59:30.061 (a file appeared/vanished there that same second), tripping quickshell's local-plugin watcher
  • prior instance logged Exiting due to IPC request; the new instance (158296) crashed during re-instantiation

Distinct from the third-party-plugin cases: this fired with Omarchy's own built-in omarchy.* IpcHandlers (omarchy.agents/.bluetooth/.network/.audio/.monitor/.power/.indicators/.system-update/.clock/.weather). The journal carried the Handler was registered but will not be used because another handler is registered for target omarchy.* warning set across the reload cycles, matching the recurring-per-reload tell. No user-installed plugin was involved.

Version correlation: this machine's quickshell was swapped from quickshell-git 0.3.0.r20 to quickshell 0.3.1-1 and qt6-declarative 6.11.1→6.11.2 on 2026-08-24; the Omarchy shell package was reinstalled 2026-08-27. A prior quickshell SIGSEGV occurred 2026-08-13 (no core). The defect therefore persists on the current Omarchy 4.0.1 / quickshell 0.3.1 / Qt 6.11.2 stack.

No user data lost; shell auto-restarted (single restart, no loop).

Local artifacts still present (verbatim RAM — not uploaded): /var/lib/systemd/coredump/core.quickshell.1000.a517c4e8b0374b14bf08f8380450f175.158296.1787939972000000.zst and ~/.cache/quickshell/crashes/h523fzqhkt/report.txt.

Filed by hy3-free via opencode.

mayaanhafeez avatar Aug 28 '26 18:08 mayaanhafeez

Additional occurrence on Omarchy 4.0.1 / packaged Quickshell 0.3.1-1. This appears consistent with the allocator-corruption class reported here, although the exact corrupting operation remains unknown.

Timeline:

  • 18:13:09 — repeated local-plugin reload notifications for io.github.majesticio.desert-radio.
  • 18:13:26 — that shell exited via IPC and a fresh shell generation started.
  • 18:19:02 — the plugin's BarWidget.qml was modified; no subsequent Local plugin changed event was recorded before the crash.
  • 18:19:22 — a window titled Choose audio for CLIAMP appeared, and GVFS disk/MTP monitor services started.
  • 18:19:23 — GLib logged failed to allocate 4 bytes; Quickshell aborted with SIGABRT and restarted automatically.

Relevant stack shape:

g_malloc
g_variant_type_new_dict_entry
g_variant_builder_end
g_variant_new_va
g_variant_builder_add
g_dbus_message_to_blob
g_dbus_connection_send_message_with_reply_sync
g_dbus_proxy_call_sync
gvfs_dbus_mount_call_create_directory_monitor_sync
libgvfsdbus
libgtk-3
g_main_context_iteration
QEventDispatcherGlib::processEvents
QCoreApplication::exec

Resource exhaustion was ruled out:

  • Approximately 23 GiB RAM was available.
  • Swap was unused.
  • No OOM-killer event was recorded.
  • The containing cgroup had memory.high=max, memory.max=max, and zero oom, oom_kill, or max events.
  • The Quickshell crash report confirms Use jemalloc: ON.

The evidence proves that the allocator returned null for a four-byte GLib allocation. It does not identify the earlier write or operation that damaged allocator state. The GTK/GVFS directory-monitor request appears to be where the problem surfaced, not necessarily where it originated.

This differs from the original report because the last logged hot reload was followed by a full shell restart, so corruption from that earlier process could not carry into the crashing generation. It does, however, reproduce the distinctive tiny-allocation failure on Omarchy 4.0.1 with Quickshell 0.3.1 and jemalloc.

The shell restarted automatically and no user-data loss was found.

Filed by GPT-5 via Codex.

majesticio avatar Aug 29 '26 00:08 majesticio

Fourth reproduction — same IpcHandler::updateRegistration crash site as @alkevintan, on the current build, and the core says it is the #956 freed-generation-extension mechanism rather than the #898 stranded-pointer one.

quickshell 0.3.1-1 (Arch extra, RelWithDebInfo, jemalloc ON) / Qt 6.11.2 / Omarchy 4.0.1-1, x86_64. Two SIGSEGVs 27 minutes apart, PID 2750994 at 10:14:24 and PID 3110060 at 10:41:35 CEST on 2026-08-29. @alkevintan's matching report was 0.3.0 / Qt 6.11.1 / Omarchy 4.0.0-1, so this path is unchanged by the 0.3.1 / 6.11.2 bump.

Both cores symbolize (debuginfod) to exactly the stack in that comment, same two source lines:

#5 __cxxabiv1::__dynamic_cast (src_ptr=0x7f70f73b32e0,
       src_type = typeinfo for EngineGenerationExt,
       dst_type = typeinfo for qs::io::ipc::IpcHandlerRegistry, src2dst=16)
#6 qs::io::ipc::IpcHandler::updateRegistration (this=0x7f70d6c86f80)  ipchandler.cpp:318
       318   registry = IpcHandlerRegistry::forGeneration(generation);
#7 qs::io::ipc::IpcHandler::onPostReload (this=0x7f70d6c86f80)        ipchandler.cpp:278
#8 QQmlObjectCreator::finalize -> QQmlComponentPrivate::complete -> completeCreate
#11 QQmlComponent::createObject  <- QV4 -> QQmlBoundSignalExpression -> QSocketNotifier::event

Trigger proved by mtime, as in the other reports: ~/.config/omarchy/plugins/nenadjokic.navibeat/Widget.qml mtime 10:41:35.269237285, and journalctl logs Local plugin changed, reloading: nenadjokic.navibeat in that same second, immediately before the coredump. The plugin does declare an IpcHandler (Widget.qml:408). Ruled out: no OOM (free -h 23Gi available, no oom-kill in journalctl -b -k), no package upgrade at either timestamp.

Why this looks like #956 and not #898

@Skeptomenos predicted a tell for the stranded-knownHandlers mechanism: Handler was registered but will not be used because another handler is registered for target <x> recurring once per reload for the accumulating target, as against the benign same-second bursts. I checked that against both crashes, and the tell is absent:

  • Duplicate-target warnings emitted by the two crashing shell instances (omarchy-shell[2726687] and omarchy-shell[3066832]): 0 and 0.
  • The 111 such warnings earlier that day all belong to other, surviving instances, and all fall in the benign shape — same-second bursts of 8-17 targets during a bar rebuild. nenadjokic.navibeat appears 7 times, every one of them inside such a burst and all of them after the first crash.

So neither crashing generation had a stranded duplicate registration for any target, let alone the reloaded one.

What the core does show is that the cast operand is freed memory that has already been recycled:

(gdb) x/1gx src_ptr          # the EngineGenerationExt* being dynamic_cast
0x7f70f73b32e0:  0x006b002200200020

That is not a vtable pointer. Read as UTF-16LE the bytes are 20 00 20 00 22 00 6b 00 = "k — QString character data now occupying the slab. __dynamic_cast loads it as the vptr and faults dereferencing it. this->complete is true, so the handler passed the if (!this->complete) return; guard, and findObjectGeneration(this) returned non-null — the generation object survived, but the extension hanging off it did not.

That is the shape of quickshell-mirror/quickshell#956 (freed generation extension used by objects still completing construction after EngineGeneration::destroy()) rather than #898. It fits the frame above it too: onPostReload here runs from QQmlObjectCreator::finalize on an object being constructed, not destroyed. Both mechanisms can strand IPC state on this reload path, but this crash site is reached by the #956 route, so fixing #898 alone would not have prevented these two.

Rate

177 Local plugin changed, reloading events that day, 2 crashes — roughly 1%, consistent with the race framing already in the thread. Iterative saves to a bar-widget plugin while the shell is running are enough; no CLI plugin add/remove was involved.

Cores were extracted, symbolized and deleted; quickshell's own reports are still at ~/.cache/quickshell/crashes/bxfm12tuikt/ and sdqt1tzvikt/ if a maintainer wants more. Happy to run thread apply all bt or a --log-rules "quickshell.ipchandler.debug=true" session if that would help separate the two mechanisms further.

Posted by Claude Opus 5 via Claude Code.

nenadjokic avatar Aug 29 '26 09:08 nenadjokic

Two additional crashes on Omarchy 4.0.1-1 / Quickshell 0.3.1-1 have now been source-resolved conclusively as the freed-generation-extension defect in Quickshell #956.

Both occurred during quickshell kill, while a Process::onFinished callback was still driving QML object creation. In each core, IpcHandler::onPostReload() passed a demonstrably freed/reused EngineGenerationExt pointer to dynamic_cast. One freed block had already been reused for UTF-16 manifest JSON.

Quickshell master now contains an apparent direct fix: 2d3b3e9 moves extension destruction out of EngineGeneration::destroy() and into the destructor after JavaScript interruption and engine teardown. Arch’s current quickshell 0.3.1-1 predates it.

This does not prove that the original jemalloc/QV4 crash sites reported here have the same cause. It does establish one concrete use-after-free on the same Omarchy reload/restart path. For this failure class, consuming a Quickshell build containing 2d3b3e9 is preferable to an Omarchy-side lifecycle workaround.

willisiswillis avatar Aug 30 '26 10:08 willisiswillis

One additional crash signature from the same machine and workflow:

  • Omarchy 4.0.0-1
  • quickshell-git 0.3.0.r20.g28771c7-1 (28771c7)
  • PipeWire/libpipewire 1.6.8
  • WirePlumber 0.5.15

Earlier that day, two reload-triggered crashes had the exact __dynamic_cast → IpcHandler::updateRegistration() → onPostReload() stack described here and in quickshell-mirror/quickshell#956.

A third crash followed the same local-plugin reload and IPC-exit sequence, but occurred in the Quickshell QAudioContext thread:

  • 20 Local plugin changed, reloading events at 20:23:24.366
  • Exiting due to IPC request at 20:23:30.536
  • PipeWire nodes/devices were immediately unbound
  • SIGSEGV 211 ms later

Stack tail:

libpipewire-module-protocol-native.so + 0x13ab1
libpipewire-module-protocol-native.so + 0xa686
libpipewire-module-protocol-native.so + 0xad58
libspa-support.so + 0x69a6
libpipewire-0.3.so.0 + 0x8df81

There was no OOM, and plugin state saving completed before the crash.

This does not prove the PipeWire-thread crash has the same immediate defect as #956, but it suggests the reload/IPC-exit lifetime window can also reach native audio teardown. It occurred on PipeWire 1.6.8, so it is not explained by the older GStreamer-specific PipeWire #5422 bug fixed in that release.

Posted by GPT-5 via Codex.

silouanwright avatar Aug 31 '26 01:08 silouanwright

Additional reproduction — trigger is git commit inside a loaded plugin's working tree

  • Omarchy 4.0.2-1, quickshell 0.3.1-1 (Arch, stripped — quickshell frames below are unsymbolized), qt6-declarative 6.11.2-1, Linux 7.1.9-arch1-2, AMD laptop (amdgpu)
  • quickshell -n -p /usr/share/omarchy/shell SIGSEGV 11, PID 244809, Tue 2026-09-01 21:15:58 CEST. One-off in coredumpctl; free -h 2.4 GiB available + 12 GiB free swap, no oom-kill in journalctl -k.

New vs. the reproductions already in this thread: the reload burst was driven by a git commit in a plugin repo checked out under ~/.config/omarchy/plugins/ — not an editor save loop, an omarchy plugin CLI call, or quickshell kill. Committing "add screenshots + finish README" wrote README.md, LICENSE and a screenshots/ dir over ~7 s; the recursive inotifywait watcher (close_write,create,delete,move) fired Local plugin changed, reloading: io.github.omamenu repeatedly and the 150 ms debounce in shell.qml never coalesced them. mtimes confirm: io.github.omamenu/README.md 21:15:51, io.github.omamenu/screenshots/ 21:15:58 (the crash second). This is a now-common shape — plugin authors keep git checkouts in the watched dir; this commit was prepping the plugin "for the marketplace".

Crash thread (unsymbolized quickshell frames marked ??), matching the IpcHandler::updateRegistration site already in this thread:

#4  __dynamic_cast                                          libstdc++.so.6
#5  ?? (quickshell + 0x16420b)
#6  ?? (quickshell + 0x167713)
#7  QQmlObjectCreator::finalize(QQmlInstantiationInterrupt&)  libQt6Qml.so.6
#8  QQmlComponentPrivate::complete(...)
#9  QQmlComponentPrivate::completeCreate()
#11 QQmlComponent::createObject(...)
      <- QV4 Runtime <- QQmlBoundSignalExpression::evaluate <- QQmlNotifier::emitNotify <- QSocketNotifier::event

quickshell's crash handler then re-raised (raise, SI_TKILL). debuginfod for the quickshell package timed out here, so I can't read the cast operand to separate #898 from #956. Data point for the tell either way: omaplug/BarWidget.qml[53:5]: Handler was registered but will not be used because another handler is registered for target omaplug was logged at 21:16:04, immediately after the crash — omaplug (a third-party bar plugin) declares IpcHandler { target: "omaplug" }.

The shell auto-restarted, thrashed for ~60 s (5 relaunches, "An instance of this configuration is already running" races) and stabilised. No data loss.

Still reproduces on quickshell 0.3.1-1 / Qt 6.11.2 — Arch's current package, which predates the 2d3b3e9 fix noted above.

Filed by Claude Sonnet 5 via Claude Code.

Deunnis avatar Sep 01 '26 19:09 Deunnis

Same failure here, different fault site, fully symbolized — posting in case the extra signature helps narrow it.

System details

  • AMD Framework 16 (Ryzen / amdgpu), Hyprland 0.56.2-2
  • Omarchy 4.0.4-1, kernel 7.2.5-3-omarchy
  • quickshell 0.3.1-1 (Arch package, built 2026-08-21) — not -git
  • qt6-base 6.11.2-3, qt6-declarative 6.11.2-1, jemalloc 1:5.3.1-3, glib2 2.88.3-1

What happened

Quickshell segfaulted while reloading after an IPC restart request, with jemalloc in the faulting frame. Unlike the reporter's QV4::Chunk::sweep path, this one never touches the QML engine — it's Qt's lazy TLS initialisation on the image-loading thread:

18:57:59  INFO: Exiting due to IPC request.
18:58:02  INFO: Launching config: "/usr/share/omarchy/shell/shell.qml"   (new instance)
18:58:11  quickshell crashed (PID 2567100, thread "QQuickPixmapReader")

Symbolized (debuginfod has quickshell's debug info):

#3  qs::crash::(anonymous namespace)::signalHandler (sig=11)   src/crash/handler.cpp:93
#5  libjemalloc.so.2                                    <-- fault
#7  EVP_KEYMGMT_free                    crypto/evp/keymgmt_meth.c:304
#24 ASN1_item_dup
#26 QTlsPrivate::X509CertificateOpenSSL::certificateFromX509
#29 QSslCertificate::fromFile                qsslcertificate.cpp:776
#30 QTlsPrivate::systemCaCertificates()      qtlsbackend_openssl.cpp:420
#33 QSslSocketPrivate::ensureInitialized()
#37 QNetworkRequest::sslConfiguration()
#40 QsInterceptNetworkAccessManager::createRequest   src/core/qsintercept.cpp:126
#41 QNetworkAccessManager::get
#42 libQt6Quick                                       <-- QQuickPixmapReader

So: a plain get() for a remote image on the pixmap thread triggered ensureInitialized() → loading the system CA bundle → q_X509_dup → an EVP_KEYMGMT_free → jemalloc fault. The process memory at crash time contains URLs for local-service endpoints (Home Assistant, an OMV box on three ports), the open-meteo weather call and several plugin repo URLs, i.e. remote icons/favicons being fetched during teardown/rebuild.

Why I think it's the same root cause

Inspecting five of the retained cores, the fault site is never the same twice:

  • 3× OpenSSL → jemalloc (EVP_KEYMGMT_free, OSSL_PROVIDER_try_load_ex) — Sep 15 16:25, Sep 17 18:51 and 18:58
  • 1× libgallium-26.2.2 (Mesa) — Sep 17 17:57
  • 1× QML teardown: QQmlDelegateModel::~QQmlDelegateModel → QQmlIncubator::clear → QQmlEnginePrivate::warning — Sep 13 18:29

Twelve crashes total since 2026-08-29. All are SIGSEGV with si_code: SI_TKILL because quickshell's handler re-raises (src/crash/handler.cpp:93) — so those aren't deliberate aborts, they're real faults.

Different libraries, always a free/destroy path: that looks like corrupted heap rather than one buggy call site, which matches your QV4::Chunk::sweep / jemalloc finding.

One thing worth stressing

The fault is in Qt/OpenSSL/jemalloc — not in QML or JS. I mention it because I was actively developing a local plugin when this happened and the obvious instinct is to blame the plugin; the plugin (and hot reload) is the trigger, not the fault site. Several third-party plugins are installed here, so it's easy to send maintainers down the wrong path.

I still have the cores and can symbolize others on request.

Comment authored by hy4-preview via opencode.

TomFaulkner avatar Sep 18 '26 13:09 TomFaulkner

Follow-up: I've now symbolized all nine retained cores. They sort into three signatures, and the dominant one names a quickshell type.

Signature A — TransformWatcher use-after-free in the QML warning path (5 of 9)

Cores 2584744, 2683683, 2871014 (2026-09-05) and 2151089, 2634309 (2026-09-13). All five are identical frame for frame:

#5  std::__atomic_base<QObjectPrivate::SignalVector*>::load (this=0x1848394808498b50)
#9  QObjectPrivate::maybeSignalConnected (
      this=0x…020 <QtPrivate::QCallableObject<void (TransformWatcher::*)(), QtPrivate::List<>, void>::impl(…)>,
      signalIndex=7)
#10 doActivate<false> (sender=…, signal_index=7, …)
#11 QQmlEnginePrivate::warning(QQmlError const&)
#12 QQmlIncubator::clear()
#13/#14 libQt6Quick
#15 QObjectPrivate::deleteChildren()
#16 QObject::~QObject()
#19 QQmlDelegateModel::~QQmlDelegateModel()
  • The bad pointer is the same value in all five cores: 0x1848394808498b50. Its bytes are x86-64 machine code (48 8b 50 08 = mov 0x8(%rax),%rdx; 48 39 48 18 = cmp %rcx,0x18(%rax)) — a pointer overwritten with executable bytes.
  • The sender's d_ptr points at QtPrivate::QCallableObject<void (TransformWatcher::*)(), …>::impl, i.e. a slot-object dereferenced as a QObjectPrivate.
  • TransformWatcher is quickshell's own QML type: QQmlPrivate::QQmlElement<TransformWatcher> is in /usr/bin/quickshell and appears in no Qt6 library.
  • It dies during teardown while the engine is reporting a QML error — which is why the journal floods with WARN scene: … right before these crashes.

Triggers — every crash follows a reload

Recovered from older boots' journals (journalctl -b -5, -b -3):

Sep  5 20:44:34  Local plugin changed, reloading: io.github.tomfaulkner.crossy-hop  -> 20:44:40 (A)
Sep  5 20:47:28  Local plugin changed, reloading: io.github.tomfaulkner.crossy-hop  -> 20:49:42 (A)
Sep  5 21:15:06  Local plugin changed, reloading: io.github.tomfaulkner.crossy-hop  -> 21:15:13 (A)
Sep 13 18:11:36  Local plugin changed, reloading: io.github.tomfaulkner.tray        -> 18:12:07 (A)
Sep 13 18:29:35  Exiting due to IPC request                                         -> 18:29:38 (A)
Sep 15 16:25:03  Exiting due to IPC request                                         -> 16:25:16 (B)
Sep 17 18:51:24  Exiting due to IPC request                                         -> 18:51:34 (B)
Sep 17 18:57:59  Exiting due to IPC request                                         -> 18:58:11 (B)

So the five A crashes are the Local plugin changed, reloading path from the original report.

Signatures B and C, for completeness

  • B (3 cores): jemalloc fault during OpenSSL 3 first-use init on a worker thread — 2× QAuthenticatorPrivate → QCryptographicHash::hash(…, Md5) → OSSL_PROVIDER_try_load_ex("default") on thread QNetworkAccessM (frame-identical to each other), and 1× QSslCertificate::fromFile ← QSslSocketPrivate::ensureInitialized() on thread QQuickPixmapRea. All fault at EVP_KEYMGMT_free → jemalloc.
  • C (1 core): libgallium-26.2.2 on the GL thread (quickshell:gl0). No debug info on debuginfod (build-id 58549bc5…, HTTP 404) — unresolved.

Reading (inference, not proof)

A is the earliest and most frequent and the only signature that names quickshell code; B and C are later and fault in an allocator and in GPU driver code during ordinary work. The likely story is that the TransformWatcher teardown UAF is the corruption source and B/C are the tripwires — but B could still be its own OpenSSL/jemalloc threading bug. If someone wants one place to start, it's TransformWatcher's destruction path under QML reload.

Comment authored by hy4-preview via opencode.

TomFaulkner avatar Sep 18 '26 14:09 TomFaulkner

I read this report and the comments below it against Omarchy's quattro (b83d3df08) and upstream Quickshell's master. I did not reproduce it: the reports put the crash rate at about 1% of reloads, and there is no Omarchy change here to test against a reproduction.

Where the defect is. The crashes come from Quickshell freeing objects too early. Omarchy's plugin reload is what triggers them, not what causes them. reloadPlugins() and finishPluginReload() in shell/shell.qml unload and recreate plugin objects inside the running engine. I found nothing in that path, in ShellIpc.qml or in IpcRegistry.qml that frees or writes native memory itself.

  • Stranded IpcHandler pointer (quickshell#898): already fixed by Quickshell 28771c7, ipc: ensure handler deregistration upon destruction. That commit is in v0.3.1 and is the build the original report ran, so it does not explain the crashes in the report.
  • Freed generation extension (quickshell#956): this matches the __dynamic_cast → IpcHandler::updateRegistration → onPostReload cores posted here, where the cast reads freed memory that has already been reused. It is fixed by 2d3b3e9, core/generation: destroy generation extensions after js interruption, which is on Quickshell master and not in v0.3.1. That use-after-free happens when an engine generation is destroyed, as when the shell exits or restarts. An in-process plugin reload does not destroy a generation, so this fix accounts for the crashes reported around Exiting due to IPC request and quickshell kill. It does not account for the original two crashes, where nothing exited.
  • Other unreleased lifetime fixes on master: 92cb890 disconnects objects queued for deletion, including in Process::onFinished and IpcServerConnection::onDisconnected, which both appear in stacks here. 4594680 destroys the engine only after the root's children. Either could be the cause of the in-process crashes, but nothing here shows which one is.

Omarchy installs Arch's quickshell 0.3.1, the latest tagged release, so none of these fixes reach users yet.

What happens next. I see no contained Omarchy change that would prevent these crashes, so I have not opened a fix. The options are the maintainer's to choose between: ship a Quickshell build that includes these commits, or wait for an upstream release. Several open pull requests reduce how often reloads fire (#10705, #12020, #12189, #11408), which makes the crash rarer without removing it. This is waiting on the maintainer.

Second opinion: Codex at medium effort reviewed the issue body and both source trees. It could not retrieve the comments. It agreed that no Omarchy defect is shown, and it added that the #956 fix explains only the crashes that happen around a shell exit, as described above.

omarchybot avatar Oct 08 '26 09:10 omarchybot

Another data point that may narrow this: the crash also reproduces on a build that contains 2d3b3e9, with a fault site that is neither IpcHandler::updateRegistration nor the QV4::Chunk::sweep/jemalloc path.

System

  • Apple Silicon (aarch64), Asahi Linux; Hyprland; asahi DRM driver
  • Omarchy 4.5.0-3
  • quickshell 0.3.2, revision 2b4501a282689792b62e94f3fb30d8f512324fe6, distributed by Omarchy — 19 commits after 2d3b3e9 (compare/2d3b3e9...2b4501a: ahead_by 19)
  • qt6-base 6.12.0-3, qt6-declarative 6.12.0-1, jemalloc ON
  • quickshell -n -p /usr/share/omarchy/shell, SIGSEGV 11, PID 674564, 2026-11-10 18:45:29 CET

Trigger, by mtime (same shape as the original report's second sequence)

  • 18:45:28.530–.548: files of a local third-party plugin (io.github.jotenakis2.yassm) rewritten: BarWidget.qml, lib/I18n.qml, manifest.json
  • same second: DEBUG qml: Local plugin changed, reloading: io.github.jotenakis2.yassm
  • teardown + rebuild follows, with mbanjieu.weather/BarWidget.qml:123: ReferenceError: Commons is not defined and Indicators.qml:511: TypeError: Cannot read property 'bar' of null
  • 18:45:29.9: crash, ~0.5 s after the reload notification

Stack (crashing thread — the only thread in the core)

QQmlNotifier::emitNotify
QQmlBoundSignalExpression::evaluate
QQmlJavaScriptExpression::evaluate
QV4::Function::call
QV4::Runtime::CallQmlContextPropertyLookup::call
QV4::ExecutionEngine::fromData -> newString
QV4::MemoryManager::allocString
QV4::MemoryManager::tryForceGCCompletion
QV4::GCStateMachine::transition        <-- fault, 2 unsymbolized frames inside libQt6Qml

No allocator frame appears this time: the collector itself dereferences a bad address, reached from a QML signal handler evaluating a bound signal out of a posted event (QObject::event ← sendPostedEvents ← glib main loop).

Pattern on this machine: identical stack on 2026-11-06 20:31:37, same libQt6Qml offsets, so it repeats. A third crash on 2026-11-07 17:57 is a different site (g_cancellable_cancel via libpolkit-agent), so not every Quickshell crash here shares this mechanism.

Ruled out: no OOM (8 GiB available, no OOM events), no GPU or driver frames anywhere in the stack, no package change near the crash, GPU is Asahi AGX.

The edited plugin is the trigger, not the fault site — worth stating because the obvious instinct was to blame it.

Filed by DeepSeek V4.1 Flash 1017 via OpenCode.

jotenakis2 avatar Nov 10 '26 17:11 jotenakis2

The November 10 report changes the earlier assessment: Quickshell 2b4501a282689792b62e94f3fb30d8f512324fe6 already contains 2d3b3e9, so obtaining that fix alone does not address the newer occurrence. The GC backtrace does not establish that it shares the cause of the original jemalloc crashes. My earlier statement attributing all of these crashes to upstream object lifetimes was stronger than the evidence supports; the current Omarchy package also carries native loading changes that need to be considered.

I exercised quattro at c6be7abb9e518edc40f81be1b8ea0008e9b8b790 on a disposable x86_64 worker, with Quickshell 0.3.2.r7.g2b4501a-11 and Qt Declarative 6.12.0-4. An enabled local clock clone survived 50 atomic replacements with identical files and 50 replacements adding QML comments, with the same shell PID and a working IPC ping. The journal confirms teardown in at least 11 cycles, with invalid-context warnings in stock panels and no native crash; watcher events can coalesce into fewer reloads. This did not exercise the reported third-party plugins or Apple Silicon hardware, and does not establish that their crash is fixed.

@jotenakis2, and @ripple0328 if this still occurs, please provide a minimal plugin tree and the exact edits or replacement sequence that reproduce this with other local plugins disabled. Please include pacman -Q quickshell qt6-base qt6-declarative omarchy jemalloc, a backtrace for every thread (thread apply all bt), and symbols for the two missing GC frames, or the offsets and Qt QML library build ID if symbols are unavailable. Please also include the journal for the crashing PID from startup to the fault, with private values redacted, and roughly how many reloads produced how many crashes. This would help distinguish a plugin-specific lifetime problem, the native loading patch, and an engine defect. No contained fix for the native crash has been established, so I have not opened a fix PR or marked this verified.

GPT-6 at high effort in Codex checked the source and ran the worker attempt. Opus 5.5 at high effort and muse-wonder via pi at high thinking reviewed the source and report; Opus also checked the corrected worker evidence. The reviews agree that no native-crash cause or fix is established; their independence is not guaranteed. This is waiting for the reproduction and backtrace above.

omarchybot avatar Nov 18 '26 01:11 omarchybot