After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782701 - Editing fail in silent crash for assertion: gtk_text_view_get_iter_location: assertion 'gtk_text_iter_get_buffer (iter) == get_buffer (text_view)'
Editing fail in silent crash for assertion: gtk_text_view_get_iter_location: ...
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
3.25.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-05-16 16:23 UTC by Gaamda Lurt
Modified: 2017-05-17 06:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
source edited (709 bytes, text/x-csrc)
2017-05-16 16:23 UTC, Gaamda Lurt
  Details
clang: try harder to keep iter valid (1.29 KB, patch)
2017-05-17 00:35 UTC, Christian Hergert
committed Details | Review
sourceview: ensure we have valid textmarks for animations (2.77 KB, patch)
2017-05-17 00:44 UTC, Christian Hergert
committed Details | Review

Description Gaamda Lurt 2017-05-16 16:23:08 UTC
Created attachment 351983 [details]
source edited

Try to edit the source in attachment, a simple C++ source. Activated CLang completions. Trying to sobstitute the for limits (4000000000) with defined HOWMUCH, editing the constant in the first for is ok, in the second triggered the assertion:

Warning: python3-lxml is not installed, no documentation will be available in Python auto-completion
jedi not found, python auto-completion not possible.
18:06:48.0365                        ide-source-snippet[ 21822]: CRITICAL: ide_source_snippet_begin: assertion '!self->buffer' failed
18:06:48.0365                                       Gtk[ 21822]: CRITICAL: gtk_text_buffer_get_iter_at_mark: assertion 'GTK_IS_TEXT_MARK (mark)' failed
18:06:48.0365                                       Gtk[ 21822]: CRITICAL: gtk_text_buffer_get_iter_at_mark: assertion 'GTK_IS_TEXT_MARK (mark)' failed

(gnome-builder:21822): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

(gnome-builder:21822): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

(gnome-builder:21822): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators
18:06:48.0379                                       Gtk[ 21822]: CRITICAL: gtk_text_view_get_iter_location: assertion 'gtk_text_iter_get_buffer (iter) == get_buffer (text_view)' failed

(gnome-builder:21822): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

(gnome-builder:21822): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators
18:06:48.0379                                       Gtk[ 21822]: CRITICAL: gtk_text_view_get_iter_location: assertion 'gtk_text_iter_get_buffer (iter) == get_buffer (text_view)' failed

(gnome-builder:21822): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators
Segmentation fault (core dumped)
Comment 1 sébastien lafargue 2017-05-16 17:29:57 UTC
hi, you edit it by using "open file" so outside of a project right ?
I can't reproduce it, sorry.

If you can, try provide a backtrace with debug symbols, thanks.

The first error is a complain about a missing buffer in ide-source-snippet, but snippets are triggered by using TAB.

The missing python3-lxml one does not make sense in this context (a c++ file) but is not the fatal error.
Comment 2 Gaamda Lurt 2017-05-16 18:48:41 UTC
Hi, in fact. It's not a project, it's a folder like:

"cpp"
 |
 |-- "01 - exc01" 
 |       |
 |       |-- "exc01.cpp"
 |      
 |-- "02 - exc02"
 |       |
 |       |-- "exc02.cpp"
 .
 .
 . etc.

This is the dump with debug symbols:

Warning: python3-lxml is not installed, no documentation will be available in Python auto-completion
jedi not found, python auto-completion not possible.
20:41:15.0896                        ide-source-snippet[ 5125]: CRITICAL: ide_source_snippet_begin: assertion '!self->buffer' failed
20:41:15.0896                                       Gtk[ 5125]: CRITICAL: gtk_text_buffer_get_iter_at_mark: assertion 'GTK_IS_TEXT_MARK (mark)' failed
20:41:15.0896                                       Gtk[ 5125]: CRITICAL: gtk_text_buffer_get_iter_at_mark: assertion 'GTK_IS_TEXT_MARK (mark)' failed

(gnome-builder:5125): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

(gnome-builder:5125): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

(gnome-builder:5125): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators
20:41:15.0905                                       Gtk[ 5125]: CRITICAL: gtk_text_view_get_iter_location: assertion 'gtk_text_iter_get_buffer (iter) == get_buffer (text_view)' failed

(gnome-builder:5125): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

(gnome-builder:5125): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators
20:41:15.0905                                       Gtk[ 5125]: CRITICAL: gtk_text_view_get_iter_location: assertion 'gtk_text_iter_get_buffer (iter) == get_buffer (text_view)' failed

(gnome-builder:5125): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators
Segmentation fault (core dumped)

Hope it helps, builder is a great ide, so fast, so adwaita! :D
Comment 3 Gaamda Lurt 2017-05-16 18:49:57 UTC
If it is not helpful, tell me how to bring you the dump you need, I will try :)
Comment 4 sébastien lafargue 2017-05-16 20:47:49 UTC
Yep we need a backtrace (bt under gdb) and even with that, no guarantee results.

So, it depend how do you run gnome-builder:

- under jhbuild: in a jhbuild shell do:

  G_DEBUG=fatal-warnings make run

-under flatpak:
 general guide:
   https://github.com/flatpak/flatpak/wiki/Tips-&-Tricks
   https://blogs.gnome.org/mclasen/2017/01/20/debugging-a-flatpak-application/

so after having install the sdk:

  flatpak run -d --command=sh org.gnome.Builder
  G_DEBUG=fatal-warnings gdb /app/bin/gnome-builder
  r -vvvv

  from here you run gnome-builder under gdb and stop after each errors, c to continue if it's not your error (there can be some gtk at start), bt to show the backtrace

terminal output (debug and trace statements can be useful too)

- under your distro installed gnome-builder:
  G_DEBUG=fatal-warnings gdb /app/bin/gnome-builder
  r -vvvv

For more realtime help, come see us on irc gimpnet #gnome-builder
Comment 5 Gaamda Lurt 2017-05-16 22:43:53 UTC
So much output, pasted it: https://pastebin.com/JKTFHuLb

This is with "gdb gnome-builder" :)
Comment 6 Christian Hergert 2017-05-17 00:15:31 UTC
Excellent, thanks for going through the extra effort to help us out. I know how frustrating that can be sometimes.

It looks like we have a snippet that hasn't been anchored while using the clang autocompletion plugin.
Comment 7 Christian Hergert 2017-05-17 00:35:28 UTC
Created attachment 351996 [details] [review]
clang: try harder to keep iter valid

When performing our operation to activate the clang completion item, we
want to ensure the iter passed to us stays valid. We also want to pass
the iter location into push_snippet just to ensure we get the same
location.
Comment 8 Christian Hergert 2017-05-17 00:44:50 UTC
Created attachment 351997 [details] [review]
sourceview: ensure we have valid textmarks for animations

This checks that the marks we got from the source snippet are valid.
Otherwise the textiters could be left in an invalid state.

This also checks to ensure that animations are enabled before calling the
animation helper.
Comment 9 Christian Hergert 2017-05-17 00:47:24 UTC
It looks like there might be a bit of a race when cleaning up the textmarks
from the snippet. They should be set after insertion, and we were expecting
that. It cascaded into the iters being in an undefined state.

I'll merge this to 3.24 as well.

Attachment 351996 [details] pushed as f125e4b - clang: try harder to keep iter valid
Attachment 351997 [details] pushed as 854174d - sourceview: ensure we have valid textmarks for animations
Comment 10 Gaamda Lurt 2017-05-17 06:19:49 UTC
np, thank you for builder guys :D