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 735538 - crashes after configuring an account
crashes after configuring an account
Status: RESOLVED NOTABUG
Product: geary
Classification: Other
Component: build
unspecified
Other Linux
: Urgent normal
: 0.8.0
Assigned To: Geary Maintainers
Geary Maintainers
: 735281 735651 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-08-27 17:57 UTC by Elad Alfassa
Modified: 2014-09-02 19:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Elad Alfassa 2014-08-27 17:57:18 UTC
1) configure an account in geary
2) crash
3) try to open it again
4) crash

This bt is from the crash after opening it again, it basically crashes on startup now.

geary-0.7.1-1.fc21.x86_64

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff207fdec in g_type_check_instance_is_fundamentally_a (
    type_instance=type_instance@entry=0xb93730, 
    fundamental_type=fundamental_type@entry=80) at gtype.c:3982
3982	  return node && (NODE_FUNDAMENTAL_TYPE(node) == fundamental_type);
(gdb) bt
  • #0 g_type_check_instance_is_fundamentally_a
    at gtype.c line 3982
  • #1 g_object_ref
    at gobject.c line 3041
  • #2 conversation_list_view_get_adjustment
  • #3 _conversation_list_view_on_conversations_added_began_conversation_list_store_conversations_added_began
  • #4 _g_closure_invoke_va
    at gclosure.c line 831
  • #5 g_signal_emit_valist
    at gsignal.c line 3218
  • #6 g_signal_emit_by_name
    at gsignal.c line 3405
  • #7 conversation_list_store_on_conversations_added
  • #11 <emit signal 0x50 <error: Cannot access memory at address 0x50> on instance 0x7fffdc0031d0 [GearyAppConversationMonitor]>
    at gsignal.c line 3405
  • #12 geary_app_conversation_monitor_process_email_complete_async_co
  • #13 g_simple_async_result_complete
    at gsimpleasyncresult.c line 763
  • #14 geary_app_conversation_set_add_all_emails_async_co
  • #15 g_simple_async_result_complete
    at gsimpleasyncresult.c line 763
  • #16 geary_imap_engine_generic_account_real_get_containing_folders_async_co
  • #17 g_simple_async_result_complete
    at gsimpleasyncresult.c line 763
  • #18 geary_imap_db_account_get_containing_folders_async_co
  • #19 g_simple_async_result_complete
    at gsimpleasyncresult.c line 763
  • #20 geary_smtp_outbox_folder_add_to_containing_folders_async_co
  • #21 g_simple_async_result_complete
    at gsimpleasyncresult.c line 763
  • #22 geary_db_database_exec_transaction_async_co
  • #23 g_simple_async_result_complete
    at gsimpleasyncresult.c line 763
  • #24 geary_db_transaction_async_job_wait_for_completion_async_co
  • #25 g_simple_async_result_complete
    at gsimpleasyncresult.c line 763
  • #26 geary_nonblocking_abstract_semaphore_real_wait_async_co
  • #27 _geary_scheduler_scheduled_instance_on_callback_gsource_func
  • #28 g_main_context_dispatch
    at gmain.c line 3064
  • #29 g_main_context_dispatch
    at gmain.c line 3663
  • #30 g_main_context_iterate
    at gmain.c line 3734
  • #31 g_main_context_iteration
    at gmain.c line 3795
  • #32 g_application_run
    at gapplication.c line 2219
  • #33 _vala_main
  • #34 __libc_start_main
    at libc-start.c line 289
  • #35 _start

Comment 1 Robert Schroll 2014-08-27 20:37:03 UTC
That's weird.  My first instinct is that this is a problem with GTK or Vala.  Which versions are you using?
Comment 2 Elad Alfassa 2014-08-28 11:45:51 UTC
vala-0.25.2-1.fc21.x86_64
gtk3-3.13.7-1.fc21.x86_64
Comment 3 Robert Schroll 2014-08-28 15:42:30 UTC
Bleeding edge, I see.  We already had one GTK bug that resolved itself this cycle; I wonder if this could be another.  Is it possible for you to downgrade gtk to 3.12 (or even an earlier version of 3.13) and see if the problem remains?

Also, if you can post the function conversation_list_view_get_adjustment() from build/src/client/conversation-list/conversation-list-view.c, I'll compare it to mine to see if valac messed anything up.
Comment 4 Elad Alfassa 2014-08-28 16:00:18 UTC
> Bleeding edge, I see.

Well, someone needs to test Fedora 21 before we release it :) It worth mentioning I got the same crash with geary 0.6.x


> Is it possible for you to downgrade
gtk to 3.12 (or even an earlier version of 3.13) and see if the problem
remains?

That would be very complicated,I rather not do that.

> Also, if you can post the function conversation_list_view_get_adjustment() from
> build/src/client/conversation-list/conversation-list-view.c, I'll compare it to
> mine to see if valac messed anything up.

static GtkAdjustment* conversation_list_view_get_adjustment (ConversationListView* self) {
	GtkAdjustment* result = NULL;
	GtkScrolledWindow* parent = NULL;
	GtkContainer* _tmp0_ = NULL;
	GtkScrolledWindow* _tmp1_ = NULL;
	GtkScrolledWindow* _tmp2_ = NULL;
	GtkScrolledWindow* _tmp3_ = NULL;
	GtkAdjustment* _tmp4_ = NULL;
	GtkAdjustment* _tmp5_ = NULL;
#line 135 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	g_return_val_if_fail (IS_CONVERSATION_LIST_VIEW (self), NULL);
#line 136 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	_tmp0_ = (GtkContainer*) gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
#line 136 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_scrolled_window_get_type ()) ? ((GtkScrolledWindow*) _tmp0_) : NULL);
#line 136 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	parent = _tmp1_;
#line 137 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	_tmp2_ = parent;
#line 137 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	if (_tmp2_ == NULL) {
#line 138 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
		g_debug ("conversation-list-view.vala:138: Parent was not scrolled window");
#line 139 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
		result = NULL;
#line 139 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
		_g_object_unref0 (parent);
#line 139 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
		return result;
#line 844 "conversation-list-view.c"
	}
