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 741955 - crash in insert_action
crash in insert_action
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-24 23:43 UTC by Igor Gnatenko
Modified: 2015-01-02 22:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Igor Gnatenko 2014-12-24 23:43:26 UTC
gnome-builder-0.1.0-0.23.git.b99b365.fc22.x86_64
gtksourceview3-3.15.3-0.1.git.37cbc00.fc22.x86_64

Tried to press some keys. I'm using vim mode.

Thread 1 (Thread 0x7ff88dceba40 (LWP 25499))

  • #0 __GI_raise
    at ../sysdeps/unix/sysv/linux/raise.c line 55
  • #1 __GI_abort
    at abort.c line 89
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at gtestutils.c line 2306
  • #4 insert_action
    at gtksourceundomanagerdefault.c line 543
  • #8 <emit signal ??? on instance 0x12b4870 [GbEditorDocument]>
    at gsignal.c line 3348
  • #9 gtk_text_buffer_emit_insert
    at gtktextbuffer.c line 918
  • #10 gtk_text_buffer_insert_interactive
    at gtktextbuffer.c line 1010
  • #11 gtk_text_buffer_insert_interactive_at_cursor
    at gtktextbuffer.c line 1048
  • #12 gtk_text_view_commit_text
    at gtktextview.c line 8419
  • #13 g_cclosure_marshal_VOID__STRINGv
    at gmarshal.c line 1004
  • #14 _g_closure_invoke_va
    at gclosure.c line 831
  • #15 g_signal_emit_valist
    at gsignal.c line 3201
  • #16 g_signal_emit_by_name
    at gsignal.c line 3388
  • #17 g_cclosure_marshal_VOID__STRINGv
    at gmarshal.c line 1004
  • #18 _g_closure_invoke_va
    at gclosure.c line 831
  • #19 g_signal_emit_valist
    at gsignal.c line 3201
  • #20 g_signal_emit_by_name
    at gsignal.c line 3388
  • #21 gtk_im_context_simple_commit_char
    at gtkimcontextsimple.c line 188
  • #22 gtk_im_context_simple_filter_keypress
    at gtkimcontextsimple.c line 810
  • #23 gtk_im_context_simple_filter_keypress
    at gtkimcontextsimple.c line 1140
  • #24 gtk_im_multicontext_filter_keypress
    at gtkimmulticontext.c line 361
  • #25 gtk_text_view_key_press_event
    at gtktextview.c line 4940
  • #26 gtk_source_view_key_press_event
    at gtksourceview.c line 3596
  • #27 gb_source_view_key_press_event
    at src/editor/gb-source-view.c line 1692
  • #32 <emit signal ??? on instance 0x1716530 [GbSourceView]>
    at gsignal.c line 3348
  • #33 gtk_widget_event_internal
    at gtkwidget.c line 7798
  • #34 gtk_window_propagate_key_event
    at gtkwindow.c line 7656
  • #35 gtk_window_key_press_event
    at gtkwindow.c line 7689
  • #36 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 130
  • #37 _g_closure_invoke_va
    at gclosure.c line 831
  • #38 g_signal_emit_valist
    at gsignal.c line 3201
  • #39 g_signal_emit
    at gsignal.c line 3348
  • #40 gtk_widget_event_internal
    at gtkwidget.c line 7798
  • #41 propagate_event
    at gtkmain.c line 2502
  • #42 gtk_main_do_event
    at gtkmain.c line 1743
  • #43 gdk_event_source_dispatch
    at gdkeventsource.c line 364
  • #44 g_main_context_dispatch
    at gmain.c line 3122
  • #45 g_main_context_dispatch
    at gmain.c line 3737
  • #46 g_main_context_iterate
    at gmain.c line 3808
  • #47 g_main_context_iteration
    at gmain.c line 3869
  • #48 g_application_run
    at gapplication.c line 2290
  • #49 main
    at src/main.c line 45

