dail8859 / dail8859/NotepadNext

macOS 26.6: SIGSEGV on first keypress after restoring windowState (QDockAreaLayout null separator widget)

Open
#1,131 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
14.6k
Forks
914
Avg merge
6d 18h
Merged PRs (30d)
7

Description

### Operating System and Version

macOS 26.6 (darwin 25.6.0), Apple Silicon (arm64)

### Distribution

Official GitHub DMG: NotepadNext v0.14 (April 2026 release)

### Description

After restoring a session with **Folder as Workspace** and other docks, the app launches, but **the first keypress in the untitled editor causes an immediate SIGSEGV**.

This is **not** the Gatekeeper / quarantine “damaged app” problem. After clearing quarantine (`xattr -dr com.apple.quarantine /Applications/NotepadNext.app`) the binary launches and runs until typing.

Qt logs a null dock separator immediately before the crash:

```
QDockAreaLayout::updateSeparatorWidgets: null separator widget
```

then `MainWindow::updateSaveStatusBasedUi`, then the process dies with `zsh: segmentation fault`.

This looks consistent with [QTBUG-111538](https://bugreports.qt.io/browse/QTBUG-111538) (`QDockAreaLayout::updateSeparatorWidgets` null deref after `restoreState`) in Qt 6.5.x. The GitHub v0.14 macOS build ships **Qt 6.5.3**.

I do not have a local `.ips` / DiagnosticReports file for this crash; it is confirmed by launching from Terminal and getting SIGSEGV. No Mac crash dialog was produced on this machine (`~/Library/Logs/DiagnosticReports` was empty for this event).

I understand the project may not have a Mac for testing, so I tried to make this report self-contained (repro, workaround, Qt bug pointer, and related issues). Happy to run extra debug builds or capture more logs if that would help.

**Related (not duplicates of this exact crash):**

- #915 — open: random `EXC_BAD_ACCESS` / SIGSEGV in Qt layout on macOS 26, originally v0.12 / Intel; not a first-keypress + `windowState` restore repro, and no `updateSeparatorWidgets` log.
- #121 — closed: invalid `windowState` causing **startup** crashes (Windows, floating Editor Inspector).
- #968 — closed: Linux Qt 6.10 segfaults; last log can mention `updateSaveStatusBasedUi`, different OS/Qt.
- #1066 — closed: Linux Mint, app closes on 2nd Folder-as-Workspace file click (not a typing crash).

### Steps to Reproduce

1. Restore a session whose `~/.config/NotepadNext/NotepadNext.ini` `[MainWindow]` section contains a saved `windowState=` (and typically `geometry=`) with **Folder as Workspace** plus other docks visible.
2. Launch `/Applications/NotepadNext.app/Contents/MacOS/NotepadNext` from Terminal (so the SIGSEGV is visible).
3. Click in the untitled editor and type **any** key.
4. Immediate crash.

Expected: the character is inserted and the window stays up.
Actual: process exits with a segmentation fault on the first keypress.

### Debug Information

- **App:** NotepadNext v0.14 (GitHub DMG, Apr 2026)
- **Qt:** 6.5.3
- **Arch:** arm64 native (`NotepadNext.app`)
- **OS:** macOS 26.6 (darwin 25.6.0), Apple Silicon
- **Config:** `~/.config/NotepadNext/NotepadNext.ini`
- **Workspace:** Folder as Workspace (e.g. `RootPath` pointing at a local notes folder). Personal absolute paths omitted; any folder with a restored dock layout should suffice.

### Additional Details

**CLI log excerpt (verbatim):**

```
[ 2.331] W: QDockAreaLayout::updateSeparatorWidgets: null separator widget
[ 2.672] I: void MainWindow::updateSaveStatusBasedUi(ScintillaNext *)
zsh: segmentation fault /Applications/NotepadNext.app/Contents/MacOS/NotepadNext
```

**Workaround:** delete `geometry=` and `windowState=` from the `[MainWindow]` section of `NotepadNext.ini`. Other settings can stay (font, wrap, `FolderAsWorkspace` `RootPath`, etc.). The app then starts and typing works.

**Caveat:** Folder as Workspace layout is needed for daily use. Restoring docks and quitting may **re-save a crashing `windowState`**, so the workaround is not durable without avoiding dock restore or upgrading Qt / patching restore.

**Qt note:** [QTBUG-111538](https://bugreports.qt.io/browse/QTBUG-111538) — `QDockAreaLayout::updateSeparatorWidgets` null dereference after `restoreState` on Qt 6.5.x.

Possible directions (for whoever can test on Mac or bump Qt):

- Upgrade the macOS build past the affected 6.5.x dock-restore bug, and/or
- Guard `restoreState` / separator widgets so a bad or version-skewed `windowState` cannot null-deref on first layout/key event, and/or
- Ignore or reset `windowState` if `updateSeparatorWidgets` reports a null separator.

Thank you for maintaining NotepadNext.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the restored [MainWindow] windowState and geometry in ~/.config/NotepadNext/NotepadNext.ini, then trace the restoreState path around the QDockAreaLayout warning and MainWindow::updateSaveStatusBasedUi. Reproduce by launching the macOS executable from Terminal, restoring Folder as Workspace, and typing in the untitled editor. Done means the restored layout no longer causes SIGSEGV and the first keypress inserts normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, macos
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.