Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on open (or backspace, only sometimes??) when file contains a very long line #99

Closed
KevinField opened this issue Nov 10, 2014 · 19 comments

Comments

@KevinField
Copy link

I have an HTML file I'm migrating from a CMS. The CMS formats the HTML such that it sometimes contains very long lines.

Three or four times in a row, I opened the file in pluma on Linux Mint 17 (32-bit) and started editing it, only to discover that as soon as I hit backspace, pluma would disappear. Window gone, no error message, nothing. The first few times I had typed a couple dozen characters first, but I started to realize it was backspace that was triggering it, but after another launch or two, it wouldn't even get that far: pluma would just open and immediately disappear before I could even try to edit the file. After I realized that, I tried opening a Terminal and launching the file from there. Pluma immediately disappeared. I tried launching from PCManFM again and it stayed open until backspace. I tried from Terminal again and this time it stayed open until backspace. So, I'm not sure what the pattern is around immediate crash vs. backspace, because I've seen both in both a GUI and terminal launch context.

Anyway, in Terminal launches, it says this:

$ pluma index.html 

(pluma:21827): GtkSourceView-CRITICAL **: Highlighting a single line took too much time, syntax highlighting will be disabled

(pluma:21827): Gtk-CRITICAL **: IA__gtk_text_buffer_get_iter_at_offset: assertion 'GTK_IS_TEXT_BUFFER (buffer)' failed

(pluma:21827): Gtk-CRITICAL **: IA__gtk_text_buffer_move_mark: assertion 'GTK_IS_TEXT_MARK (mark)' failed
Segmentation fault

When it doesn't immediately crash, only the first line shows initially, until I hit backspace, which then shows the rest and returns to prompt.

@KevinField
Copy link
Author

The file's about 113kb. Not sure how to tell how long the longest line was. Workaround, fed it thru tidy.

@stefano-k
Copy link
Collaborator

I think the issue can be related to #13

@monsta
Copy link
Contributor

monsta commented Jan 1, 2015

@KevinField: can you please run it via gdb and post the full backtrace from crash?

@monsta
Copy link
Contributor

monsta commented Jan 1, 2015

I've just generated a text file with one line that has more than 100000 chars in it. Could not reproduce the crash with that file. Running Debian Testing with pluma built from git master (1.9.x).

@KevinField
Copy link
Author

Running 1.8.1. If that's not up-to-date, talk to the Mint maintainers, I guess.

I ran gdb and it said, "Reading symbols from /usr/bin/pluma...(no debugging symbols found)...done." I'm guessing I would have to build from source. Also, I would have to regenerate the file that was breaking pluma, which is a longer process than it sounds. I'm not willing to put in the time just now to figure all this out, but if I encounter this again some time, I will know which bug to reopen. Sorry. Maybe you fixed it since 1.8.1 anyway.

@monsta
Copy link
Contributor

monsta commented Jan 18, 2015

Side note: to get debugging symbols you need to install pluma-dbg package.

@yoursunny
Copy link

I have Pluma 1.8.1 on Linux Mint Qiana. I'm experiencing the same issue.
I have a 78400-byte XML file which is all on one line. When I select some text from the file and press BACKSPACE/DELETE or type over it, Pluma crashes; Pluma also crashes if I BACKSPACE without selecting any text; however, there's no crash if I DELETE/type without selecting any text.

Stacktrace:

sunny@sunnyq /home/web/yoursunny/p/ndn6/status $ gdb pluma
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pluma...Reading symbols from /usr/lib/debug/.build-id/9f/4504a0d200038e014ba807170ceee05ffa4092.debug...done.
done.
(gdb) run status.xml
Starting program: /usr/bin/pluma status.xml
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeefaf700 (LWP 7421)]
[New Thread 0x7fffee7ae700 (LWP 7422)]
[New Thread 0x7fffed0ae700 (LWP 7423)]
[New Thread 0x7fffd613b700 (LWP 7425)]

(pluma:7417): GtkSourceView-CRITICAL **: Highlighting a single line took too much time, syntax highlighting will be disabled

(pluma:7417): Gtk-CRITICAL **: IA__gtk_text_buffer_get_iter_at_offset: assertion 'GTK_IS_TEXT_BUFFER (buffer)' failed