Comment 1 Alexandre Franke 2014-12-25 00:04:59 UTC
Are you able to reproduce it or did that just happen once? Does this happen with any key?
Comment 2 Igor Gnatenko 2014-12-25 00:11:23 UTC
(In reply to comment #1)
> Are you able to reproduce it or did that just happen once? Does this happen
> with any key?

this happened once. I can't reproduce =(
Comment 3 Christian Hergert 2014-12-25 01:33:02 UTC
Igor, do you use an input method by chance?
Comment 4 Christian Hergert 2014-12-25 07:29:13 UTC
Since this is in gtksourceundomanagerdefault.c, I'm going to CC swilmet. It very well might be caused by something we are doing, but he might be able to venture a guess.
Comment 5 Sébastien Wilmet 2014-12-26 12:55:43 UTC
The problem comes maybe from this commit:
https://git.gnome.org/browse/gtksourceview/commit/?id=da48829adc339a6751be29f102d0c6cdc687e61a

GLib >= 2.43.1 is required. Which GLib version do you have? Are you on Fedora 22 (rawhide?) or Fedora 21 with some packages from 22 (from the COPR)?
Comment 6 Igor Gnatenko 2014-12-26 13:09:49 UTC
(In reply to comment #5)
> The problem comes maybe from this commit:
> https://git.gnome.org/browse/gtksourceview/commit/?id=da48829adc339a6751be29f102d0c6cdc687e61a
> 
> GLib >= 2.43.1 is required. Which GLib version do you have? Are you on Fedora
> 22 (rawhide?) or Fedora 21 with some packages from 22 (from the COPR)?

[brain@x1carbon ~]$ rpm -q glib2
glib2-2.43.2-1.fc22.x86_64
Comment 7 Igor Gnatenko 2014-12-26 13:10:05 UTC
(In reply to comment #3)
> Igor, do you use an input method by chance?

I think no.
Comment 8 Sébastien Wilmet 2014-12-26 13:40:31 UTC
Did you see warning or critical messages in the terminal? Or did you run Builder graphically? In the latter case I don't think it's possible to see the messages (ideally it should be available in a log or the journal).
Comment 9 Sébastien Wilmet 2014-12-26 14:52:20 UTC
If GLib >= 2.43.1 was used, then I don't know what caused the crash. By re-checking the code in GtkSourceView (in the undo manager) everything looks fine, and the code is well covered by unit tests.

Are you sure the GLib package was not updated recently (after the crash)? Because it would clearly explain the crash.

The only thing that comes to my mind is a weak pointer not removed, but it's unlikely (and it would cause lots of other strange crashes in low-level stuff, unless the weak pointer not removed is hard to reproduce and is executed in a short timeframe).
Comment 10 Sébastien Wilmet 2014-12-26 16:52:06 UTC
The backtrace is a bit strange, some frames are missing. Frame #4, insert_action(), should have been called from insert_text_cb(), but insert_text_cb() is missing in the backtrace.

Maybe the debuginfo is not synced with the binaries?
Comment 11 Sébastien Wilmet 2014-12-26 18:09:16 UTC
Did the crash happen after loading a file? Was it the _first_ key pressed in Vim insertion mode? (the key pressed was 'M').

There is maybe an explanation, if the following functions are called in that order:
- gtk_text_buffer_begin_user_action()
- gtk_source_buffer_begin_not_undoable_action() (beginning of file loading)
- gtk_source_buffer_end_not_undoable_action() (end of file loading)
- insert text in the buffer -> assertion fails
- gtk_text_buffer_end_user_action()
Comment 12 Igor Gnatenko 2014-12-26 18:53:21 UTC
(In reply to comment #10)
> The backtrace is a bit strange, some frames are missing. Frame #4,
> insert_action(), should have been called from insert_text_cb(), but
> insert_text_cb() is missing in the backtrace.
> 
> Maybe the debuginfo is not synced with the binaries?
debuginfo from gnome-builder or from gtksourceview or from ...?

debuginfo for gnome-builder and gtksourceview3 100% the same version.

(In reply to comment #11)
> Did the crash happen after loading a file? Was it the _first_ key pressed in
> Vim insertion mode? (the key pressed was 'M').
I'm not sure
> 
> There is maybe an explanation, if the following functions are called in that
> order:
> - gtk_text_buffer_begin_user_action()
> - gtk_source_buffer_begin_not_undoable_action() (beginning of file loading)
> - gtk_source_buffer_end_not_undoable_action() (end of file loading)
> - insert text in the buffer -> assertion fails
> - gtk_text_buffer_end_user_action()
I think I had some files opened. I've created new or opened exist file and written some text. after I pressed escape and pressed some keys. Random keys.
Comment 13 Igor Gnatenko 2014-12-31 06:45:23 UTC
GtkSourceView:ERROR:gtksourceundomanagerdefault.c:543:insert_action: assertion failed: (group != NULL)

Used builder from git. Just switched back to gnome-builder from another window and tried to write some text.
Comment 14 Sébastien Wilmet 2015-01-02 18:21:16 UTC
It should be fixed now:
https://git.gnome.org/browse/gtksourceview/commit/?id=357993e69183a62c1f46a384181d2d2864a0862f

I'll backport the commit to the gnome-3-14 branch.

I didn't manage to reproduce the bug in Builder, but I've reproduced the same error with unit tests.
Comment 15 Christian Hergert 2015-01-02 22:33:40 UTC
Thanks for tracking this down! For Builder, we should be good with the master version since most people are building from jhbuild (and our Copr repo has a gtksourceview package from git).