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 728546 - crash in extractor on dbus timeout warning
crash in extractor on dbus timeout warning
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: Extractor
1.0.x
Other Linux
: Normal major
: ---
Assigned To: tracker-extractor
Depends on:
Blocks:
 
 
Reported: 2014-04-19 07:53 UTC by Seán de Búrca
Modified: 2014-04-22 10:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Prevent segfault (1.48 KB, patch)
2014-04-19 07:53 UTC, Seán de Búrca
reviewed Details | Review

Description Seán de Búrca 2014-04-19 07:53:36 UTC
Created attachment 274724 [details] [review]
Prevent segfault

While running the extractor, I will receive the following warning printed to the console:

(lt-tracker-extract:19772): Tracker-WARNING **: There was an error pushing metadata: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)

When this occurs, tracker-extract crashes at decorator_commit_cb(). decorator_commit_cb() is expecting tracker_sparql_connection_update_array_finish() to return a list of errors, but this does not appear to be the case. The attached patch corrects the crash, though it's a naïve approach and may be the wrong one.
Comment 1 Martyn Russell 2014-04-22 10:17:12 UTC
(In reply to comment #0)
> Created an attachment (id=274724) [details] [review]
> Prevent segfault
> 
> While running the extractor, I will receive the following warning printed to
> the console:
> 
> (lt-tracker-extract:19772): Tracker-WARNING **: There was an error pushing
> metadata: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message did not
> receive a reply (timeout by message bus)
> 
> When this occurs, tracker-extract crashes at decorator_commit_cb().
> decorator_commit_cb() is expecting
> tracker_sparql_connection_update_array_finish() to return a list of errors, but
> this does not appear to be the case. The attached patch corrects the crash,
> though it's a naïve approach and may be the wrong one.

Hello Seán, thanks for pointing out this crasher. It's clear where it happens, but your patch isn't quite right.

I've committed a variation of the patch that still iterates the errors. It looks to me like the crash comes from the errors->len use in the for() loop in cases where we fail in the tracker_sparql_connection_update_array_finish() call and an error is returned. In this case, its expected that the "errors" variable is NULL and dereferencing it will cause the crash.

I've tested it here, it seems to work well. Let me know if you have any problems after this commit. This should be released in 1.0.1.

Thank you for your work! :)