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 743049 - Crashes on startup
Crashes on startup
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.27.x
Other Linux
: High blocker
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks: 745629
 
 
Reported: 2015-01-16 15:23 UTC by Vadim Rutkovsky
Modified: 2015-03-13 14:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use real functions for ConcreteAccessor (1.29 KB, patch)
2015-03-12 17:28 UTC, Luca Bruno
none Details | Review

Description Vadim Rutkovsky 2015-01-16 15:23:24 UTC
Searhorse at 3.14.0-37-ge413d0224f8712c0d52ee74e898b7d1fe9122711, running in Continuous VM crashes on startup.

Traceback:

Thread 4 (Thread 0x7fa750c74700 (LWP 1006))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_cond_wait_until
    at ../../glib/gthread-posix.c line 1437
  • #2 g_async_queue_pop_intern_unlocked
    at ../../glib/gasyncqueue.c line 422
  • #3 g_async_queue_timeout_pop
    at ../../glib/gasyncqueue.c line 543
  • #4 g_thread_pool_wait_for_new_pool
    at ../../glib/gthreadpool.c line 167
  • #5 g_thread_pool_thread_proxy
    at ../../glib/gthreadpool.c line 364
  • #6 g_thread_proxy
    at ../../glib/gthread.c line 764
  • #7 start_thread
    at pthread_create.c line 313
  • #8 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 109

Thread 3 (Thread 0x7fa751475700 (LWP 1005))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_cond_wait_until
    at ../../glib/gthread-posix.c line 1437
  • #2 g_async_queue_pop_intern_unlocked
    at ../../glib/gasyncqueue.c line 422
  • #3 g_async_queue_timeout_pop_unlocked
    at ../../glib/gasyncqueue.c line 570
  • #4 g_thread_pool_wait_for_new_task
    at ../../glib/gthreadpool.c line 262
  • #5 g_thread_pool_thread_proxy
    at ../../glib/gthreadpool.c line 296
  • #6 g_thread_proxy
    at ../../glib/gthread.c line 764
  • #7 start_thread
    at pthread_create.c line 313
  • #8 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 109

Thread 1 (Thread 0x7fa75dab5940 (LWP 975))

  • #0 g_datalist_id_dup_data
    at ../../glib/gdataset.c line 846
  • #1 g_object_notify_queue_freeze
    at ../../gobject/gobject.c line 226
  • #2 g_object_set_valist
    at ../../gobject/gobject.c line 2112
  • #3 g_object_set
    at ../../gobject/gobject.c line 2269
  • #4 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #5 object_set_property
    at ../../gobject/gobject.c line 1415
  • #6 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #7 g_object_set
    at ../../gobject/gobject.c line 2269
  • #8 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #9 object_set_property
    at ../../gobject/gobject.c line 1415
  • #10 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #11 g_object_set
    at ../../gobject/gobject.c line 2269
  • #12 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #13 object_set_property
    at ../../gobject/gobject.c line 1415
  • #14 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #15 g_object_set
    at ../../gobject/gobject.c line 2269
  • #16 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #17 object_set_property
    at ../../gobject/gobject.c line 1415
  • #18 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #19 g_object_set
    at ../../gobject/gobject.c line 2269
  • #20 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #21 object_set_property
    at ../../gobject/gobject.c line 1415
  • #22 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #23 g_object_set
    at ../../gobject/gobject.c line 2269
  • #24 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #25 object_set_property
    at ../../gobject/gobject.c line 1415
  • #26 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #27 g_object_set
    at ../../gobject/gobject.c line 2269
  • #28 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #29 object_set_property
    at ../../gobject/gobject.c line 1415
  • #30 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #31 g_object_set
    at ../../gobject/gobject.c line 2269
  • #32 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #33 object_set_property
    at ../../gobject/gobject.c line 1415
  • #34 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #35 g_object_set
    at ../../gobject/gobject.c line 2269
  • #36 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #37 object_set_property
    at ../../gobject/gobject.c line 1415
  • #38 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #39 g_object_set
    at ../../gobject/gobject.c line 2269
  • #40 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #41 object_set_property
    at ../../gobject/gobject.c line 1415
  • #42 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #43 g_object_set
    at ../../gobject/gobject.c line 2269
  • #44 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #45 object_set_property
    at ../../gobject/gobject.c line 1415
  • #46 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #47 g_object_set
    at ../../gobject/gobject.c line 2269
  • #48 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #49 object_set_property
    at ../../gobject/gobject.c line 1415
  • #50 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #51 g_object_set
    at ../../gobject/gobject.c line 2269
  • #52 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #53 object_set_property
    at ../../gobject/gobject.c line 1415
  • #54 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #55 g_object_set
    at ../../gobject/gobject.c line 2269
  • #56 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #57 object_set_property
    at ../../gobject/gobject.c line 1415
  • #58 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #59 g_object_set
    at ../../gobject/gobject.c line 2269
  • #60 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #61 object_set_property
    at ../../gobject/gobject.c line 1415
  • #62 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #63 g_object_set
    at ../../gobject/gobject.c line 2269
  • #64 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #65 object_set_property
    at ../../gobject/gobject.c line 1415
  • #66 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #67 g_object_set
    at ../../gobject/gobject.c line 2269
  • #68 gck_object_cache_set_attributes
    at ../gck/gck-object-cache.c line 119
  • #69 object_set_property
    at ../../gobject/gobject.c line 1415
  • #70 g_object_set_valist
    at ../../gobject/gobject.c line 2159
  • #71 g_object_set
    at ../../gobject/gobject.c line 2269

