Skip to content

NavMarkGutterRenderer: fix crash when deleting edit marks#1725

Merged
jeremypw merged 1 commit into
elementary:masterfrom
Dipanshusinghh:fix-edit-marks-crash
May 28, 2026
Merged

NavMarkGutterRenderer: fix crash when deleting edit marks#1725
jeremypw merged 1 commit into
elementary:masterfrom
Dipanshusinghh:fix-edit-marks-crash

Conversation

@Dipanshusinghh
Copy link
Copy Markdown
Contributor

@Dipanshusinghh Dipanshusinghh commented May 28, 2026

Fixes #1681

When remove_mark() was called, it explicitly called
buffer.delete_mark() on the mark. However, the mark-deleted
signal is emitted by GTK after the mark is already deleted from
the buffer — meaning remove_mark() was attempting to delete an
already-invalid mark, causing a segfault.

Removed the redundant buffer.delete_mark() call from
remove_mark() in NavMarkGutterRenderer.vala.

Tested locally using GDB — reproduced the crash and confirmed
the fix prevents it. The backtrace shows gtk_text_buffer_delete_mark
appearing twice in the call stack, confirming the double-delete.

…#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().
Copy link
Copy Markdown
Collaborator

@jeremypw jeremypw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! Good work spotting the cause of this bug.

@jeremypw jeremypw merged commit b29c0c2 into elementary:master May 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Occasional crash when using edit marks

2 participants