-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[SR-13837] Swift Decimal type crashes on a specific double value #3965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@swift-ci create |
Comment by Glenn Olsson (JIRA) It is not true that it is fine for all other values. I tried with a few similar numbers and some failed while some did indeed not. For instance: 1.8446744073709550E19 - OK
1.8446744073709551E19 - Fails
1.8446744073709552E19 - Fails (same as mentioned in bug report)
1.8446744073709553E19 - Fails
1.8446744073709554E19 - OK
1.8446744073709555E19 - OK
1.8446744073709550E18 - OK
1.8446744073709551E18 - OK
1.8446744073709552E18 - Fails
1.8446744073709553E18 - Fails
1.8446744073709554E18 - OK
1.8446744073709555E18 - OK
1.8446744073709550E20 - Fails
1.8446744073709551E20 - Fails
1.8446744073709552E20 - Fails
1.8446744073709553E20 - Fails
1.8446744073709554E20 - OK
1.8446744073709555E20 - OK It is apparent that it really does not depend on the exponent nor the final digit (the only things I checked). It also seem to fail each time to run it, it is not random. It really depends on the number |
For the overlay (i.e., macOS, etc.): |
I'm still having this issue Swift version 5.9.2 (swift-5.9.2-RELEASE) let x = Decimal(string: "0.000323730024699578384923825161654754178742")! |
Additional Detail from JIRA
md5: 55011e39127ea36a3fecf9509d128bc7
Issue Description:
(lldb) expr Decimal(1.9446744073709552E19)
(Decimal) $R26 = 19446744073709551616.000000
(lldb) expr Decimal(1.8446744073709552E19)
error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0).
The process has been returned to the state before expression evaluation.
(lldb) expr Decimal(2.8446744073709552E19)
(Decimal) $R28 = 28446744073709551616.000000
The value above in bold crashes Swift 1.8446744073709552E19
All other values are fine, even if I simply replace last 2E+19 with 0E+19
The text was updated successfully, but these errors were encountered: