Bug 1856

Summary: int64x64_t double conversions
Product: ns-3 Reporter: Peter Barnes <pdbarnes>
Component: coreAssignee: Peter Barnes <pdbarnes>
Severity: normal CC: ns-bugs, tomh
Priority: P5    
Version: ns-3-dev   
Hardware: PC   
OS: All   
See Also: https://www.nsnam.org/bugzilla/show_bug.cgi?id=1786

Description Peter Barnes 2014-02-14 15:49:45 EST
Conversions between int64x64_t and double/long double have problems:

- no proper test cases
- incorrect results on some platforms/some configurations

These are producing failed or crashed tests on some platforms:

fedora-20 32 bit, gcc 4.8.2, optimized

ubuntu 10.04, gcc 4.4.3
Comment 1 Tom Henderson 2014-02-15 15:01:24 EST
The test failing on Fedora Core 20, 32 bit, optimized build is global-routing, due to an off-by-one difference in integer to double conversions.

The test that is crashing on gcc-4.4.3 is int64x64.

Just noting the additional information so that duplicate bugs are not reported.
Comment 2 Peter Barnes 2014-03-02 04:01:20 EST
This turns out to expose several issues:

- grossly insufficient test coverage

- int64x64 implements Q64.64 fixed precision arithmetic, but fractions were mishandled or not even implemented

- output of int64x64 was subtly wrong, because the patch for bug 1786 was tested against the buggy int64x64 implementation

Pending patch:

- implements complete test coverage

- handles fractions correctly

- fixes int64x64 output (again)
Comment 3 Peter Barnes 2014-03-02 04:07:37 EST
Patch r10637 67601c471c22

This leaves four tests failing because of deltas of 1 ns in Times, ultimately affecting pcap output.
Comment 4 Peter Barnes 2014-03-02 04:09:14 EST
Patch r10638 aa85c4fcd5d7

Update test reference pcap for:
TestSuite devices-mesh-dot11s-regression
TestSuite devices-mesh-flame-regression
TestSuite routing-aodv-regression
TestSuite routing-olsr-regression