zeitgeist ftbfs with GCC 5

Bug #1475623 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Fix Released
Medium
zeitgeist (Ubuntu)
Fix Released
Critical
Robert Ancell
Tags: lsd-cxx11
Revision history for this message
Matthias Klose (doko) wrote :
Revision history for this message
Matthias Klose (doko) wrote :

Robert, please have a look. This is using GCC 5. There also is a new usptream release.

Changed in zeitgeist (Ubuntu):
assignee: nobody → Robert Ancell (robert-ancell)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

The linked build in comment 1 is for telephony-service, not zeitgeist.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

The first build log is implying that Mir is not built / linekd correctly:
/usr/lib/x86_64-linux-gnu/libmirprotobuf.so.0: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'

Revision history for this message
Robert Ancell (robert-ancell) wrote :
Changed in zeitgeist (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I think the issue is the std::string object is going out of scope in the tests. The tests are like this:

g_assert_cmpstr (std::string ("scheme_no_spaces_in_uris"), ==, StringUtils::MangleUri("scheme:no spaces in uris").c_str ());

Inside the g_assert_cmpstr macro the two strings are stored in variables. Nothing is left holding the result of MangleUri () so the result from c_str () is no longer valid. I guess GCC 5.1 is more agressive in destroying the std:string than it used to be?

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Note this only happens in the tests with strings > 15 characters in length. I suspect that must be the boundary where std::string starts mallocing the contents.

Revision history for this message
In , Robert Ancell (robert-ancell) wrote :

The tests were using a c_str() result from a std::string that had gone out of
scope. GCC 5.1 seems to be more agressive in freeing the string data before
the tests checked against it.

Revision history for this message
In , Robert Ancell (robert-ancell) wrote :

Created attachment 117327
Fix tests crashing with GCC 5.1

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Patch filed upstream and upload to the GCC 5.1 PPA.

Changed in zeitgeist (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zeitgeist - 0.9.16-0ubuntu2

---------------
zeitgeist (0.9.16-0ubuntu2) wily; urgency=medium

  * debian/patches/fix-test-crash.patch:
    - Fix tests crashing with GCC 5.1 (LP: #1475623)

 -- Robert Ancell <email address hidden> Fri, 24 Jul 2015 16:16:14 +1200

Changed in zeitgeist (Ubuntu):
status: Fix Committed → Fix Released
Changed in zeitgeist:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Rico Tzschichholz (ricotz) wrote :

commit f9d2b4a70b8fd11a5c1d399ce8f4d50ea60e7fbc
Author: Robert Ancell <email address hidden>
Date: Fri Jul 24 16:14:11 2015 +1200

    Fix tests crashing with GCC 5.1

    The tests were using a c_str() result from a std::string that had gone out of
    scope. GCC 5.1 seems to be more agressive in freeing the string data before
    the tests checked against it.

    https://bugs.freedesktop.org/show_bug.cgi?id=91443

Changed in zeitgeist:
status: Confirmed → 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.