Home My Page Projects Code Snippets Project Openings SML/NJ Bugs
Summary Activity Tracker Lists

[#219] "use" fails silently when a function inside a structure raises an exception

Date:
2019-03-20 01:01
Priority:
3
State:
Closed
Submitted by:
Bug Submitter (webuser)
Assigned to:
John Reppy (jhr)
Machine Architecture:
x86
Operating System:
Linux
Component:
Compiler
Resolution:
Fixed
Severity:
Minor
OS Version:
4.19.28-1
SML/NJ Version:
110.85
Keywords:
modules
URL:
Transcript (of reproduction):
Standard ML of New Jersey v110.85 [built: Thu Dec 27 20:00:48 2018] - use "test.sml"; [opening test.sml] [autoloading] [library $SMLNJ-BASIS/basis.cm is stable] [library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable] [autoloading done] val it = () : unit -
Source (for reproduction):
structure ConstantQueue = struct type 'a queue = 'a list * 'a list val empty : 'a queue = ([], []) fun enqueue ((l, r): 'a queue) (v: 'a): 'a queue = (v::l, r) exception Empty fun dequeue (([], []): 'a queue): 'a * 'a queue = raise Empty | dequeue (l, r::rs) = (r, (l, rs)) | dequeue (l, []) = dequeue ([], List.rev l) end structure CQ = ConstantQueue val _ = CQ.dequeue CQ.empty
Summary:
"use" fails silently when a function inside a structure raises an exception

Detailed description
SML/NJ REPL fails to report error when loading a file that raises an exception

More specifically, this is experienced with a function raising an exception within a structure.

On v110.81, the REPL correctly outputs:

uncaught exception Empty
raised at: test.sml:7.59-7.64
/usr/local/bin/sml: Fatal error -- Uncaught exception Empty with 0
raised at test.sml:7.59-7.64

while on v110.85, it fails silently, outputting

val it = () : unit
Additional comments:
Likely a regression from an older version.

Submitted via web form by Yuanchu Xie <yuanchux@andrew.cmu.edu>

Comments:

Message  ↓
Date: 2019-04-23 12:33
Sender: John Reppy

Fixed in 110.86

Attached Files:

Changes

Field Old Value Date By
status_idOpen2019-04-23 12:33jhr
close_dateNone2019-04-23 12:33jhr
assigned_tonone2019-04-23 12:33jhr
summaryFails silently when a function inside a structure raises an exception2019-04-23 12:33jhr
detailsSML/NJ REPL fails to report error when loading a file that raises an exception More specifically, this is experienced with a function raising an exception within a structure. On v110.81, the REPL correctly outputs: uncaught exception Empty raised at: test.sml:7.59-7.64 /usr/local/bin/sml: Fatal error -- Uncaught exception Empty with 0 raised at test.sml:7.59-7.64 while on v110.85, it fails silently, outputting val it = () : unit Additional comments: Likely a regression from an older version. Submitted via web form by Yuanchu Xie <yuanchux@andrew.cmu.edu> 2019-04-23 12:33jhr
ResolutionNone2019-04-23 12:33jhr
Transcript (of reproduction)Standard ML of New Jersey v110.85 [built: Thu Dec 27 20:00:48 2018] - use "test.sml"; [opening test.sml] [autoloading] [library $SMLNJ-BASIS/basis.cm is stable] [library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable] [autoloading done] val it = () : unit - 2019-04-23 12:33jhr
Source (for reproduction)structure ConstantQueue = struct type 'a queue = 'a list * 'a list val empty : 'a queue = ([], []) fun enqueue ((l, r): 'a queue) (v: 'a): 'a queue = (v::l, r) exception Empty fun dequeue (([], []): 'a queue): 'a * 'a queue = raise Empty | dequeue (l, r::rs) = (r, (l, rs)) | dequeue (l, []) = dequeue ([], List.rev l) end structure CQ = ConstantQueue val _ = CQ.dequeue CQ.empty 2019-04-23 12:33jhr