NavMarkGutterRenderer: fix crash when deleting edit marks#1725
Merged
Conversation
…#1681) Deleting an edit mark emitted the mark-deleted signal from the GtkTextBuffer. However, the signal handler in SourceView.vala called emove_mark(), which attempted to delete the mark from the buffer a second time. This double-delete caused invalid memory access and an occasional segmentation fault. This commit removes the redundant delete_mark call from emove_mark().
jeremypw
approved these changes
May 28, 2026
Collaborator
jeremypw
left a comment
There was a problem hiding this comment.
Nice fix! Good work spotting the cause of this bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1681
When
remove_mark()was called, it explicitly calledbuffer.delete_mark()on the mark. However, themark-deletedsignal is emitted by GTK after the mark is already deleted from
the buffer — meaning
remove_mark()was attempting to delete analready-invalid mark, causing a segfault.
Removed the redundant
buffer.delete_mark()call fromremove_mark()inNavMarkGutterRenderer.vala.Tested locally using GDB — reproduced the crash and confirmed
the fix prevents it. The backtrace shows
gtk_text_buffer_delete_markappearing twice in the call stack, confirming the double-delete.