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 675278 - segfault in gtk_text_iter_set_visible_line_index()
segfault in gtk_text_iter_set_visible_line_index()
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
3.2.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 596107 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-05-02 07:16 UTC by Olivier Sessink
Modified: 2018-04-15 00:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Olivier Sessink 2012-05-02 07:16:35 UTC
I have found a reproducible segfault, from gtk-2.20 (probably also before, but I haven't tested that) until gtk 3.2.4 (and possibly later but I've also not tested that).

I have a GtkTextView with "has-tooltip" enabled. From a popup menu I select to collapse a text block in Bluefish. The callback from that menu item applies a GtkTextTag to the GtkTextBuffer that has "invisible" set. When the popup menu dissapears, immediately the tooltip query callback is fired. In this callback I call gtk_text_view_get_iter_at_position() #6 in the backtrace with the result as shown below.

I guess this is some kind of race condition: the query tooltip callback calls for an iter location that has a texttag with invisible applied, but is not yet truly invisible.

The workaround in bluefish is to disable the "has-tooltip" option just before applying the GtkTextTag, and enabling it again in an idle callback with lowest priority.

The backtrace:

(bluefish:9010): Gtk-WARNING **: gtktextbtree.c:4019: byte index off the end of the line

Gtk-ERROR **: Byte index 590 is off the end of the line

Program received signal SIGTRAP, Trace/breakpoint trap.
g_logv (log_domain=0x7ffff7c6dcbb "Gtk", log_level=<optimized out>, format=
    0x7ffff7d21020 "Byte index %d is off the end of the line", args1=0x7fffffffd468)
    at gmessages.c:577
577		  g_private_set (g_log_depth, GUINT_TO_POINTER (depth));
(gdb) bt
  • #0 g_logv
    at gmessages.c line 577
  • #1 g_log
    at gmessages.c line 591
  • #2 ??
    from /usr/lib64/libgtk-3.so.0
  • #3 gtk_text_iter_set_visible_line_index
    from /usr/lib64/libgtk-3.so.0
  • #4 ??
    from /usr/lib64/libgtk-3.so.0
  • #5 gtk_text_layout_get_iter_at_position
    from /usr/lib64/libgtk-3.so.0
  • #6 bluefish_text_view_query_tooltip
    at bftextview2.c line 2416
  • #7 ??
    from /usr/lib64/libgtk-3.so.0
  • #8 g_closure_invoke
    at gclosure.c line 774
  • #9 signal_emit_unlocked_R
    at gsignal.c line 3310
  • #10 g_signal_emit_valist
    at gsignal.c line 3013
  • #11 g_signal_emit_by_name
    at gsignal.c line 3097
  • #12 ??
    from /usr/lib64/libgtk-3.so.0
  • #13 ??
    from /usr/lib64/libgtk-3.so.0
  • #14 gtk_main_do_event
    from /usr/lib64/libgtk-3.so.0
  • #15 ??
    from /usr/lib64/libgdk-3.so.0
  • #16 g_main_dispatch
    at gmain.c line 2441
  • #17 g_main_context_dispatch
    at gmain.c line 3011
  • #18 g_main_context_iterate
    at gmain.c line 3089
  • #19 g_main_loop_run
    at gmain.c line 3297
  • #20 gtk_main
    from /usr/lib64/libgtk-3.so.0
  • #21 main
    at bluefish.c line 402

Comment 1 Olivier Sessink 2012-05-02 07:18:49 UTC
*** Bug 596107 has been marked as a duplicate of this bug. ***
Comment 2 Timothy Arceri 2013-10-01 21:58:01 UTC
Can you still reproduce this issue in a later version of GTK? Are you able to provide some example code to trigger the segfault?
Comment 3 Matthias Clasen 2018-02-10 05:20:15 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 4 Matthias Clasen 2018-04-15 00:21:09 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new