Skip to content
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

Reassigning Compiler.Control.Print.out fails on 64 bit #169

Open
1 of 5 tasks
JohnReppy opened this issue Jul 16, 2022 · 0 comments
Open
1 of 5 tasks

Reassigning Compiler.Control.Print.out fails on 64 bit #169

JohnReppy opened this issue Jul 16, 2022 · 0 comments
Assignees
Labels
bug Something isn't working compiler problem with compiler gforge bug (or feature request) ported from smlnj-gforge repository

Comments

@JohnReppy
Copy link
Contributor

Version

110.95

Operating System

  • All
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

Debian 10

Processor

x86 (32-bit)

Component

Core system

Severity

Minor

Description of the problem

Reassining Compiler.Control.Print.out causes the 64-bit compiler to fail on
110.95, though the 32-bit compiler seems fine. In the sample code I reassign
it to accumulate the output in a string ref. The transcript shows the result
of compiling under 'sml -32' and 'sml -64'.

Transcript

$ /opt/smlnj-110.95/bin/sml -32
Standard ML of New Jersey (32-bit) v110.95 [built: Mon Nov 11 16:32:21 2019]
- CM.make "A.cm" ;
[autoloading]
[library $smlnj/cm/cm.cm is stable]
[library $smlnj/internal/cm-sig-lib.cm is stable]
[library $/pgraph.cm is stable]
[library $smlnj/internal/srcpath-lib.cm is stable]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable]
[autoloading done]
[scanning A.cm]
[library $smlnj/compiler/compiler.cm is stable]
[library $smlnj/compiler/current.cm is stable]
[library $smlnj/compiler/x86.cm is stable]
[library $smlnj/viscomp/basics.cm is stable]
[library $smlnj/viscomp/x86.cm is stable]
[library $smlnj/viscomp/core.cm is stable]
[library $smlnj/MLRISC/MLRISC.cm is stable]
[library $SMLNJ-MLRISC/MLRISC.cm is stable]
[library $smlnj-lib.cm(=$SMLNJ-LIB/Util)/smlnj-lib.cm is stable]
[library $Graphs.cm(=$SMLNJ-MLRISC)/Graphs.cm is stable]
[library $Lib.cm(=$SMLNJ-MLRISC)/Lib.cm is stable]
[library $compiler/(core.cm):MiscUtil/const-arith/sources.cm is stable]
[library $smlnj/smlnj-lib/controls-lib.cm is stable]
[library $SMLNJ-LIB/Controls/controls-lib.cm is stable]
[library $smlnj/MLRISC/Lib.cm is stable]
[library $smlnj/viscomp/debugprof.cm is stable]
[library $smlnj/viscomp/elabdata.cm is stable]
[library $smlnj/smlnj-lib/pp-lib.cm is stable]
[library $SMLNJ-LIB/PP/pp-lib.cm is stable]
[library $html-lib.cm(=$SMLNJ-LIB/HTML)/html-lib.cm is stable]
[library $smlnj/viscomp/execute.cm is stable]
[library $smlnj/viscomp/parser.cm is stable]
[library $smlnj/viscomp/elaborate.cm is stable]
[library $smlnj/MLRISC/IA32.cm is stable]
[library $SMLNJ-MLRISC/IA32.cm is stable]
[library $smlnj/MLRISC/Graphs.cm is stable]
[library $smlnj/MLRISC/Visual.cm is stable]
[library $SMLNJ-MLRISC/Visual.cm is stable]
[library $smlnj/MLRISC/Control.cm is stable]
[library $SMLNJ-MLRISC/Control.cm is stable]
[library $smlnj/internal/smlnj-version.cm is stable]
[loading (A.cm):a.sml]
[New bindings added.]
val it = true : bool
-
$
$ /opt/smlnj-110.95/bin/sml -64
Standard ML of New Jersey (64-bit) v110.95 [built: Mon Nov 11 16:33:17 2019]
- CM.make "A.cm" ;
[autoloading]
[library $smlnj/cm/cm.cm is stable]
[library $smlnj/internal/cm-sig-lib.cm is stable]
[library $/pgraph.cm is stable]
[library $smlnj/internal/srcpath-lib.cm is stable]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable]
[autoloading done]
[scanning A.cm]
[library $smlnj/compiler/compiler.cm is stable]
[library $smlnj/compiler/current.cm is stable]
[library $smlnj/compiler/amd64.cm is stable]
[library $smlnj/viscomp/basics.cm is stable]
[library $smlnj/viscomp/amd64.cm is stable]
[library $smlnj/viscomp/core.cm is stable]
[library $smlnj/MLRISC/MLRISC.cm is stable]
[library $SMLNJ-MLRISC/MLRISC.cm is stable]
[library $smlnj-lib.cm(=$SMLNJ-LIB/Util)/smlnj-lib.cm is stable]
[library $Graphs.cm(=$SMLNJ-MLRISC)/Graphs.cm is stable]
[library $Lib.cm(=$SMLNJ-MLRISC)/Lib.cm is stable]
[library $compiler/(core.cm):MiscUtil/const-arith/sources.cm is stable]
[library $smlnj/smlnj-lib/pp-lib.cm is stable]
[library $SMLNJ-LIB/PP/pp-lib.cm is stable]
[library $html-lib.cm(=$SMLNJ-LIB/HTML)/html-lib.cm is stable]
[library $smlnj/MLRISC/Lib.cm is stable]
[library $smlnj/viscomp/debugprof.cm is stable]
[library $smlnj/viscomp/elabdata.cm is stable]
[library $smlnj/viscomp/execute.cm is stable]
[library $smlnj/viscomp/parser.cm is stable]
[library $smlnj/viscomp/elaborate.cm is stable]
[library $smlnj/MLRISC/AMD64.cm is stable]
[library $SMLNJ-MLRISC/AMD64.cm is stable]
Error: Compiler bug: UnpickMod: stub lookup failed for environment in $SMLNJ-MLRISC/AMD64.cm@499290(../amd64/c-calls/amd64-svid.sml): m = (6, functor AMD64SVID_CCalls), i = <moduleId>

-

Expected Behavior

No response

Steps to Reproduce

(* A.cm *)

Library
structure A
is
a.sml

$smlnj/compiler/compiler.cm

(* a.sml *)

structure A =
struct

fun f() =
let
val tb = ref("")
in
(
Compiler.Control.Print.out := {
say=fn s => tb := concat [!tb, s],
flush=fn() => ()
} ;
()
)
end

end

Additional Information

No response

Email address

ndanner@wesleyan.edu

Comments from smlnj-gforge

Original smlnj-gforge bug number 232

Submitted via web form by Norman Danner ndanner@wesleyan.edu on 2019-09-11 at 22:0900

Keywords: 64 bit, Compiler.Control.Print.out

comment by @JohnReppy on 2019-40-12 16:4000 +000 UTC

This is probably some issue in the MLRISC CM files (which are a bit of a mess).

comment by @JohnReppy on 2019-31-16 14:3100 +000 UTC

Switching the the "new-style" visible compiler ($smlnj/compiler.cm) and Control.Print.out is a work around for the problem.

@JohnReppy JohnReppy added bug Something isn't working compiler problem with compiler gforge bug (or feature request) ported from smlnj-gforge repository labels Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler problem with compiler gforge bug (or feature request) ported from smlnj-gforge repository
Projects
None yet
Development

No branches or pull requests

2 participants