Skip to content

Error when REPL tries to print value of type Posix.FileSys.ST.stat #67

@JohnReppy

Description

@JohnReppy

Version

110.99.2

Operating System

  • All
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

No response

Processor

No response

Component

Basis Library

Severity

Major

Description of the problem

When using SML/NJ interactively, the SML/NJ REPL shows an error whenever there is a result of type Posix.FileSys.ST.stat.

For example, when evaluating Posix.FileSys.stat "/etc/passwd";

Standard ML of New Jersey (64-bit) v110.99.2 [built: Thu Jan 23 12:34:56 2022]
- Posix.FileSys.stat "/etc/passwd";
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable]
[autoloading done]
val it =
  ST
    {atime=TIME {usec=1652879341508064},ctime=TIME {usec=1647945818121959},

unexpected exception (bug?) in SML/NJ: Representation [Representation]
  raised at: Basis/Implementation/Unsafe/target64-object.sml:111.19-111.33
             ../compiler/TopLevel/print/ppobj.sml:85.45
             ../compiler/TopLevel/print/ppobj.sml:373.24
             ../compiler/TopLevel/print/ppobj.sml:373.24
             ../compiler/TopLevel/print/ppobj.sml:373.24
             ../compiler/TopLevel/interact/evalloop.sml:45.54
-

Transcript

No response

Expected Behavior

No response

Steps to Reproduce

No response

Additional Information

No response

Email address

No response

Comments from smlnj-gforge

Original smlnj-gforge bug number 310

Submitted on 2022-05-19 at 09:48:00

comment by @JohnReppy on 2022-05-20 14:20:00 +000 UTC

The issue seems to be with the dev field of the stat record.

- Posix.FileSys.ST.dev(Posix.FileSys.stat "/etc/passwd");

unexpected exception (bug?) in SML/NJ: Representation [Representation]
  raised at: Basis/Implementation/Unsafe/target64-object.sml:111.19-111.33
             ../compiler/TopLevel/print/ppobj.sml:85.45
             ../compiler/TopLevel/print/ppobj.sml:373.24
             ../compiler/TopLevel/interact/evalloop.sml:45.54

This field is represented as a singleton data constructor that wraps a Word64.word value.

comment by @JohnReppy on 2022-05-20 14:30:00 +000 UTC

Fixed for 2022.1 and 110.99.3. The fix is was to the isUbxTy function in the ppobj.sml file.

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 versiongforgebug (or feature request) ported from smlnj-gforge repository

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions