https://bugs.kde.org/show_bug.cgi?id=523233

            Bug ID: 523233
           Summary: Kate crashes on startup with any opened document
                    (regardless of file type) due to a failed assertion in
                    the syntax highlighting engine, immediately preceded
                    by a warning that the "QuickAnnotatingTools" XML
                    definition could not be opened.
    Classification: Applications
           Product: kate
      Version First unspecified
       Reported In:
          Platform: Neon
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: application
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

## Summary
Kate crashes on startup with any opened document (regardless of file type) due
to a failed assertion in the syntax highlighting engine, immediately preceded
by a warning that the "QuickAnnotatingTools" XML definition could not be
opened.

## Steps to Reproduce
1. Open Kate with any file, e.g. `kate somefile.md`
2. Kate crashes within 1-2 seconds.

This is fully reproducible and not tied to a specific file or syntax: it has
happened on `.md`, `.sh`, `.yaml`, `.gitignore`, and `.kdenlive` (XML) files,
and even with no file argument at all (`kate -b`).

## Observed Result
Kate aborts almost immediately after startup. The relevant log output is:

```
Unable to open QuickAnnotatingTools XML definition
ASSERT: "it != m_formatsIdToIndex.end()" in file
/workspace/build/src/syntax/katehighlight.cpp, line 181
KCrash: Application 'kate' crashing... crashRecursionCounter = 2
```

## Expected Result
Kate opens the file normally without crashing.

## Backtrace (main thread, from `coredumpctl`)
```
#13 KateBuffer::computeFoldings(int) (libKF6TextEditor.so.6)
#21-30 libkateprivate.so.26.04.3 (various internal frames)
#44 kate + 0x1c8b5
#47 kate + 0x9f45
```

## Analysis
The "QuickAnnotatingTools XML definition" resource does not exist anywhere on
the filesystem after installing (and reinstalling) `kate6-data` and
`kf6-ktexteditor`:

```
$ find / -iname "*quickannotatingtools*"
(no results)
$ dpkg -L kf6-ktexteditor | grep -i quick
(no results)
```

Since this XML definition fails to load, `m_formatsIdToIndex` appears to be
left in an inconsistent state, and the very next call to
`KateBuffer::computeFoldings()` (triggered by opening any document) hits the
assertion `it != m_formatsIdToIndex.end()` and aborts.

I confirmed this is not a local/corrupted install: `sudo apt install
--reinstall kate6-data kf6-ktexteditor` reinstalled cleanly from the official
repository, and the crash persists identically, with the resource file still
missing afterward.

This looks like a packaging issue (a resource file referenced by the
"QuickAnnotatingTools" feature is missing from the shipped package) rather than
a logic bug per se, but the missing-resource case should probably not lead to a
hard assertion failure/crash either way.

## Environment
- Kate: 4:26.04.3-0zneon+24.04+noble+release+build35
- kate6-data: 4:26.04.3-0zneon+24.04+noble+release+build35
- KTextEditor (kf6-ktexteditor): 6.28.0-0zneon+24.04+noble+release+build63
- KDE Frameworks: 6.28.0
- Qt: 6.11.1
- OS: KDE neon User Edition (Ubuntu 24.04 noble base)
- Distribution channel: archive.neon.kde.org/user (stable/release branch, not
Unstable)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to