#line 142 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	_tmp3_ = parent;
#line 142 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	_tmp4_ = gtk_scrolled_window_get_vadjustment (_tmp3_);
#line 142 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	_tmp5_ = _g_object_ref0 (_tmp4_);
#line 142 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	result = _tmp5_;
#line 142 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	_g_object_unref0 (parent);
#line 142 "/home/elad/sources/geary/src/client/conversation-list/conversation-list-view.vala"
	return result;
#line 858 "conversation-list-view.c"
}
Comment 5 Robert Schroll 2014-08-28 16:48:56 UTC
The vala-generated code is nearly identical; the only difference is the type of _tmp0_:

	_tmp0_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_WIDGET, GtkWidget));
list-view.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GTK_TYPE_SCROLLED_WINDOW) ? ((GtkScrolledWindow*) _tmp0_) : NULL);

vs

    _tmp0_ = (GtkContainer*) gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
    _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_scrolled_window_get_type ()) ? ((GtkScrolledWindow*) _tmp0_) : NULL);

On the one hand, I don't see how this change could cause a problem; on the other, the traceback is pointing to a g_object_ref call, and this is one of two in that function.

You mention seeing the same problem in the 0.6 series.  Was that also with current versions of GTK and vala, or was that a while ago?
Comment 6 Elad Alfassa 2014-08-28 16:57:21 UTC
(In reply to comment #5)
> You mention seeing the same problem in the 0.6 series.  Was that also with
> current versions of GTK and vala, or was that a while ago?


Yes, same versions. The latest 0.6 build in Fedora was at 2014-08-22, back then the versions were:

gtk3-3.13.7-1.fc21
vala-0.25.1-2.fc21

Which is nearly identical.
Comment 7 Robert Schroll 2014-08-28 18:23:39 UTC
I just upgraded to vala 0.25.2 (from 0.24.0) and, while I can't reproduce your specific problem, I am getting a bunch of critical warnings and a crash, all related to the Adjustment associated with the conversation list view.  I'm guessing it has the same root cause as this problem.  Something's changed in vala, and now this Adjustment isn't being set up correctly.  I don't know if this is an error in vala or an error in Geary that was hidden by older vala versions.

If Fedora allows parallel installation of vala versions, you might try building with 0.24 and see if that fixes things.
Comment 8 Elad Alfassa 2014-08-28 18:28:14 UTC
Our options are either 0.18 or 0.25, and I don't think I can introduce a new compat package for 0.24 at this stage... It would be better to fix geary I think. (I'm not trying to solve this for myself, I'm trying to solve this for the entire distro)
Comment 9 Robert Schroll 2014-08-28 18:29:59 UTC
Oh, obviously.  The 0.24 suggestion was just to confirm the diagnosis.
Comment 10 Robert Schroll 2014-08-28 19:49:43 UTC
I've found something in the generated C code from 0.25 that bothers me.  An except from geary_controller_should_notify_new_messages():

	MainWindow* _tmp4_ = NULL;
	ConversationListView* _tmp5_ = NULL;
	ConversationListView* _tmp6_ = NULL;
	GtkAdjustment* _tmp7_ = NULL;
	GtkAdjustment* _tmp8_ = NULL;
	GtkAdjustment* _tmp9_ = NULL;
	gdouble _tmp10_ = 0.0;
	gdouble _tmp11_ = 0.0;
	_tmp4_ = self->priv->_main_window;
	_tmp5_ = main_window_get_conversation_list_view (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = gtk_scrollable_get_vadjustment (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GTK_TYPE_SCROLLABLE, GtkScrollable));
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp10_ = gtk_adjustment_get_value (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp1_ = _tmp11_ != 0.0;
	_g_object_unref0 (_tmp9_);

Two things here bother me.  First, _tmp8_ does nothing -- it just passes a value from _tmp7_ to _tmp9_.  That's not a problem, but it suggests that valac has gotten itself confused.  More worrisome is the g_object_unref of _tmp9_ (== _tmp8_ == _tmp7_ == the problematic Adjustment).  This function doesn't increase the ref count anywhere, so I don't think it should be decreasing it.  Perhaps this is causing it to be erroneously freed, leading to this problem.

Notably, the code generated by 0.24 is similar, but omits both of these lines.
Comment 11 Robert Schroll 2014-08-28 20:47:56 UTC
Submitted to vala as bug #735640.
Comment 12 Jim Nelson 2014-08-29 01:26:42 UTC
Thanks for getting on top of this Robert.  Yes, this appears to be breakage from Vala 0.25.2.  See my note in bug #735640.

The long and the short of it is, do not build Geary with Vala 0.25.2.  The GTK+ bindings appear to be broken.
Comment 13 Jim Nelson 2014-08-29 02:43:12 UTC
*** Bug 735651 has been marked as a duplicate of this bug. ***
Comment 14 Jim Nelson 2014-08-29 18:51:52 UTC
I've verified this is fixed in Vala master.
Comment 15 Jim Nelson 2014-09-02 19:02:05 UTC
Fixed in Vala 0.25.3.
Comment 16 Jim Nelson 2014-09-02 19:18:36 UTC
*** Bug 735281 has been marked as a duplicate of this bug. ***