Bug 498885 - Klevernotes crashes with empty code block section
Summary: Klevernotes crashes with empty code block section
Status: RESOLVED FIXED
Alias: None
Product: KleverNotes
Classification: Applications
Component: Markdown parser (show other bugs)
Version: 1.1.0
Platform: Other Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: Louis Schul
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-19 15:16 UTC by Félim Whiteley
Modified: 2025-01-20 09:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Félim Whiteley 2025-01-19 15:16:51 UTC
SUMMARY
Application crashes if you create a backtick code area but don't yet paste in or type what you want. As soon as you insert the first of the three backticks for the closing excape it crashes with

klevernotes: ./src/logic/parser/md4qt/poscache.h:139: void MD::PosCache<Trait>::insertInCache(const MD::details::PosRange<Trait>&, bool) [with Trait = MD::QStringTrait]: Assertion `item.isValidPos()' failed.
Aborted (core dumped)

STEPS TO REPRODUCE
1.  Create a new Note
2.  add 3 backticks, poress enter twice to leave a blank line
3.  On the second blank line start your closing backticks. App will crash out losing the note changes.

OBSERVED RESULT
Crash

EXPECTED RESULT
Leave a empty code area where afterwards you can paste in the code block you wanted.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.8.0-51-generic (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: AMD Radeon RX 580 Series

ADDITIONAL INFORMATION
Package: klevernotes
Version: 1.1.0-0zneon+24.04+noble+release+build4
Comment 1 Louis Schul 2025-01-20 09:02:17 UTC
Thanks for this report.
I can confirm this bug in `V1.1`. However, this seems to be fixed on master and will come with the next release.