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 336915 - Crash when backspacing: char offset off the end of the line
Crash when backspacing: char offset off the end of the line
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.14.x
Other other
: High critical
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-02 12:54 UTC by Christopher Backhouse
Modified: 2006-08-16 14:33 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
testcase (108 bytes, text/plain)
2006-04-02 12:56 UTC, Christopher Backhouse
  Details
gtk patch (1.02 KB, patch)
2006-04-03 11:01 UTC, Paolo Borelli
none Details | Review

Description Christopher Backhouse 2006-04-02 12:54:39 UTC
Distribution: Ubuntu 6.06 (dapper)
Package: gedit
Severity: Normal
Version: GNOME2.14.0 2.14.1
Gnome-Distributor: Ubuntu
Synopsis: Crash when backspacing: char offset off the end of the line
Bugzilla-Product: gedit
Bugzilla-Component: general
Bugzilla-Version: 2.14.1
BugBuddy-GnomeVersion: 2.0 (2.14.0)
Description:
Steps to reproduce the crash:
1. Open the attached .cpp
2. Go to the end of the third line. press and hold backspace
3. Crash when we reach the start of the line
4. Doing this from a terminal gives:

sys:1: GtkWarning: gtktextbtree.c:4050: char offset off the end of the
line

Gtk-ERROR **: Char offset 13 is off the end of the line
aborting...


Expected Results:
We delete the final character on this line and the cursor is at the end
of the line above

How often does this happen?
Every time on this file and others like it

Additional Information:
I suspect the syntax highlighting is to blame. possibly because // is
two characters and we are expecting one for comments???


Debugging Information:

Backtrace was generated from '/usr/bin/gedit'

(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1225381664 (LWP 4797)]
(no debugging symbols found)
0xffffe410 in __kernel_vsyscall ()

Thread 1 (Thread -1225381664 (LWP 4797))

  • #0 __kernel_vsyscall
  • #1 __waitpid_nocancel
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #3 <signal handler called>
  • #4 __kernel_vsyscall
  • #5 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #6 abort
    from /lib/tls/i686/cmov/libc.so.6
  • #7 g_logv
    from /usr/lib/libglib-2.0.so.0
  • #8 g_log
    from /usr/lib/libglib-2.0.so.0
  • #9 gtk_text_layout_draw
    from /usr/lib/libgtk-x11-2.0.so.0
  • #10 gtk_text_iter_forward_to_line_end
    from /usr/lib/libgtk-x11-2.0.so.0
  • #11 _gedit_document_is_saving_as
  • #12 _gedit_document_search_region
  • #13 _gtk_marshal_VOID__BOXED_STRING_INT
    from /usr/lib/libgtk-x11-2.0.so.0
  • #14 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #15 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #16 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #17 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #18 _gtk_text_buffer_get_btree
    from /usr/lib/libgtk-x11-2.0.so.0
  • #19 gtk_text_buffer_insert_interactive
    from /usr/lib/libgtk-x11-2.0.so.0
  • #20 gtk_text_buffer_backspace
    from /usr/lib/libgtk-x11-2.0.so.0
  • #21 gtk_text_view_scroll_mark_onscreen
    from /usr/lib/libgtk-x11-2.0.so.0
  • #22 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #23 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #24 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #25 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #26 g_signal_emitv
    from /usr/lib/libgobject-2.0.so.0
  • #27 gtk_bin_get_child
    from /usr/lib/libgtk-x11-2.0.so.0
  • #28 gtk_binding_set_by_class
    from /usr/lib/libgtk-x11-2.0.so.0
  • #29 gtk_binding_set_by_class
    from /usr/lib/libgtk-x11-2.0.so.0
  • #30 gtk_bindings_activate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #31 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #32 gtk_text_view_scroll_mark_onscreen
    from /usr/lib/libgtk-x11-2.0.so.0
  • #33 gtk_source_view_get_marker_pixbuf
    from /usr/lib/libgtksourceview-1.0.so.0
  • #34 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #35 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #36 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #37 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #38 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #39 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #40 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #41 gedit_window_get_type
  • #42 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #43 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #44 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #45 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #46 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #47 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #48 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #49 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #50 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #51 _gdk_events_queue
    from /usr/lib/libgdk-x11-2.0.so.0
  • #52 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #53 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #54 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #55 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #56 main
  • #0 __kernel_vsyscall






------- Bug created by bug-buddy at 2006-04-02 12:54 -------


Bugreport had an attachment. This cannot be imported to Bugzilla.
Contact bugmaster@gnome.org if you are willing to write a patch for this.
Unknown version 2.14.1 in product gedit.  Setting version to "2.14.x".

Comment 1 Christopher Backhouse 2006-04-02 12:56:20 UTC
Created attachment 62595 [details]
testcase

The attachment that failed on my original email. Now you know what I am actually talking about..
Comment 2 Paolo Borelli 2006-04-02 14:52:04 UTC
The problem(s) is realated to the fact that the file attached has a window line termination \r\n.

This stack trace seems related to search highlighting, but even testing with gtksourceview's test-widget it triggers a critical warnings: the cause may or may not be the same bug...
Comment 3 Paolo Borelli 2006-04-02 16:32:58 UTC
gah... this uncovers lots of buggy behaviours all over the place :/

For instance, lets take the text

lalala\r\n
foo

place the cursor just before the 'f' and press backspace:

-> gtksourceview's test-widget behavior: cursor remains on the second line and 'foo' remains on the second line
-> gtktextview's testext behavior: cursor is moved at the end of the first line, but foo remains on the second line also in this case.

both look buggy to me.


Another one:

lets take the text

#include "foo.h"\r\n
foo

and place once again the cursor before the 'f'. In gtksourceview when pressing backspace 'foo' stays on it's own line as explained above *but* suddenly is highlighted in pink!
Comment 4 Paolo Borelli 2006-04-03 11:01:18 UTC
Created attachment 62661 [details] [review]
gtk patch

this gtk patch fixes the crasher. The other issues I noted above are other bugs.

However I wonder if this patch has any side effect...
Comment 5 Paolo Borelli 2006-04-05 23:04:19 UTC
The above patch was committed to gtk... do we want to try to find a workarond in gedit to not crash with older gtk?

We should also take a look at the other weird behaviors I described above, though they don't sound like easy fixes.
Comment 6 Steve Frécinaux 2006-08-16 14:33:48 UTC
Since we depend on gtk 2.10, I see no reason to keep this bug open.
Closing.