(pluma:7417): Gtk-CRITICAL **: IA__gtk_text_buffer_move_mark: assertion 'GTK_IS_TEXT_MARK (mark)' failed

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff72ca040 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
(gdb) bt
#0  0x00007ffff72ca040 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#1  0x00007ffff72df494 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#2  0x00007ffff72e1102 in gtk_text_iter_set_offset () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#3  0x00007ffff7782f31 in ?? () from /usr/lib/libgtksourceview-2.0.so.0
#4  0x00007ffff7768e70 in ?? () from /usr/lib/libgtksourceview-2.0.so.0
#5  0x00007ffff5f143b8 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6  0x00007ffff5f25afb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7  0x00007ffff5f2da29 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#8  0x00007ffff5f2dce2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9  0x00007ffff72d762b in gtk_text_buffer_delete_interactive () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#10 0x00007ffff72d7971 in gtk_text_buffer_delete_selection () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#11 0x00007ffff72f9c51 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#12 0x00007ffff5f143b8 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x00007ffff5f25afb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x00007ffff5f2cbf1 in g_signal_emitv () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x00007ffff7195bed in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#16 0x00007ffff7196101 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#17 0x00007ffff719634a in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#18 0x00007ffff71973b7 in gtk_bindings_activate_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#19 0x00007ffff72fab59 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#20 0x00007ffff776faaa in ?? () from /usr/lib/libgtksourceview-2.0.so.0
#21 0x00007ffff7242815 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#22 0x00007ffff5f14332 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x00007ffff5f25afb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007ffff5f2d6f9 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ffff5f2dce2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007ffff7352724 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#27 0x00007ffff7365f9b in gtk_window_propagate_key_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#28 0x000000000044ca22 in pluma_window_key_press_event (widget=0x7501d0, event=0xeee8f0) at pluma-window.c:377
#29 0x00007ffff7242815 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#30 0x00007ffff5f143b8 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#31 0x00007ffff5f25afb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#32 0x00007ffff5f2d6f9 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#33 0x00007ffff5f2dce2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#34 0x00007ffff7352724 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#35 0x00007ffff7241097 in gtk_propagate_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#36 0x00007ffff724137b in gtk_main_do_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#37 0x00007ffff6ebc1ec in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#38 0x00007ffff5c44e04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007ffff5c45048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007ffff5c4530a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x00007ffff7240447 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#42 0x0000000000427a3c in main (argc=1, argv=0x7fffffffe138) at pluma.c:752
(gdb) q
A debugging session is active.

    Inferior 1 [process 7417] will be killed.

Quit anyway? (y or n) y

@monsta
Copy link
Contributor

monsta commented Mar 7, 2015

@yoursunny: thanks for the backtrace, but can you install libglib2.0-0-dbg and libgtk2.0-0-dbg, then run "bt full" instead of just "bt"?
This will make more complete backtrace. Also it will be much bigger than this one, so you might want to use pastebin for it.

@yoursunny
Copy link

bt full trace with pluma-dbg, libglib2.0-0-dbg, libgtk2.0-0-dbg: http://pastebin.com/YgDT0iKh

Exact steps I did in Pluma:

  1. click before "<?xml-stylesheet"
  2. press and hold right-SHIFT key
  3. click before "<nfdStatus"
  4. release right-SHIFT key
  5. press BACKSPACE key - crash at this point

@monsta
Copy link
Contributor

monsta commented Mar 10, 2015

Thanks! I'm finally able to reproduce it with your file (and got the same backtrace).
Too bad they don't pack any debug package for gtksourceview... I suspect it might be a bug there.

For the record: reproduced in Debian Jessie with pluma 1.9 (from git master) and GLib 2.42.
@stefano-k: I guess it's time to reopen it and change the label to "confirmed"...

@monsta
Copy link
Contributor

monsta commented Mar 10, 2015

Just as I suspected.
It's not reproducible in another Debian Jessie installation with GTK+3 build of MATE 1.9 (from git master).
Of course, because GTK+3 version of pluma uses GTK+3 version of gtksourceview. That just confirms my suspicion about the issue being in GTK+2 version of gtksourceview...

@monsta
Copy link
Contributor

monsta commented Mar 10, 2015

Yeah, it's in gtksourceview and this commit fixes it.

Now I'll be having fun trying to convince Ubuntu maintainers to push it to 14.04... 😕

@monsta
Copy link
Contributor

monsta commented Jun 2, 2015

Ok, I've filed a bug report with attached patches, let's wait for them to get accepted.

@raveit65
Copy link
Member

raveit65 commented Jun 2, 2015

@monsta
i can confirm that pluma GTK2 version crashed here in fedora 22 too, not with pluma GTK3.
But i found no normal patch to apply , only debdiffs which patching a debian changelog too.
I'm happy to use a regular patch for testing ;)
I suggest to file out a PR at gnome git, i can ask M.Clasen to review it.

@monsta
Copy link
Contributor

monsta commented Jun 3, 2015

Wait, why no "normal" patch? The original upstream commit should apply just fine.

@raveit65
Copy link
Member

raveit65 commented Jun 3, 2015

i can confirm the upstream patch fixes the issue here in f22 gtk2

@monsta
Copy link
Contributor

monsta commented Jul 7, 2015

@yoursunny: ok, fixed version of gtksourceview2 is in Ubuntu 14.04 repos now, so it should be fixed in Mint 17.x too.

@yoursunny
Copy link

I confirm this issue is fixed with gtksourceview2 2.10.5-1ubuntu2.14.04.

@monsta
Copy link
Contributor

monsta commented Jul 14, 2015

Great 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants