Skip to content

SML/NJ 110.99.6.1 library upgrade causes Ur/Web miscompilation #618

@bbarenblat

Description

@bbarenblat

Compiling @achlipala’s Ur/Web with MLton 20241230 produces an urweb binary that infinite-loops while compiling a trivial program:

$ cat trial.ur
val main : transaction page = return <xml><body>hi</body></xml>
$ cat trial.urp
$/string
trial
$ urweb -version
The Ur/Web compiler, version 20200209 + 55a881ff9b50d9e5c3b2fd564f5cd44a5cc5e6bc
$ urweb -verbose trial
Starting parseJob....
Finished parseJob.
Starting parse....
Finished parse.
Starting elaborate....
CHECK: Folder
CHECK: String
CHECK: Trial
Finished elaborate.
Starting unnest....
Finished unnest.
Starting explify....
Finished explify.
Starting corify....
Finished corify.
Starting core_untangle....
[never terminates]

The $/string load in trial.urp is important; without it, urweb quickly and correctly compiles the program.

MLton 20210107 works fine, so I bisected between the two releases. git-bisect reports 88b75e5 as the culprit:

88b75e5ee35292077f8c549cb3c210e23a47d771 is the first bad commit
commit 88b75e5ee35292077f8c549cb3c210e23a47d771
Author: Matthew Fluet <matthew.fluet@gmail.com>
Date:   Sat Dec 14 15:29:31 2024 -0500
 
    Update to SML/NJ 110.99.6.1 libraries
 
 CHANGELOG.adoc                   |    3 +
 doc/guide/src/CKitLibrary.adoc   |    4 +-
 doc/guide/src/MLLPTLibrary.adoc  |    4 +-
 doc/guide/src/MLRISCLibrary.adoc |    4 +-
 doc/guide/src/SMLNJLibrary.adoc  |   11 +-
 lib/ckit-lib/ckit.tgz            |  Bin 200785 -> 200761 bytes
 lib/mllpt-lib/ml-lpt.tgz         |  Bin 267067 -> 267376 bytes
 lib/mlrisc-lib/MLRISC.tgz        |  Bin 1457337 -> 1457420 bytes
 lib/smlnj-lib/smlnj-lib.patch    | 2676 +++++++++++++++++++++++++-------------
 lib/smlnj-lib/smlnj-lib.tgz      |  Bin 641512 -> 666400 bytes
 10 files changed, 1820 insertions(+), 882 deletions(-)
bisect found first bad commit

I haven’t dug any further into this, but I wanted to go ahead and report it here in case there’s something in MLton’s library patch that is not playing well with Ur/Web. @MatthewFluet, how is lib/smlnj-lib/smlnj-lib.patch generated?

(I have not yet tried compiling Ur/Web with SML/NJ to see if non-termination manifests there too; that’s probably the right next step.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions