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 610394 - crash: During autocompletion
crash: During autocompletion
Status: RESOLVED DUPLICATE of bug 625465
Product: anjuta
Classification: Applications
Component: plugins: editor: gtksourceview
unspecified
Other Linux
: Normal critical
: Anjuta 2.30
Assigned To: Johannes Schmid
Anjuta maintainers
Depends on: 605881
Blocks:
 
 
Reported: 2010-02-18 20:16 UTC by Naba Kumar
Modified: 2010-08-13 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Naba Kumar 2010-02-18 20:16:07 UTC
I was just typing something, autocomplete window came up and it crashed. Before the crash, the autocomplete window really changed a lot while typing.

(gdb) bt
  • #0 get_iter_from_index
    at gtksourcecompletionmodel.c line 189
  • #1 tree_model_get_iter
    at gtksourcecompletionmodel.c line 228
  • #2 gtk_tree_model_get_iter
    from /usr/lib/libgtk-x11-2.0.so.0
  • #3 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #4 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #5 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #6 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #7 gtk_tree_selection_select_path
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 gtk_tree_selection_select_iter
    from /usr/lib/libgtk-x11-2.0.so.0
  • #9 check_first_selected
    at gtksourcecompletion.c line 2105
  • #10 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #11 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #12 ??
    from /usr/lib/libgobject-2.0.so.0
  • #13 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #14 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #15 gtk_tree_model_row_inserted
    from /usr/lib/libgtk-x11-2.0.so.0
  • #16 handle_row_inserted
    at gtksourcecompletionmodel.c line 692
  • #17 insert_node
    at gtksourcecompletionmodel.c line 779
  • #18 gtk_source_completion_model_append
    at gtksourcecompletionmodel.c line 1209
  • #19 _gtk_source_completion_add_proposals
    at gtksourcecompletion.c line 3222
  • #20 gtk_source_completion_context_add_proposals
    at gtksourcecompletioncontext.c line 308
  • #21 iassist_proposals
    at sourceview.c line 2179
  • #22 ianjuta_editor_assist_proposals
    at ianjuta-editor-assist.c line 112
  • #23 cpp_java_assist_update_autocomplete
    at cpp-java-assist.c line 395
  • #24 ianjuta_provider_populate
    at ianjuta-provider.c line 129
  • #25 sourceview_provider_populate
    at sourceview-provider.c line 54
  • #26 gtk_source_completion_provider_populate
    at gtksourcecompletionprovider.c line 219
  • #27 update_completion
    at gtksourcecompletion.c line 3162
  • #28 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #29 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #30 ??
    from /usr/lib/libgobject-2.0.so.0
  • #31 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #32 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #33 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #34 gtk_text_buffer_insert_interactive
    from /usr/lib/libgtk-x11-2.0.so.0
  • #35 gtk_text_buffer_insert_interactive_at_cursor
    from /usr/lib/libgtk-x11-2.0.so.0
  • #36 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #37 g_cclosure_marshal_VOID__STRING
    from /usr/lib/libgobject-2.0.so.0
  • #38 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #39 ??
    from /usr/lib/libgobject-2.0.so.0
  • #40 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #41 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #42 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #43 g_cclosure_marshal_VOID__STRING
    from /usr/lib/libgobject-2.0.so.0
  • #44 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #45 ??
    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 ??
    from /usr/lib/gtk-2.0/2.10.0/immodules/im-ibus.so
  • #49 g_cclosure_marshal_VOID__STRING
    from /usr/lib/libgobject-2.0.so.0
  • #50 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #51 ??
    from /usr/lib/libgobject-2.0.so.0
  • #52 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #53 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #54 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #55 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #56 gtk_im_context_filter_keypress
    from /usr/lib/libgtk-x11-2.0.so.0
  • #57 ??
    from /usr/lib/gtk-2.0/2.10.0/immodules/im-ibus.so
  • #58 gtk_im_context_filter_keypress
    from /usr/lib/libgtk-x11-2.0.so.0
  • #59 gtk_im_context_filter_keypress
    from /usr/lib/libgtk-x11-2.0.so.0
  • #60 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #61 gtk_source_view_key_press_event
    at gtksourceview.c line 4234
  • #62 anjuta_view_key_press_event
    at anjuta-view.c line 692
  • #63 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #64 ??
    from /usr/lib/libgobject-2.0.so.0
  • #65 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #66 ??
    from /usr/lib/libgobject-2.0.so.0
  • #67 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #68 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #69 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #70 gtk_window_propagate_key_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #71 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #72 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #73 ??
    from /usr/lib/libgobject-2.0.so.0
  • #74 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #75 ??
    from /usr/lib/libgobject-2.0.so.0
  • #76 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #77 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #78 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #79 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #80 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #81 ??
    from /usr/lib/libgdk-x11-2.0.so.0
  • #82 g_main_context_dispatch
    from /lib/libglib-2.0.so.0
  • #83 ??
    from /lib/libglib-2.0.so.0
  • #84 g_main_loop_run
    from /lib/libglib-2.0.so.0
  • #85 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #86 main
    at main.c line 248

