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 596107 - segfault after warning gtktextbtree.c:4017: byte index off the end of the line
segfault after warning gtktextbtree.c:4017: byte index off the end of the line
Status: RESOLVED DUPLICATE of bug 675278
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.16.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 651070 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-09-23 19:00 UTC by Olivier Sessink
Modified: 2012-05-02 07:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Olivier Sessink 2009-09-23 19:00:06 UTC
I might have found a race condition. In bluefish-1.3.* there is a tooltip query callback. To find out which text the mouse is over it calls:
gtk_text_view_get_iter_at_position(GTK_TEXT_VIEW(btv), &iter, NULL, bx, by);
This never gave any problems.

Today I implemented a 'Collapse all' feature for the code-block-folding. The 'Collapse all' is is a popup menu that pops up opon a right-click on the document left margin. Code block folding in Bluefish simply adds a GtkTextStyle with the 'hidden' property to the text within the block.

So immediately after the 'Collapse all' is chosen, we have gtk_text_view_get_iter_at_position running to find the visible text position the mouse is over, and we have lots of places where a textstyle with the 'hidden' property is applied to make text invisible. This is why I think this might be a race condition problem. 

Below is the warning and the gdb backtrace:

(bluefish-unstable:3866): Gtk-WARNING **: /build/buildd/gtk+2.0-2.16.1/gtk/gtktextbtree.c:4017: byte index off the end of the line
Gtk-ERROR **: Byte index 533 is off the end of the line aborting...

  • #0 __kernel_vsyscall
  • #1 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #2 abort
    from /lib/tls/i686/cmov/libc.so.6
  • #3 IA__g_logv
    at /build/buildd/glib2.0-2.20.1/glib/gmessages.c line 506
  • #4 IA__g_log
    at /build/buildd/glib2.0-2.20.1/glib/gmessages.c line 526
  • #5 iter_set_from_byte_offset
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtktextiter.c line 110
  • #6 IA__gtk_text_iter_set_visible_line_index
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtktextiter.c line 3906
  • #7 line_display_index_to_iter
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtktextlayout.c line 2549
  • #8 IA__gtk_text_layout_get_iter_at_position
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtktextlayout.c line 2670
  • #9 bluefish_text_view_query_tooltip
    at bftextview2.c line 1187

Comment 1 Fabio Durán Verdugo 2011-05-26 01:14:11 UTC
*** Bug 651070 has been marked as a duplicate of this bug. ***
Comment 2 Olivier Sessink 2012-05-02 07:18:49 UTC

*** This bug has been marked as a duplicate of bug 675278 ***