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
=== modified file 'src/mediascanner-service/main.cpp'
--- src/mediascanner-service/main.cpp 2013-10-08 14:44:18 +0000
+++ src/mediascanner-service/main.cpp 2013-10-14 08:04:58 +0000
@@ -806,6 +806,14 @@
806 return false;806 return false;
807 }807 }
808808
809 // Make sure the network monitor is initialised early, since it is
810 // not reliable if initialised from a thread.
811 GNetworkMonitor *network_monitor = g_network_monitor_get_default();
812 if (not network_monitor) {
813 kError("Could not initialize GNetworkMonitor");
814 return false;
815 }
816
809 // Really check all plugins. Avoid lazy evaluation.817 // Really check all plugins. Avoid lazy evaluation.
810 // Don't abort on missing codecs. We already print a warning.818 // Don't abort on missing codecs. We already print a warning.
811 VerifyMediaFeatures(list_gst_demuxers(), settings_.mandatory_containers());819 VerifyMediaFeatures(list_gst_demuxers(), settings_.mandatory_containers());
812820
=== modified file 'tests/auto/filesystemscannertest.cpp'
--- tests/auto/filesystemscannertest.cpp 2013-10-08 14:44:18 +0000
+++ tests/auto/filesystemscannertest.cpp 2013-10-14 08:04:58 +0000
@@ -353,6 +353,11 @@
353 grl_init(&argc, &argv);353 grl_init(&argc, &argv);
354 gst_init(&argc, &argv);354 gst_init(&argc, &argv);
355355
356 // Initialise GNetworkMonitor early so it doesn't get initialised
357 // in a thread other than than the main loop.
358 GNetworkMonitor *network_monitor = g_network_monitor_get_default();
359 g_assert(network_monitor != NULL);
360
356 mediascanner::filesystemscannertest::SetupTestEnvironments();361 mediascanner::filesystemscannertest::SetupTestEnvironments();
357362
358 return RUN_ALL_TESTS();363 return RUN_ALL_TESTS();

Subscribers

People subscribed via source and target branches