Some messages before it crashed:
(anjuta:16874): GLib-CRITICAL **: g_list_insert_before: assertion `sibling == list' failed

(anjuta:16874): Gtk-CRITICAL **: gtk_tree_row_reference_new: assertion `path != NULL' failed

(anjuta:16874): Gtk-CRITICAL **: gtk_tree_model_row_inserted: assertion `path != NULL' failed

(anjuta:16874): Gtk-CRITICAL **: gtk_tree_path_next: assertion `path != NULL' failed

Program received signal SIGSEGV, Segmentation fault.
Comment 1 Johannes Schmid 2010-02-19 09:47:10 UTC
From the stacktrace I would say this is a problem in gtksourceview. Do you have master of gtksourceview installed?
Comment 2 Naba Kumar 2010-02-19 09:53:02 UTC
(In reply to comment #1)
> From the stacktrace I would say this is a problem in gtksourceview. Do you have
> master of gtksourceview installed?

Yes, I do. Fresh as it can be.

Please see bug 605881 also, it may be related (although crash points are different). That bug has a possible patch from me that prevents the crash, so it would be nice if you can convince sourceview guys to evaluate it for next release. It's is also one of the top happenings in "crash while editting".
Comment 3 Naba Kumar 2010-02-26 14:02:05 UTC
Actually, I don't think this bug is relatd to bug 605881. Bug 605881 no longer happens to me after the patch there, but this one still happens.
Comment 4 Massimo Cora' 2010-03-02 23:05:41 UTC
I'm not getting this here, I'm usually use scintilla.
Anyway, do you remember what you were writing when it crashed?
Comment 5 Johannes Schmid 2010-03-03 01:04:33 UTC
I checked today and there seems to be some memory corruption somewhere. Have to check with valgrind tommorow. Could also be a problem in gtksourceview but I doesn't look like that.

I got various different traces as it crashed far too often.
Comment 6 Naba Kumar 2010-03-03 08:48:18 UTC
(In reply to comment #4)
> I'm not getting this here, I'm usually use scintilla.
> Anyway, do you remember what you were writing when it crashed?

I was mostly writing some function names or variable names. It triggers autocomplete and a bunch of assert failures in autocomplete tree model (like model is invalid etc. etc.) followed by a crash.
Comment 7 Johannes Schmid 2010-03-06 09:18:27 UTC
Please recheck with master. The code was completely rewritten.
Comment 8 Naba Kumar 2010-03-07 17:06:22 UTC
I have used it for a day or so and the crash does not happen. Thanks a lot!

However, couple new things. One is that I get freezes when typing when autocomplete appears. I often manage to type 5 to 10 chars before the autocomplete window is rendered. The other thing is that I get following (harmless) warnings:

(anjuta:14312): libanjuta-symbol-db-DEBUG: symbol-db-search-command.c:192 (sdb_search_command_run) Notify!
(anjuta:14312): libanjuta-symbol-db-DEBUG: symbol-db-search-command.c:192 (sdb_search_command_run) Notify!
(anjuta:14312): libanjuta-symbol-db-DEBUG: symbol-db-search-command.c:169 (sdb_search_command_run) Searching async with type 0
(anjuta:14312): libanjuta-symbol-db-DEBUG: symbol-db-search-command.c:169 (sdb_search_command_run) Searching async with type 1
(anjuta:14312): libanjuta-symbol-db-DEBUG: symbol-db-search-command.c:169 (sdb_search_command_run) Searching async with type 2
(anjuta:14312): libanjuta-symbol-db-DEBUG: symbol-db-search-command.c:185 (sdb_search_command_run) Async search returned no results
(anjuta:14312): libanjuta-symbol-db-DEBUG: symbol-db-search-command.c:192 (sdb_search_command_run) Notify!
(anjuta:14312): libanjuta-symbol-db-DEBUG: symbol-db-search-command.c:192 (sdb_search_command_run) Notify!

(anjuta:14312): GtkSourceView-CRITICAL **: _gtk_source_completion_add_proposals: assertion `item != NULL' failed

(anjuta:14312): GtkSourceView-CRITICAL **: _gtk_source_completion_add_proposals: assertion `item != NULL' failed


Also, as a sidenote, I think we should introduce a timeout between char-added and autocomplte search (something like 200ms). Usually, we stop and ponder a little bit if we need help from autocomplete, other type ahead really fast because we know what to type.
Comment 9 Naba Kumar 2010-03-07 17:07:45 UTC
(In reply to comment #8)
> I often manage to type 5 to 10 chars before the
> autocomplete window is rendered.
> 
I mean ... before editor unfreezes to display the chars.
Comment 10 Johannes Schmid 2010-03-07 17:13:37 UTC
Hi!

> (anjuta:14312): GtkSourceView-CRITICAL **:
> _gtk_source_completion_add_proposals: assertion `item != NULL' failed
> 
> (anjuta:14312): GtkSourceView-CRITICAL **:
> _gtk_source_completion_add_proposals: assertion `item != NULL' failed

Hmm, haven't seen those yet but that really shouldn't happen. Could you maybe get a stacktrace with --g-fatal-warnings?
 
> Also, as a sidenote, I think we should introduce a timeout between char-added
> and autocomplte search (something like 200ms). Usually, we stop and ponder a
> little bit if we need help from autocomplete, other type ahead really fast
> because we know what to type.

This timeout is already implemented in gtksourceview. You will notice that no completion appears when you type fast. This typeout could even be configured using the "auto-complete-delay"-property (http://library.gnome.org/devel/gtksourceview/unstable/GtkSourceCompletion.html#GtkSourceCompletion--auto-complete-delay). However, it's difficult to calculate this correctly for any PC.

I agree though that performance could sometimes be improved. I found it quite usable on my netbook though.
Comment 11 Naba Kumar 2010-03-07 17:28:25 UTC
(In reply to comment #10)
> 
> Hmm, haven't seen those yet but that really shouldn't happen. Could you maybe
> get a stacktrace with --g-fatal-warnings?
> 
(gdb) bt
  • #0 __kernel_vsyscall
  • #1 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #2 *__GI_abort
    at abort.c line 92
  • #3 IA__g_logv
    at /build/buildd/glib2.0-2.22.3/glib/gmessages.c line 549
  • #4 IA__g_log
    at /build/buildd/glib2.0-2.22.3/glib/gmessages.c line 569
  • #5 IA__g_return_if_fail_warning
    at /build/buildd/glib2.0-2.22.3/glib/gmessages.c line 584
  • #6 _gtk_source_completion_add_proposals
    at gtksourcecompletion.c line 3220
  • #7 gtk_source_completion_context_add_proposals
    at gtksourcecompletioncontext.c line 308
  • #8 iassist_proposals
    at /home/vadmin/git/anjuta/plugins/sourceview/sourceview.c line 2179
  • #9 ianjuta_editor_assist_proposals
    at ianjuta-editor-assist.c line 112
  • #10 cpp_java_assist_populate_real
    at cpp-java-assist.c line 516
  • #11 on_symbol_search_complete
    at cpp-java-assist.c line 586
  • #12 on_sdb_search_command_data_arrived
    at symbol-db-iface.c line 365
  • #13 IA__g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.22.3/gobject/gmarshal.c line 77
  • #14 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.22.3/gobject/gclosure.c line 767
  • #15 signal_emit_unlocked_R
  • #16 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.22.3/gobject/gsignal.c line 2980
  • #17 IA__g_signal_emit_by_name
    at /build/buildd/glib2.0-2.22.3/gobject/gsignal.c line 3074
  • #18 anjuta_async_command_notification_poll
    at anjuta-async-command.c line 94
  • #19 g_idle_dispatch
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c line 4065
  • #20 g_main_dispatch
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c line 1960
  • #21 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c line 2513
  • #22 g_main_context_iterate
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c line 2591
  • #23 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.22.3/glib/gmain.c line 2799
  • #24 IA__gtk_main
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c line 1218
  • #25 main
    at main.c line 248


> > Also, as a sidenote, I think we should introduce a timeout between char-added
> > and autocomplte search (something like 200ms). Usually, we stop and ponder a
> > little bit if we need help from autocomplete, other type ahead really fast
> > because we know what to type.
> 
> This timeout is already implemented in gtksourceview. You will notice that no
> completion appears when you type fast.
> 
I guess that takes care of showing the results, but I think the async searches are still triggered, sometimes multiple of them (overlapping/stacking searches since they are not truly canceled at backend).

> I agree though that performance could sometimes be improved. I found it quite
> usable on my netbook though.

I am running anjuta in vmware with full debugging prints and -O0, on x301 laptop. It's pretty slow :). But gedit and other editors works fine. I guess anjuta works smoothly in a faster machines, but this configuration is not really out of the world either.
Comment 12 Tobias Mueller 2010-08-13 14:03:35 UTC
Reopening as the stacktrace has been provided.
Comment 13 Johannes Schmid 2010-08-13 14:11:41 UTC

*** This bug has been marked as a duplicate of bug 625465 ***