GNOME Bugzilla – Bug 673858
miner: set parents to NULL to avoid segfault if early "goto out"
Last modified: 2012-04-16 14:18:43 UTC
Created attachment 211785 [details] [review] miner: set parents to NULL to avoid segfault if early "goto out" The symptom from this segfault in the miner is gnome-documents telling GData dbus timeout (due to service dying without a reply). parents is freed uninitialized if one of the call to tracker fails thus setting error to non null, ie goto out before parents is assigned in account_miner_job_process_entry. The issue which triggered tracker to return a non null error disappeared after a run with this fix. I miss a commplete log with LIBGDATA_DEBUG=7 and G_MESSAGES_DEBUG="Tracker,Gjs,libgdata". Still the gdb backtrace with GDATA_MINER_PERSIST=1 showed that the error came from: alternate = gdata_entry_look_up_link (entry, GDATA_LINK_ALTERNATE); alternate_uri = gdata_link_get_uri (alternate); _tracker_sparql_connection_insert_or_replace_triple (job->connection, job->cancellable, error, identifier, resource, "nie:url", alternate_uri);
Review of attachment 211785 [details] [review]: Makes sense, thanks; since calling g_list_free() on a NULL list is fine, I guess we can also remove the if (parents != NULL) condition at the end of the function. Could you do this as an addition to your patch?
Since I want to release 0.4.1 with the fix today, I pushed this patch with my suggestion to git master and gnome-3-4.