etc. etc., gdb showed it was 500+ frames
Comment 1 Vadim Rutkovsky 2015-02-26 14:58:47 UTC
Still happens on 3.15.90-0-g0cc50b8d0b24fd239d570d1ea5ebf1ec1dfe9822, continuous build 20150226.42
Comment 2 Bastien Nocera 2015-02-27 17:57:42 UTC
#12 gck_object_cache_set_attributes
at ../gck/gck-object-cache.c line 119
#13 object_set_property
at ../../gobject/gobject.c line 1415
#14 g_object_set_valist
at ../../gobject/gobject.c line 2159
#15 g_object_set
at ../../gobject/gobject.c line 2269
#16 gck_object_cache_set_attributes
at ../gck/gck-object-cache.c line 119

Looks like an infinite loop setting the object property, which sets the cached attribute, which sets the object property, etc.

From the backtrace, this is a bug in gcr though.
Comment 3 Christophe Fergeau 2015-03-02 10:53:35 UTC
seahorse/pkcs11/pkcs11-certificate.vala defines:
public Gck.Attributes attributes {
		set {
			this._attributes = value;
			this.notify_property("attributes");
		}
	}

In 3.14, the generated C code was calling a seahorse_pkcs11_certificate_real_set_attributes() function which would do
self->priv->_attributes = __vala_GckAttributes_copy0(value);

In jhbuild, the generated C code is calling gcr_object_cache_set_attributes(pkcs11_certificate, value) which is doing g_object_set(self, "attributes", value, NULL). This will call againg GckAttributes::set_property(), which will call gcr_object_cache_set_attributes, ... causing this infinite loop.

Looking in $prefix/share/vala/vapi/gck-1.vapi, the description of the GckObjectCache interface has:
[ConcreteAccessor] public abstract Gck.Attributes attributes { owned get; set; }
while in 3.14, it was
[NoAccessorMethod] public abstract Gck.Attributes attributes { owned get; set; }

Changing ConcreteAccessor to NoAccessorMethod and cleaning seahorse source tree then rebuilding it fixes the crash at startup.

ConcreteAccessor was added in vala 0.27.1 release this January http://valajournal.blogspot.fr/ so this could be a vala bug, or a missing annotation in gcr so that vapigen does the right thing.
Comment 4 Luca Bruno 2015-03-02 11:32:09 UTC
Ok thanks. With ConcreteAccessor we tried to keep up with the new pattern to have a C accessor in the interface which does g_object_get/set. Perhaps the solution is to not call the accessor within the set_property.
Comment 5 Matthias Clasen 2015-03-02 12:04:17 UTC
Both patterns can be found in the wild:

- generic setter calls C setter

- C setter calls g_object_set ()

The first one is more common, but both need to work.
Comment 6 Matthias Clasen 2015-03-04 15:41:56 UTC
Luca, will this be fixed on the vala side ?
Comment 7 Luca Bruno 2015-03-04 15:44:17 UTC
Yes, it's a regression but will take some time before I start hacking on this.
Comment 8 Luca Bruno 2015-03-04 15:45:23 UTC
In the meanwhile not sure if vala can be pinned to an older version, or gck adding an annotation to avoid ConcreteAccessor. Also still have to setup a proper environment for testing the changes.
Comment 9 Matthias Clasen 2015-03-04 15:52:23 UTC
what annotation would that be ?
Comment 10 Luca Bruno 2015-03-04 15:59:02 UTC
Don't have gck at hand right now but a possibility would be to skip processing the accessor, something like: ObjectCache.set_attributes skip
Comment 11 Luca Bruno 2015-03-12 17:28:32 UTC
Created attachment 299220 [details] [review]
use real functions for ConcreteAccessor

Ok I think this is easier than what I thought. Would you check if the attached patch solves the problem and everything works as expected?

On a side note, g_object_notify is already done by vala, so you are doing it twice for your property.
Comment 12 Christophe Fergeau 2015-03-13 13:47:59 UTC
Patch works for me (applied the patch, rebuilt seahorse after touching the .vala files, and it does not crash on startup).
Comment 13 Luca Bruno 2015-03-13 14:09:08 UTC
commit 9b1a55a42082637c1559ca00bb46bb9ac739095d
Author: Luca Bruno <lucabru@src.gnome.org>
Date:   Thu Mar 12 18:27:06 2015 +0100

    codegen: use real function in set/get property also for ConcreteAccessor
    
    Fixes bug 743049

Let's see how it goes, thanks.