Bug 1040715

Summary: dyninst-testsuite fails most g++ tests
Product: [Fedora] Fedora Reporter: Josh Stone <jistone>
Component: dyninstAssignee: Josh Stone <jistone>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fche, jistone, lberk, orion, wcohen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dyninst-8.1.2-6.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1063447 (view as bug list) Environment:
Last Closed: 2013-12-12 02:37:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1063447    

Description Josh Stone 2013-12-12 00:32:04 UTC
Description of problem:
Almost all of the Dyninst g++ subtests fail.

Version-Release number of selected component (if applicable):
dyninst-testsuite-8.1.2-4.fc20.x86_64

How reproducible:
100%

Steps to Reproduce:
1. cd /usr/lib64/dyninst/testsuite
2. ./runTests -all -g++

Actual results:
Many report FAILED right away.

Expected results:
Results should be similar to "./runTests -all -gcc".  The testsuite is not really robust enough to have zero failures, but compiling testcases as C or C++ shouldn't make so much difference.

Additional info:

Comment 1 Josh Stone 2013-12-12 00:53:23 UTC
The primary difference I found is that all the testsuite/*_g++_* files were compiled with optimization, while testsuite/*_gcc_* files were not.

Dyninst actually has the option to compile its testsuite at multiple optimization variants, but the default is just unoptimized.  I've been advised by upstream not to bother with the optimization though, because most of the testcases are not designed well enough to deal with it.  For instance, the compiler might optimize a single read for repeated access to an apparently-unchanging variable, but really some instrumentation intends to change it.  Some cases like this could be solved, adding "volatile" for instance, but it would be a big undertaking to get all testcases in shape for this.

Note, it's no issue for the main libraries -- they can and should be optimized like normal.  This is only a concern for the testsuite binaries.

I found this commit made between 8.1.1 and 8.1.2:

  commit 5f8c0afd6d3667a0d003cb987bfefacc5ac20787
  Author: Bill Williams <bill.edu>
  Date:   Tue May 21 11:47:46 2013 -0500

      Ensure that we compile test suite and Dyninst with the same CXXFLAGS
      to work around gcc 4.7.2 bug

That bug is the std::pair ABI break between C++98 and C++11 (which is actually gcc 4.7.0 and 4.7.1 only).  In a direct build, this commit only ends up adding the global "-std=c++0x" or "-std=c++11" flag to the testsuite, but the way it's written also picks up all the rpmbuild flags, including optimization.

It should be fine to just hard-code -std=c++11 for Fedora builds.