Mediascanner2 test failure on yakkety/{armhf,arm64,ppc64el} with latest dbus-cpp

Bug #1621002 reported by James Henstridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dbus-cpp (Ubuntu)
New
Undecided
Unassigned
mediascanner2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When trying to build a new mediascanner2 release, tests failed on a number of architectures when building under Yakkety. Some relevant logs:

https://launchpadlibrarian.net/281862518/buildlog_ubuntu-yakkety-armhf.mediascanner2_0.112+16.10.20160831-0ubuntu1_BUILDING.txt.gz
https://launchpadlibrarian.net/282074929/buildlog_ubuntu-yakkety-arm64.mediascanner2_0.112+16.10.20160831-0ubuntu1_BUILDING.txt.gz
https://launchpadlibrarian.net/281862178/buildlog_ubuntu-yakkety-ppc64el.mediascanner2_0.112+16.10.20160831-0ubuntu1_BUILDING.txt.gz

The failure is occurring in code not touched by the changes in the silo, and I suspect that this is related to dbus-cpp or possibly GCC 6.

The segfault doesn't occur on x86, but I was able to reproduce it on my Chromebook. Attached is a stacktrace from the test_dbus test program.

Related branches

Revision history for this message
James Henstridge (jamesh) wrote :
Revision history for this message
James Henstridge (jamesh) wrote :

This is looking like a case of the code being miscompiled under optimisation. To reproduce, build mediascanner2 using the "RelWithDebInfo" build type and then run:

    ./test/test_dbus --gtest_filter=*filter_codec

The test program segfaults when calling Variant::as<std::string>() on a variant that should have been initialised by reading out of a Message::Reader.

When compiling with the "Debug" build type, the test program completes without error.

I can probably solve the immediate problem in mediascanner2 by disabling optimisation for the affected file.

Revision history for this message
Michi Henning (michihenning) wrote :

Good catch!

I've seen this in the past due to uninitialised variables. With optimisation, the compiler gets more aggressive about register re-use, so a bug can manifest under optimisation when the uninitialised variable ends up in a register that had a previous value in it. (In debug mode, the variable often picks up a zero value instead.)

Not sure if there is an easy way to track down whether this is the case or if this is a genuine code generation problem.

Revision history for this message
Michi Henning (michihenning) wrote :

+1!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mediascanner2 - 0.112+16.10.20160909-0ubuntu1

---------------
mediascanner2 (0.112+16.10.20160909-0ubuntu1) yakkety; urgency=medium

  [ James Henstridge ]
  * When multiple volumes are mounted in quick succession, scan them
    serially to avoid reentrancy problems in the initial scan. (LP:
    #1489656)
  * Add apparmor-easyprof hardware directories to package so AppArmor
    profile can compile when apparmor-easyprof-ubuntu isn't installed.
    (LP: #1443693)
  * Disable optimisation when compiling dbus-codec.cc to avoid gcc 6
    compilation bug. (LP: #1621002)
  * Replace deprecated use of GetConnectionAppArmorSecurityContext
    method with GetConnectionCredentials. (LP: #1489489)

  [ You-Sheng Yang ]
  * Update mediascanner-extractor apparmor profile to cover Android
    library locations on 64-bit systems.

 -- James Henstridge <email address hidden> Fri, 09 Sep 2016 13:46:43 +0000

Changed in mediascanner2 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.