GNOME Bugzilla – Bug 756105
Responding with empty array causes daemon to crash
Last modified: 2015-10-20 23:15:12 UTC
Created attachment 312702 [details] [review] Use specific array type for GVariantBuilder While trying to run gnome-session on system I'm still trying to put together, still running in a VM, I ran into this crash. The crash occurs in gvfsdaemon.c:handle_list_monitor_implementations(), whenever we try to return an empty vector (i.e. there are no monitor implementations) - the crash is due to passing a null variant to the dbus response, which errors out while expecting a variant of type 'a(ssbia{sv})'. Granted, the system is not quite configured properly yet, and I'm not sure that there is any "monitor implementations" present in the VM or not, I'm quite sure that the gfvsd crash is undesirable. The attached patch ensures that a properly initialized GVariant is passed instead, so that the daemon properly responds with an empty vector instead of crashing (or aborting).
Comment on attachment 312702 [details] [review] Use specific array type for GVariantBuilder The patch looks good to me, however it shouldn't happen that there are no monitor implementations... don't you see any *.monitor files in $(datadir)/gvfs/remote-volume-monitors directory?
(In reply to Ondrej Holy from comment #1) > Comment on attachment 312702 [details] [review] [review] > Use specific array type for GVariantBuilder > > The patch looks good to me, however it shouldn't happen that there are no > monitor implementations... don't you see any *.monitor files in > $(datadir)/gvfs/remote-volume-monitors directory? No I don't see any, as I have not yet built/installed any. I am basically trying to put together a firmware from scratch, this work may evolve into a sort of continuous integration build; hopefully outputting a disk image / live CD of the latest bleeding edge GNOME built directly from git. So yes, the next step is to build these volume monitors (and provide some of the dependencies for gvfs to build some of it's own monitors), the crash/abort is just something one discovers during this process :)
Ok then, thanks for the patch!
Comment on attachment 312702 [details] [review] Use specific array type for GVariantBuilder commit 77805a9871fcf53e99ccece6509faea77fcf93b4
*** Bug 756885 has been marked as a duplicate of this bug. ***