[v3.0] Crashes when adding a ID to a heading
Describe the bug
Typing the {
character to add a ID to a heading, when Check Spelling is enabled, crashes Apostrophe with this error:
ERROR:../libspelling/lib/cjhtextregion.c:1112:_cjh_text_region_remove: assertion failed: (length <= region->length - offset)
Bail out! ERROR:../libspelling/lib/cjhtextregion.c:1112:_cjh_text_region_remove: assertion failed: (length <= region->length - offset)
Aborted (core dumped)
This does not happen if Check Spelling is disabled.
To Reproduce
Steps to reproduce the behavior:
- Ensure Check Spelling is enabled in Preferences
- Type a heading like
## hello world
- Type
{
to start adding a ID to the heading, intending to type## hello world {#hello}
- See error and core dump on console; the Apostrophe window becomes unresponsive and can't be closed
Expected behavior
Apostrophe doesn't crash when adding a ID to a heading when Check Spelling is enabled.
Environment:
- Linux distribution: Arch Linux
- Desktop Enviroment: Gnome Shell
- DE version: 46.1
- GTK version: 4.14.3
- libspelling version: 0.2.1
Additional context
I have a stack trace gdb.txt but I think it's not useful because Arch Linux doesn't have Python extensions for gdb. Let me know if/how I can provide more relevant logs.
Edited by Jake Dane