|
2020-01-02
| ||
| 21:04 | • Closed ticket [1de6b0629e]: number parser fails handling int overflow in exponen... artifact: 5e7bc130fe user: fvogel | |
| 21:04 | • Ticket [1de6b0629e]: 3 changes artifact: f0ebecd3e9 user: fvogel | |
| 16:44 | • Open ticket [1de6b0629e]. artifact: f1255c5e6d user: kbk | |
| 11:37 | • Ticket [1de6b0629e]: 5 changes artifact: 761b950787 user: fvogel | |
|
2019-12-27
| ||
| 00:37 | • Closed ticket [1de6b0629e]. artifact: efd7da321e user: kbk | |
| 00:34 | Merge Tcl 8.7 changes to deal with integer overflow in the exponent, and floating point overflow in ... check-in: fa8169ab74 user: kbk tags: trunk | |
| 00:23 | Merge Tcl 8.6 changes to deal with integer overflow in the exponent, and floating point overflow in ... check-in: 5cb42f70ad user: kbk tags: core-8-branch | |
| 00:12 | Merge Tcl 8.5 changes to deal with integer overflow in the exponent, and floating point overflow in ... check-in: b64a60bb4f user: kbk tags: core-8-6-branch | |
| 00:03 | Merge changes to deal with integer overflow in the exponent, and floating point overflow in the sign... check-in: c3d4779949 user: kbk tags: core-8-5-branch | |
|
2019-12-26
| ||
| 23:59 | • Ticket [1de6b0629e] number parser fails handling int overflow in exponents s... artifact: 639d2e8d12 user: kbk | |
|
2019-12-24
| ||
| 17:34 | • Ticket [1de6b0629e]: 4 changes artifact: b50b14c8d2 user: kbk | |
| 14:50 | • Ticket [1de6b0629e]: 4 changes artifact: ef443c7335 user: kbk | |
|
2019-12-23
| ||
| 16:15 | • Ticket [1de6b0629e]: 4 changes artifact: 375af9450f user: dgp | |
| 16:00 | • Ticket [1de6b0629e]: 3 changes artifact: 201240d4f9 user: dgp | |
|
2019-12-22
| ||
| 18:10 | • Ticket [1de6b0629e]: 3 changes artifact: 0fa573d87d user: dgp | |
|
2019-12-20
| ||
| 14:18 | • New ticket [1de6b0629e]. artifact: 247496ab7b user: dgp | |
number parser fails handling int overflow in exponents
% expr 1e2147483647 Inf % expr 1e2147483648 0.0 % expr 10e2147483647 0.0 Sure there are more cases to illustrate... Issue is the "exponent" argument of Make(Low|High)PrecisionDouble() has type int, but longs are being passed without care to deal with overflow.
fa8169ab74Merge Tcl 8.7 changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] check-in2019-12-27 00:34:515cb42f70adMerge Tcl 8.6 changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] check-in2019-12-27 00:23:49b64a60bb4fMerge Tcl 8.5 changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] check-in2019-12-27 00:12:58c3d4779949Merge changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] check-in2019-12-27 00:03:41
See committed tests for more similar to the original. These are different % expr 0e309 0.0 % expr 0e310 Inf
Still more.... % expr 1[string repeat 0 324]1e-250 1e+75 % expr 1[string repeat 0 325]1e-250 domain error: argument not in valid range
The last comment appears to demonstrate something going wrong with RefineApproximation(). This is getting beyond simple fixes. Calling in the author.
We shouldn't be even getting into RefineApproximation in that case.
I hypothesize that it's getting an integer overflow in the quick checks in MakeHighPrecisionDouble but I won't be able to look in more detail for a few days.
We shouldn't be even getting into RefineApproximation in that case.
I hypothesize that it's getting an integer overflow in the quick checks in MakeHighPrecisionDouble but I won't be able to look in more detail for a few days.
Putative fix committed to the branch. Merging and running tests on the cascade of 8.5->8.6->8.7->trunk now and will commit as they succeed.
All the test cases in the bug report pass now. Merged changes forward to core-8-5-branch, core-8-6-branch, core-8-branch, and trunk.
Since this fix, the build is now failing with MSVC as follows: tclStrToD.c C:\Users\francois\Documents\Development\tcltk-fossil\tcl\win\..\generic\tclStrToD.c(1585) : error C2220: warning treated as error - no 'object' file generated C:\Users\francois\Documents\Development\tcltk-fossil\tcl\win\..\generic\tclStrToD.c(1585) : warning C4013: 'copysign' undefined; assuming extern returning int
@fvogel:
(1) Is this a MSVC6 compilation? Recent MSVC's (at least since VS2013) are documented to have copysign.
(2) Does it work to include the following code burst near the top of tclStrToD.c (somewhere after the #includes)?
#if defined(_MSC_VER_)
inline static double
copysign(double a, double b) {
return _copysign(a, b);
}
#endif
If it works, could you commit that change and re-close the bug?
@kbk: many thanks for the replacement. 1. No, it's a MSVC Express 2008 compiler. 2. Yes it does. I have slightly improved the test to define the replacement function only for MSVC compilers before Visual Studio 2013 since you said VS2013 has it. Committed now. Many thanks!