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 673858 - miner: set parents to NULL to avoid segfault if early "goto out"
miner: set parents to NULL to avoid segfault if early "goto out"
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-04-10 20:12 UTC by Alban Browaeys
Modified: 2012-04-16 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
miner: set parents to NULL to avoid segfault if early "goto out" (1.62 KB, patch)
2012-04-10 20:12 UTC, Alban Browaeys
committed Details | Review

Description Alban Browaeys 2012-04-10 20:12:33 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);
Comment 1 Cosimo Cecchi 2012-04-10 20:52:01 UTC
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?
Comment 2 Cosimo Cecchi 2012-04-16 14:18:40 UTC
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.