You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BZ-2434] ACE_Time_Value operations near limit/saturation fail on 64-bit #2434
Originally posted by @shuston on 2006-03-03 16:11:31 -0600
ACE_Time_Value test fails on 64-bit systems (other than Windows, which was
explicitly worked around for other reasons). The operations that manipulate
values, such as operator*, will fail for values near or at the range of a 64-bit
integer.
The root cause is that the operations are done using "double" floating point
operations and a 'double' on most of these systems is 64 bits and, thus, has a
value range less than that of a 64-bit integer.
This report is to capture thinking on this subject so it can be fixed.
Some notes extracted from email regarding this subject:
From J.T. Conklin:
I think the way to do this is to do this in multiprecision integer
arithmetic. The simplest way to do this would be to add/import an
arbitrary precision integer library, but that would probably bloat
the footprint to an undesirable degree. The alternative is to do
it in line, shouldn't take more than a evening with Seminumerical
Algorithms to work it out.
From Steve Huston:
FYI, there's a GNU MP library that can do what we need, I believe. It's LGPL
though (of course).
AIX and Solaris have a mp(3) library that can do mp integer math, but I haven't
found any floating point that works with it.
Rich Seibel also had input that ACE_Time_Value should be split into a relative
and an absolute time class; Carlos O'Ryan suggested looking at how boost does
this for ideas.
* tests/Time_Value_Test.cpp (run_main):
Simplified assertions. Rather than test equality of sec() and
usec() components separately, just test equality of the
ACE_Time_Value objects as a whole.
Thu Mar 8 18:06:14 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
* ace/Time_Value.cpp (operator *=):
Removed vestigial time value saturation code that does not work
correctly with latest implementation.
Wed Mar 7 17:32:51 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
* ace/Time_Value.cpp (operator*=):
Altered implementation to avoid converting the microseconds
component of the ACE_Time_Value to a fraction of a second. In
the case were the floating point type's mantissa width is the
same as the width of the time_t (seconds) value, a maxed out
ACE_Time_Value seconds component would utilize all bits in the
mantissa, leaving no room for a fraction. The microseconds
component would end up not contributing to the multiplication.
Multiply the seconds and microseconds components separately
instead. This also saves us a floating point division, which
can be expensive.
Tue Mar 6 23:06:15 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
* ace/Time_Value.cpp (operator*=):
Use long double for internal computations if double is not large
enough to retain precision of the time_t/suseconds_t values.
This will only provide improved behavior with compilers that
support double-extended precision floating numbers, i.e. >= 79
bits.
Added comments to explain what is being done in the
implementation.
* tests/Time_Value_Test.cpp:
* tests/tests.mpc:
* tests/run_test.lst:
* tests/Bug_2434_Regression_Test.cpp:
Moved the 64bit overflow test which fails on 64bit systems to
its own file and marked that as not fixed
Activity
jwillemsen commentedon Mar 28, 2026
Originally posted by @jwillemsen on 2006-06-21 14:33:58 -0500 (Bugzilla comment 1)
added depends
jwillemsen commentedon Mar 28, 2026
Originally posted by @jwillemsen on 2006-08-09 09:14:37 -0500 (Bugzilla comment 2)
accept for tao-support
jwillemsen commentedon Mar 28, 2026
Originally posted by @jwillemsen on 2007-01-08 14:20:37 -0600 (Bugzilla comment 3)
*** Bug #2563 has been marked as a duplicate of this bug. ***
jwillemsen commentedon Mar 28, 2026
Originally posted by @jwillemsen on 2007-03-07 15:32:18 -0600 (Bugzilla comment 4)
Ossama committed a few fixes yesterday and today, we should watch the test stats
and see if things are improved
jwillemsen commentedon Mar 28, 2026
Originally posted by @jwillemsen on 2008-02-18 09:04:06 -0600 (Bugzilla comment 5)
not resolved
Thu Mar 9 09:44:14 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
Thu Mar 9 07:44:14 UTC 2007 Ossama Othman ossama_othman@symantec.com
Thu Mar 8 18:06:14 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
Wed Mar 7 17:32:51 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
Tue Mar 6 23:06:15 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
jwillemsen commentedon Mar 28, 2026
Originally posted by @jwillemsen on 2010-01-21 02:20:05 -0600 (Bugzilla comment 6)
Thu Jan 21 08:13:30 UTC 2010 Johnny Willemsen jwillemsen@remedy.nl
jwillemsen commentedon Mar 28, 2026
Originally posted by Olivier Langlois on 2010-01-27 10:42:18 -0600 (Bugzilla comment 7)
Created attachment 1245
svn diff from the trunk to fix the bug.
bug2434_bug3818.patchjwillemsen commentedon Mar 28, 2026
Originally posted by Douglas C. Schmidt on 2010-02-21 15:35:35 -0600 (Bugzilla comment 8)
Fixed, thanks!
jwillemsen commentedon Mar 28, 2026
Originally posted by @shuston on 2010-02-23 16:03:03 -0600 (Bugzilla comment 9)
Still broken; Bug_2434_Regression_Test and Time_Value_Test are still failing.
jwillemsen commentedon Mar 28, 2026
Originally posted by @jwillemsen on 2010-02-25 04:32:28 -0600 (Bugzilla comment 10)
seems to work on a lot of 64bit systems, but 64bit windows is failing
jwillemsen commentedon Oct 1, 2026
DOCGroup/ACE_TAO#2598