Bug 913929

Summary: cppad: FTBFS in rawhide
Product: [Fedora] Fedora Reporter: Dennis Gilmore <dennis>
Component: cppadAssignee: Brad Bell <bradbell>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: high    
Version: rawhideCC: bradbell
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-28 13:35:15 UTC Type: ---
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: 913825    

Description Dennis Gilmore 2013-02-22 09:15:18 UTC
Your package cppad failed to build from source in current rawhide.

http://koji.fedoraproject.org/koji/taskinfo?taskID=4959059

Build logs:
root.log: http://kojipkgs.fedoraproject.org/work/tasks/9059/4959059/root.log
build.log: http://kojipkgs.fedoraproject.org/work/tasks/9059/4959059/build.log
state.log: http://kojipkgs.fedoraproject.org/work/tasks/9059/4959059/state.log
NOTE: build logs are cleaned up after 1 week

For details on mass rebuild see https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

Comment 1 Brad Bell 2013-02-26 01:06:57 UTC
The following test failed
https://projects.coin-or.org/CppAD/browser/releases/20130000.1/test_mor/limits.cpp

Here is the log information:
    buildArch (cppad-20130000.1-3.fc19.src.rpm, i686)
         ... snip ...
    http://kojipkgs.fedoraproject.org//work/tasks/5478/5055478/build.log
         ... snip ...
    [ 82%] Built target test_more
    Scanning dependencies of target check_test_more
    abs                 OK
         ... snip ...
    limits              Error

This may be the the same problem that has occurred on the MAC, and seems to be a bug in how complex division is implemented.

I will begin by reproducing the problem on a machine I have access to.

Comment 2 Brad Bell 2013-02-26 02:59:03 UTC
The link to the source code above has test_mor where is should be test_more; i.e.,
https://projects.coin-or.org/CppAD/browser/releases/20130000.1/test_more/limits.cpp

Comment 3 Brad Bell 2013-02-26 13:58:07 UTC
Bug is reproducible as follows:
1. Build a virtual Fedora-18-i686-Live-KDE system
2. fedpkg clone cppad
3. fedpkg mockbuild

Result:
    cppad/results_cppad/20130000.1/2.fc19/build.log 
contains the text:
    Scanning dependencies of target check_test_more
         ... snip ...
    jacobian            OK
    limits              Error
    Log                 OK

Note the error does not occur in Fedora-18.

Comment 4 Brad Bell 2013-02-27 01:21:14 UTC
Using the following command in the setup section of cppad.spec:

sed \
-e '/limits(void)/,/^}/s/ok *&=.*/std::cout << "limits: ok =" << ok << std::endl;\n&/' \
-e '/check_epsilon(void)/,/^\t}/s/ok *&=.*/std::cout << "epsilon: ok =" << ok << std::endl;\n&/' \
-e '/check_min(void)/,/^\t}/s/ok *&=.*/std::cout << "min: ok =" << ok << std::endl;\n&/' \
     -i test_more/limits.cpp

After 
    fedpkg mockbuild
the following output helps to isolate the problem to the check_min routine:
    epsilon: ok =1
    epsilon: ok =1
    limits: ok =1
    ... snip ...
    epsilon: ok =1
    epsilon: ok =1
    limits: ok =1
    min: ok =1
    min: ok =0
    limits: ok =0

Comment 5 Brad Bell 2013-02-27 14:30:45 UTC
The g++ 4.8.0 compiler is outsmarting the limits.cpp test by keeping result in higher precision and reusing them, instead of using values stored to memory.

The following code snipet for check_min in limits.cpp sets ok to false:

          tmp[0]     = min[0] / hun[0];
          match[0]   = tmp[0] * hun[0];
          ok        &= abs_geq(match[0]/min[0] - one[0], three[0]*eps[0]);

while the following change sets it to true:

          tmp[0]     = min[0] / hun[0];
          match[0]   = tmp[0] * hun[0];
std::cout << "match / min - 1 = " << match[0] / min[0] - one[0] << std::endl;
          ok        &= abs_geq(match[0]/min[0] - one[0], three[0]*eps[0]);

Comment 6 Brad Bell 2013-02-27 21:43:59 UTC
Preliminary testing indicates that this bug is fixed by the changeset
    https://projects.coin-or.org/CppAD/changeset/2756

These changes were backported to the 20130000 stable version. A new release of the upstream source, cppad-20130000.2, will be used once this corresponding tarball is automatically generated this evening.

Comment 7 Brad Bell 2013-02-28 13:35:15 UTC
This bug was fixed in the upstream CppAD trunk with the changeset
      https://projects.coin-or.org/CppAD/changeset/2756

These changes were backported to the current upstream stable version of CppAD
      https://projects.coin-or.org/CppAD/changeset/2757

A new upstream release was created; see
      https://projects.coin-or.org/CppAD/browser/releases/20130000.2

A corresponding upstream source tarball was created and uploaded to fedora
      8f764be6e3bcc8b201bc4b7a59717cde  cppad-20130000.2.gpl.tgz

The new upstream source had a successful build; see
      http://koji.fedoraproject.org/koji/taskinfo?taskID=5064147