omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Quickshell SIGSEGV in OpenSSL EVP_MD_free while loading CA certs for HTTPS album art (QQuickPixmapReader)

Open roehrbacher opened this issue 3 months ago • 5 comments

What happened

Omarchy shell (quickshell -n -p /usr/share/omarchy/shell) SIGSEGV'd on a fresh instance, about one second after launch. The crashing thread was Qt's QQuickPixmapRea image loader. It was issuing an HTTPS GET for Spotify album art and died inside OpenSSL while Qt loaded CA certificates (QSslCertificate::fromFile → ASN1_item_free / EVP_PKEY_free / EVP_MD_free).

The bar disappeared briefly. Quickshell refused to auto-restart ("crashed within 10 seconds of launching"), then a wrapper started a new instance and the shell recovered. No user documents were lost.

Expected: after a plugin-triggered restart, the shell stays up and loads remote MPRIS art without crashing.

Steps to reproduce (as observed)

Not a tight one-liner; this is what the journal and mtimes show on this machine:

  1. Spotify/librespot playing (org.mpris.MediaPlayer2.OmarchySpotify), with mpris:artUrl of the form https://i.scdn.co/image/....
  2. Save/reload a local Omarchy plugin (here: timon.perf-alarm). Journal: Local plugin changed, reloading: timon.perf-alarm.
  3. Running shell exits (Exiting due to IPC request).
  4. New omarchy-shell starts, binds MPRIS, pixmap thread fetches the art URL over HTTPS.
  5. SIGSEGV in libcrypto.so.3 EVP_MD_free during SSL configuration of that request.

On this run: plugin reload 12:11:32 CEST → new shell PID 79694 at 12:11:42 → crash PID 80157 at 12:11:43.

This is a one-off in coredumpctl list for quickshell. Not OOM (free ~3.1Gi available, no oom-killer journal entries).

Stack (symbolized where the packages allow)

From Quickshell's own report (~/.cache/quickshell/crashes/qhp1izq9kt/report.txt) and coredumpctl info 80157. si_code is SI_TKILL because Quickshell's crash handler re-raises.

#4  EVP_MD_free                     libcrypto.so.3
...
#13 ASN1_item_free                  libcrypto.so.3
#14 (anonymous)                     libqopensslbackend.so
#15 QSslCertificate::fromData
#16 QSslCertificate::fromFile
#17–#19                             libqopensslbackend.so / libQt6Network
#20 QNetworkRequest::sslConfiguration
#21 QNetworkAccessManager::createRequest
#22 QsInterceptNetworkAccessManager::createRequest
      quickshell/src/core/qsintercept.cpp:126
#23 QNetworkAccessManager::get
#24–#25                             libQt6Quick.so.6  (QQuickPixmapReader)

Command line: quickshell -n -p /usr/share/omarchy/shell

MPRIS metadata in flight at the crash:

mpris:artUrl = https://i.scdn.co/image/ab67616d0000b2735e49a9d63bca0e1c51b4ff60

The fault is in certificate parsing, not image decode. The URL identifies the request, not a bad JPEG.

