I spend quite some time (assisted with AI) to research this bug. Hope this info can contribute to keep improving this project.
Summary to
middlewared crashes intermittently with a segmentation fault (SIGSEGV), most often while I am actively using the web UI. The service is automatically restarted by systemd, but this causes repeated forced logouts and ~15-20 second delays before the UI becomes usable again. This has been occurring since a fresh install and persists after updating BIOS and confirming RAM integrity, so hardware causes have largely been ruled out (see below).
Both captured coredumps crash in the exact same code path: Python’s _Py_dg_dtoa (double-to-string conversion) called from the _json module, apparently while serializing floating-point statistics (likely CPU/sensor/reporting data) for the UI over the websocket API.
Environment
- TrueNAS version: 25.10.5 (Goldeye) — fresh install, not upgraded from an earlier branch
- Motherboard: ASRock H610M-HDV/M.2 R2.0
- BIOS: Updated from v8.02 to v11.01 (latest available) during troubleshooting — issue persisted after update, in the same boot session
- CPU: Intel Core i5-13500 (6P+8E cores, 20 threads)
- RAM: 2x 8GB Kingston FURY Beast DDR4 (KF3200C16D4/8GX), running at 2400 MT/s (rated 3200 MT/s), non-ECC — tested with PassMark Memtest86, 2+ hours, 0 errors on both modules
- Boot/OS drive: Patriot M.2 P310 240GB NVMe — SMART status clean (Critical Warning: 0x00, Available Spare: 100%, Percentage Used: 0%, Media and Data Integrity Errors: 0, no kernel I/O errors logged)
- Storage pool drives: 3x Western Digital Red (2x mirror + 1x single), all connected directly to motherboard SATA ports (no HBA/expansion card)
- PSU: be quiet! Pure Power 10M 550W
- Apps running: Immich (immich-server, postgres/pgvecto, machine-learning, redis containers), immich_power_tools
What’s been ruled out
- RAM (Memtest86, clean, 2+ hour run)
- BIOS/microcode outdated (updated to latest, issue persists)
- NVMe drive failure (SMART clean, no kernel-level I/O errors)
- ZFS dedup (confirmed
offon all datasets — ruling out the knownddt_prefetch_pools()crash pattern) - SATA expansion card / PSU rail issues (not applicable — direct motherboard SATA, adequate PSU, only 3 drives on a daisy-chained power cable)
Observed pattern
- Crashes correlate strongly with having the web UI open and active in a browser tab (not confirmed to be exclusively UI-triggered, but the correlation is consistent)
systemctl status middlewaredshows a climbing restart counter (observed up to 7 restarts) with very short uptimes between crashes- NVMe SMART log shows 114 “Unsafe Shutdowns”, consistent with these repeated forced restarts
Crash 1 (before BIOS update)
Signal: 11 (SIGSEGV)
Command: middlewared
Executable: /usr/bin/python3.11
Stack trace of crashing thread:
#0 __memset_avx2_unaligned_erms (libc.so.6 + 0x15344a)
#1 n/a (python3.11 + 0x1e1a97)
#2 n/a (python3.11 + 0x1e20a0)
#3 _Py_dg_dtoa (python3.11 + 0x1e5c7d)
#4 PyOS_double_to_string (python3.11 + 0x1e0531)
#5 n/a (python3.11 + 0x9f55e)
#6 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x4e36)
#7 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x51e2)
#8 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x51e2)
#9 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x57a0)
#10 _PyObject_MakeTpCall (python3.11 + 0x811ad)
#11 _PyEval_EvalFrameDefault (python3.11 + 0x265ab)
...
#16 n/a (_asyncio.cpython-311-x86_64-linux-gnu.so + 0x8c89)
#17 n/a (_asyncio.cpython-311-x86_64-linux-gnu.so + 0x987f)
...
Also logged at time of crash:
resource_tracker: There appear to be 12 leaked semaphore objects to clean up at shutdown
Crash 2 (confirmed AFTER BIOS update to v11.01, same boot session — boot at 22:22:55, crash at 23:10:35)
Signal: 11 (SIGSEGV)
Command: middlewared
Executable: /usr/bin/python3.11
Stack trace of crashing thread:
#0 arena_for_chunk (libc.so.6 + 0x98f45)
#1 n/a (python3.11 + 0xdb96f)
#2 _Py_dg_dtoa (python3.11 + 0x1e55ac)
#3 PyOS_double_to_string (python3.11 + 0x1e0531)
#4 n/a (python3.11 + 0x9f55e)
#5 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x4e36)
#6 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x51e2)
#7 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x51e2)
#8 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x51e2)
#9 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x51e2)
#10 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x51e2)
#11 n/a (_json.cpython-311-x86_64-linux-gnu.so + 0x57a0)
#12 _PyObject_MakeTpCall (python3.11 + 0x811ad)
#13 _PyEval_EvalFrameDefault (python3.11 + 0x265ab)
... (recursive PyObject_Call / _PyEval_EvalFrameDefault chain, consistent with
nested JSON serialization of a large/deeply-nested dict) ...
Also logged at time of crash:
resource_tracker: There appear to be 12 leaked semaphore objects to clean up at shutdown
Hypothesis
Both crashes occur inside CPython’s _Py_dg_dtoa (David Gay’s double-to-ASCII algorithm), invoked from _json while encoding floating-point values — most likely system/hardware statistics (CPU load, temperatures, fan speeds, etc.) being pushed to the UI. The two crashes differ in exact fault location (memset vs. glibc malloc arena internals) but hit the identical function chain, suggesting heap corruption that surfaces at slightly different points depending on allocator state, rather than two unrelated bugs.
One possible trigger I have not been able to fully verify: this is a consumer desktop motherboard (no BMC/IPMI), and hardware sensors are read via the Super I/O chip through lm-sensors. Consumer boards are known to sometimes report malformed/out-of-range sensor values (unlike server-grade hardware with clean BMC-reported sensor data), which could produce an edge-case float value that _Py_dg_dtoa mishandles. I have not yet captured a sensors output showing an obviously malformed reading at the exact moment of a crash, so this is a hypothesis, not a confirmed root cause.
Request
- Has this crash signature (SIGSEGV in
_Py_dg_dtoavia_jsonserialization) been reported before? - Any guidance on what statistics/data specifically was being serialized at the crash point would help narrow this down further.
- Happy to provide full coredumps (both are still available via
coredumpctl) if useful — omitted here for brevity/size.