GNOME Bugzilla – Bug 336915
Crash when backspacing: char offset off the end of the line
Last modified: 2006-08-16 14:33:48 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 ()
+ Trace 67394
Thread 1 (Thread -1225381664 (LWP 4797))
------- 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".
Created attachment 62595 [details] testcase The attachment that failed on my original email. Now you know what I am actually talking about..
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...
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!
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...
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.
Since we depend on gtk 2.10, I see no reason to keep this bug open. Closing.