Skip to content

Real.fromLargeInt crashes on large integer input #69

@JohnReppy

Description

@JohnReppy

Version

v110.99.1

Operating System

  • All
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

WSL

Processor

x86 (32-bit)

Component

Basis Library

Severity

Minor

Description of the problem

Real.fromLargeInt (IntInf.pow (2, 4000)) causes the runtime to exit with the following message:

/path/to/sml: Fatal error -- bogus overflow fault: pc = 0x556375360f1b, sig = 11
Additional comments:
This is not an issue with IntInf.pow, that part runs fine.
It also causes the error immediately, so I don't think it is a stack overflow issue.

Transcript

Standard ML of New Jersey (64-bit) v110.99.1 [built: Mon Sep 27 12:56:08 2021]
- Real.fromLargeInt (IntInf.pow (2, 4000));
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable]
[autoloading done]
/path/to/sml: Fatal error -- bogus overflow fault: pc = 0x5647ce573f1b, sig = 11

Expected Behavior

No response

Steps to Reproduce

Real.fromLargeInt (IntInf.pow (2, 4000))

Additional Information

No response

Email address

ssoss@uchicago.edu

Comments from smlnj-gforge

Original smlnj-gforge bug number 313

Submitted via web form by Skye Soss ssoss@uchicago.edu on 2022-06-02 at 19:21:00

Keywords: reals, IntInf

comment by @JohnReppy on 2022-06-27 22:59:00 +000 UTC

Fixed for 110.99.3 and 2022.1. The assembly code for the AMD64 now returns infinity when the scaled exponent exceeds the maximum allowed.

Metadata

Metadata

Assignees

Labels

basis-libproblem with Standard ML Basis librarybugSomething isn't workingfixed-in-110.99.3issues that will be fixed in the 110.99.3 versionfloating-pointproblem related to floating-point operationsgforgebug (or feature request) ported from smlnj-gforge repository

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions