Merge lp:~jamesh/mediascanner/bug-1237484 into lp:mediascanner

Proposed by James Henstridge
Status: Merged
Approved by: Michal Hruby
Approved revision: 394
Merged at revision: 394
Proposed branch: lp:~jamesh/mediascanner/bug-1237484
Merge into: lp:mediascanner
Diff against target: 34 lines (+13/-0)
2 files modified
src/mediascanner-service/main.cpp (+8/-0)
tests/auto/filesystemscannertest.cpp (+5/-0)
To merge this branch: bzr merge lp:~jamesh/mediascanner/bug-1237484
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michal Hruby (community) Approve
Review via email: mp+190882@code.launchpad.net

Commit message

Create the GNetworkMonitor object earlier to avoid thread safety problems in its constructor, fixing bug #1237484.

Description of the change

Fix the "g_source_unref: assertion 'source != NULL' failed" warning coming from the media scanner.

The origin of the warning is inside the GNetworkMonitorBase class from libgio, and appears to be from a piece of code that assumes it is running in the main loop: an idle function is queued in the constructor and it doesn't expect it to run until the constructor finishes.

This branch just makes sure the GNetworkMonitor is created earlier on to avoid the problem.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:394
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~jamesh/mediascanner/bug-1237484/+merge/190882/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/mediascanner-ci/77/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mediascanner-saucy-amd64-ci/77
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mediascanner-saucy-armhf-ci/77
        deb: http://jenkins.qa.ubuntu.com/job/mediascanner-saucy-armhf-ci/77/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mediascanner-saucy-i386-ci/77

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/mediascanner-ci/77/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/mediascanner-service/main.cpp'
2--- src/mediascanner-service/main.cpp 2013-10-08 14:44:18 +0000
3+++ src/mediascanner-service/main.cpp 2013-10-14 08:04:58 +0000
4@@ -806,6 +806,14 @@
5 return false;
6 }
7
8+ // Make sure the network monitor is initialised early, since it is
9+ // not reliable if initialised from a thread.
10+ GNetworkMonitor *network_monitor = g_network_monitor_get_default();
11+ if (not network_monitor) {
12+ kError("Could not initialize GNetworkMonitor");
13+ return false;
14+ }
15+
16 // Really check all plugins. Avoid lazy evaluation.
17 // Don't abort on missing codecs. We already print a warning.
18 VerifyMediaFeatures(list_gst_demuxers(), settings_.mandatory_containers());
19
20=== modified file 'tests/auto/filesystemscannertest.cpp'
21--- tests/auto/filesystemscannertest.cpp 2013-10-08 14:44:18 +0000
22+++ tests/auto/filesystemscannertest.cpp 2013-10-14 08:04:58 +0000
23@@ -353,6 +353,11 @@
24 grl_init(&argc, &argv);
25 gst_init(&argc, &argv);
26
27+ // Initialise GNetworkMonitor early so it doesn't get initialised
28+ // in a thread other than than the main loop.
29+ GNetworkMonitor *network_monitor = g_network_monitor_get_default();
30+ g_assert(network_monitor != NULL);
31+
32 mediascanner::filesystemscannertest::SetupTestEnvironments();
33
34 return RUN_ALL_TESTS();

Subscribers

People subscribed via source and target branches