Related issues (not duplicates)

  • #7362 — heap corruption after local-plugin hot reload (QV4::Chunk::sweep / jemalloc). Same class of trigger (plugin save → reload), different crash site. This dump is a new process that died on first HTTPS pixmap fetch, not a QML GC walk.
  • Other open Quickshell SIGSEGVs (mapToScene #6805, Repeater/PipeWire #6952, menu search #7098) do not match this OpenSSL/QSslCertificate stack.

I searched for EVP_MD_free, QSslCertificate, QQuickPixmap on this repo; no match.

What is proved vs inferred

Proved: crash in OpenSSL while Qt's TLS plugin loaded a cert file for an HTTPS pixmap GET immediately after a plugin-driven shell restart.

Inferred, not proved: thread-unsafe first-use of the OpenSSL backend from QQuickPixmapReader, or a double-free/use-after-free in CA-store teardown. I am not pinning this on the local plugin's QML; that plugin only caused the restart.

System

  • Omarchy 4.0.0-1, channel stable, last full package upgrade 2026-08-21
  • quickshell-git 0.3.0.r20.g28771c7-2 (Quickshell 0.3.0, rev 28771c7c74b42e20afca0b1b63980cb46515537c)
  • Qt 6.11.2, OpenSSL 3.6.3-1
  • GPU: amdgpu, PCI 1002:15dd
  • omarchy debug --no-sudo --print is not a valid command on this install (Unknown Omarchy command)

Diagnostics: coredumpctl info 80157; Quickshell report ~/.cache/quickshell/crashes/qhp1izq9kt/report.txt.

Filed by Grok 4.6 via Grok Build TUI.

roehrbacher avatar Aug 24 '26 10:08 roehrbacher

Another occurrence of this OpenSSL/CA-loading crash, at a different crash site within libcrypto (decode path rather than teardown path), on stable quickshell 0.3.1-1 rather than the -git build.

Same class of trigger: local-plugin save -> shell reload -> fresh quickshell instance -> first HTTPS pixmap fetch -> SIGSEGV in OpenSSL while Qt loads the CA bundle.

What crashed: quickshell PID 95597 (quickshell -n -p /usr/share/omarchy/shell), Sat 2026-09-05 11:37:59 CET, one-off in coredumpctl list. No OOM (23 Gi RAM, ~10 Gi free). Replacement instance (PID 95865) started a second later and the shell recovered; no user data lost.

Crashing thread: Qt's QQuickPixmapRea async image loader issuing an HTTPS GET via quickshell's intercepting manager. Symbolized where packages allow (si_code is SI_TKILL because quickshell's crash handler re-raises):

#5-7   libcrypto.so.3 (unsymbolized)                       <-- decode path
#8    EVP_KEYMGMT_do_all_provided        libcrypto.so.3
#9    OSSL_DECODER_CTX_new_for_pkey      libcrypto.so.3
#10   libcrypto.so.3
#15   ASN1_item_d2i_ex                   libcrypto.so.3
#16   (anon)                             libqopensslbackend.so
#18   QSslCertificate::fromData          libQt6Network.so.6
#19   QSslCertificate::fromFile          libQt6Network.so.6
#22   QSslSocketPrivate::ensureInitialized
#24   QSslConfigurationPrivate::defaultConfiguration
#25   QSslConfiguration::defaultConfiguration
#26   QNetworkRequest::sslConfiguration
#27   QNetworkReplyHttpImpl::QNetworkReplyHttpImpl
#28   QNetworkAccessManager::createRequest
#29   QsInterceptNetworkAccessManager::createRequest  quickshell/src/core/qsintercept.cpp:126
#31   QQuickPixmapReader::processJob     libQt6Quick.so.6

Difference from the original report: #8026 crashed in the teardown/free path (EVP_MD_free / ASN1_item_free); this one crashed in the decode path (ASN1_item_d2i_ex -> OSSL_DECODER_CTX_new_for_pkey -> EVP_KEYMGMT_do_all_provided). Same frozen-loading-of-CA-store operation, same pixmap-thread first-use, different failure site — consistent with the thread-safety/initialization-race hypothesis rather than a single corrupted certificate.

System: Omarchy 4.0.2 (stable Arch), quickshell 0.3.1-1, Qt 6.11.2, OpenSSL 3.6.3-1, Intel i915 + NVIDIA hybrid GPU.

Quickshell's own report is at ~/.cache/quickshell/crashes/r812a70wkt/report.txt.

Filed by big-pickle via opencode.

azzenabidi avatar Sep 05 '26 10:09 azzenabidi

Additional reproduction/evidence from an Omarchy 4.0.2 VM:

  • Timestamp: 2026-09-07 17:47:02 EEST (coredump recorded at 17:47:05).
  • Omarchy: 4.0.2-1
  • Quickshell: 0.3.1-1
  • Qt: qt6-base 6.11.2-2; qt6-declarative/wayland/svg/imageformats 6.11.2-1
  • OpenSSL: 3.6.3-1
  • Hyprland: 0.56.2
  • Kernel: 7.1.9-arch1-2 x86_64
  • Guest GPU: QEMU bochs-drm virtual display; no NVIDIA GPU/driver is present in this VM.

The coredump is for quickshell -n -p /usr/share/omarchy/shell, crashing in the QQuickPixmapReader thread. The repeated native frames are in libcrypto.so.3, including BIO_read_ex; the shell's crash handler then re-raised SIGSEGV. There was no OOM or swap pressure.

Immediately before the crash, the shell log showed Spotify MPRIS registration, then metadata containing an HTTPS mpris:artUrl, followed by album/artist/title and PlaybackStatus: Playing. The exact Spotify URL is intentionally omitted.

The shell exited and relaunched automatically. The journal sequence was:

17:46:59 omarchy-shell exited with status 137; relaunching
17:47:00 new shell startup
17:47:02 Quickshell SIGSEGV
17:47:05 systemd-coredump recorded the crash
17:47:05 shell exited status 139; relaunching
17:47:06 shell restarted

WebbuildCRM avatar Sep 07 '26 16:09 WebbuildCRM

What the stacks show. All three crashes are in the shell's image-loading thread, inside OpenSSL, while Qt reads the system CA bundle for an HTTPS request. That request is the Spotify album art: the media widget (shell/plugins/services/media/BarWidget.qml:134) gives the player's mpris:artUrl straight to an asynchronous Image, so a remote cover is downloaded inside the shell process. That is the only HTTPS the shell does in-process today; the weather and Elsewhen panels fetch through curl. Each report fails at a different point in libcrypto (freeing a key, decoding one, reading the bundle), which points at memory corruption or a thread-safety race in Qt's TLS backend or OpenSSL rather than at anything in Omarchy's QML. That cause is suspected, not proven. Three machines (AMD, Intel with NVIDIA, a QEMU VM) rule out hardware.

Reproduction. Not reproduced. On a disposable Omarchy worker with quickshell 0.3.2-5, Qt 6.12.0 and OpenSSL 3.6.5, I started 80 fresh quickshell processes. Each one loaded 16 HTTPS images on the image thread at once as its first TLS use, and none crashed or left a core dump. That stack is newer than the reports' (Qt 6.11.2, OpenSSL 3.6.3), so this does not show the bug is gone; it only shows it is rare, consistent with each of you seeing it once.

Duplicates. None in this repository. #7362 shares the plugin-reload trigger but crashes somewhere else, as the report says.

Second opinion. Reviewed by Claude Opus 5.5 and, separately, by Codex Medium. Codex agreed it is a real native crash with no Omarchy-side mechanism it could establish, and found that the weather panels use curl rather than in-process requests. That makes album art the shell's only in-process TLS.

What happens next. No fix is filed. The bug is not proven in Omarchy's code, and the one thing Omarchy could do, fetching remote cover art out of process into a cache the way the weather panel does, is a design change for the maintainer to decide on. If you hit it again on Qt 6.12 or later, the coredumpctl info output with package versions would show whether it survived the upgrade.

omarchybot avatar Oct 18 '26 01:10 omarchybot

Confirmed still reproducing on Qt 6.12.0 and OpenSSL 3.6.5.

Environment

  • Omarchy version: 4.0.0.r7210.g087f73d-1 (channel: edge)
  • Quickshell: 0.3.2.r7.g2b4501a-1
  • Qt Base / Declarative: qt6-base 6.12.0-3, qt6-declarative 6.12.0-2
  • OpenSSL: 3.6.5-1
  • Kernel: 7.2.8-10-omarchy

Crash Context & Disassembly

The crash reproduced ~2 seconds after a shell restart triggered by package updates while Spotify was running:

  • Crashing thread: QQuickPixmapRea
  • Signal: SIGSEGV (code SI_TKILL re-raised by Quickshell handler)
  • Faulting instruction: mov 0x4(%r12), %eax at offset +0x13aefe in /usr/lib/libcrypto.so.3 (%r12 is 0x0 / NULL, attempting to read keymgmt->name_id).

Backtrace excerpt

#0  0x00007f0e0133aefe in collect_keymgmt () from /usr/lib/libcrypto.so.3
#1  0x00007f0e013eca5d in filter_on_operation_id () from /usr/lib/libcrypto.so.3
#2  0x00007f0e013672d2 in ossl_method_store_do_all () from /usr/lib/libcrypto.so.3
#3  0x00007f0e013730f2 in EVP_KEYMGMT_do_all_provided () from /usr/lib/libcrypto.so.3
#4  0x00007f0e0133b9a6 in OSSL_DECODER_CTX_new_for_pkey () from /usr/lib/libcrypto.so.3
#5  0x00007f0e0126d3be in ASN1_item_d2i_ex () from /usr/lib/libcrypto.so.3
#6  0x00007f0ddb30568c in d2i_X509 () from /usr/lib/qt6/plugins/tls/libqopensslbackend.so
#7  0x00007f0e032d5474 in QSslCertificate::fromData () from /usr/lib/libQt6Network.so.6
#8  0x00007f0e032d5c3f in QSslCertificate::fromFile () from /usr/lib/libQt6Network.so.6
#9  0x00007f0e03295c7f in QNetworkRequest::sslConfiguration () from /usr/lib/libQt6Network.so.6
#10 0x00007f0e032714de in QNetworkAccessManager::createRequest () from /usr/lib/libQt6Network.so.6
#11 0x000055ea48748871 in QsInterceptNetworkAccessManager::createRequest () from /usr/bin/quickshell
#12 0x00007f0e032686c1 in QNetworkAccessManager::get () from /usr/lib/libQt6Network.so.6
#13 0x00007f0e047d3c6e in QQuickPixmapReader::... () from /usr/lib/libQt6Quick.so.6

This confirms the bug survives the Qt 6.12 upgrade. Standalone single-threaded parsing of /etc/ca-certificates/extracted/tls-ca-bundle.pem succeeds, indicating this remains a multi-threaded method store resolution race when OpenSSL TLS is initialized lazily from QQuickPixmapReader.

Added by Gemini 3.8 Flash (High) via Antigravity CLI.

cribeyz avatar Oct 22 '26 04:10 cribeyz

Reproduced. On a disposable Omarchy worker at quattro (quickshell 0.3.2.r7.g2b4501a-1, qt6-base 6.12.0-3, OpenSSL 3.6.5-1), with the media widget added to the bar and a stand-in MPRIS player serving an HTTPS artUrl, 2 of 150 fresh shell starts crashed. Both died on the image-loading thread in EVP_KEYMGMT_do_all_provided under OSSL_DECODER_CTX_new_for_pkey, the same frames as @cribeyz's report, so this survives the Qt 6.12 and OpenSSL 3.6.5 upgrade. The media widget is not in the default bar, which is why it only reaches people who added it.

Cause. It is an OpenSSL bug that Qt triggers. Qt 6.12's QCryptographicHash loads and then unloads OpenSSL's default provider around every hash (qcryptographichash.cpp:553-582 and :253), and the shell computes a burst of hashes while QML compiles at startup and on every plugin reload. When that provider's activation count reaches zero, OpenSSL removes its methods from the store (provider_core.c:1358-1425), while the image thread is walking the same store to decode the CA bundle for the album-art request; ossl_method_store_do_all() traverses those methods after dropping its lock, so it walks freed memory. That accounts for the crash site moving between reports (EVP_MD_free, the decoder, BIO_read_ex): the thread that dies is always the one reading certificates, and where it is when the methods disappear is chance.

Upstream. This is openssl/openssl#33002, reported against Quickshell on Arch, and fixed by openssl/openssl#33056, which OpenSSL merged to master and the 4.1 branch on 2026-10-05. It is not in the 3.6 series Arch ships, so no package update fixes it yet.

What Omarchy could do meanwhile. Starting the shell with an OPENSSL_CONF that includes the system config and activates default from the configuration keeps that provider permanently active, so Qt's unloads never take it to zero. In an isolated test against OpenSSL 3.6.5 it left exactly one active default provider after Qt's load and unload sequence. It has not been shown to stop the crash: at 2 crashes in 150 starts, telling a fix from luck takes several hundred more. No pull request is filed, because changing the shell's OpenSSL configuration to work around an upstream bug is a choice for the maintainer rather than a defect fix.

Checked by Claude Opus 5.5, with a second opinion from Codex Medium and from muse-spark-1.3 (via pi, thinking high). Both agreed the mechanism holds in the Qt and OpenSSL source. Codex found the upstream issue and fix, and showed that the OPENSSL_CONF pin keeps one provider active; muse-spark showed that Qt's own fetch can create a second, duplicate default provider, which is how one copy keeps cycling to zero while another stays up. Neither could establish that the pin removes all four reported crashes.

Next: waiting on the maintainer to decide between shipping the OPENSSL_CONF workaround and waiting for the OpenSSL fix to reach Arch.

omarchybot avatar Oct 22 '26 05:10 omarchybot