Number: 201 Title: funny tycon aliasing behavior Keywords: types, modules Submitter: John Reppy Date: 8/18/89 Version: 0.33 Transcript Standard ML of New Jersey, Version 0.33, 1 April 1989 val it = () : unit - structure A = struct datatype foo = Bar of int end = ; structure A : sig datatype foo con Bar : int -> foo end - structure B : sig datatype foo' = Bar of int end = struct = open A = type foo' = foo = end; structure B : sig datatype foo' con Bar : int -> A.foo end Status: fixed in 0.56 -------------------------------------------------------------------------------- Number: 202 Title: type error not caught? Keywords: modules, functors, type checking Submitter: Norman Ramsey Date: 8/28/89 Version: ? Problem: I believe that the following file should generate a type error, but it doesn't. In particular, the line val _ = begin_str "replicas" ufanout(c,chans) should force chans to be type 'a chan list when c is type 'a chan. Code: datatype 'a chan = CHAN of 'a signature BADGUYS = sig val mkchan : unit -> '1a chan val ufanout : '2a chan * '2a chan list -> 'b val begin_str : string -> ('a -> 'b) -> 'a -> unit end signature WONKY = sig val ureplicas : int -> '2a chan -> '6b chan list (* wrong! should be int -> '2a chan -> '2a chan list *) end functor buggy(bad:BADGUYS):WONKY = struct open bad fun ureplicas n c = (* n unsynchronized copies of channel c *) let fun channels(l,0) = l | channels(l,n) = channels(mkchan()::l,n-1) val chans = channels(nil,n) val _ = begin_str "replicas" ufanout(c,chans) in chans end end Transcript: (0.52) - use "code/bug.202"; [opening code/bug.202] code/bug.202:16.36-28.3 Error: value type in structure doesn't match signature spec name: ureplicas spec: int -> '2a chan -> '6b chan list actual: int -> '1a chan -> '6b chan list Status: fixed in 0.56 -------------------------------------------------------------------------------- Number: 203 Title: printing of infix specs in signatures Keywords: modules, signatures, printing Submitter: Trevor Jim Date: 4/3/89 Version: 0.32, 0.52 Problem: infix specs are printed with two precedence numbers Transcript: - signature SS = sig infix 5 bar end; signature SS = sig infix 10 10 bar end Status: fixed in 0.54 -------------------------------------------------------------------------------- Number: 204 Title: constructors printed when not accessible Keywords: modules, signatures, printing Submitter: Dave Berry Date: 2/2/89 Version: 0.52 Problem: constructors of a datatype in a structure are printed in the structure signature even though they are masked out by a signature constraint. Transcript: - signature S1 = sig type d end; signature S1 = sig type d end - structure A : S1 = struct datatype d = A | B of int end; structure A : sig datatype d con A : d con B : int -> d end Status: fixed in 0.56 -------------------------------------------------------------------------------- Number: 205 Title: performance problem with many opens in a structure Keywords: modules, top level, open Submitter: Jawahar Malhotra Date: 3/15/90 Version: 0.56 Problem: many opens Code: structure A = struct (* 30 val declarations *) end structure B,C,D... similar structure S = struct open A B C D E F G end Status: fixed in 0.58 ------------------------------------------------------------------------------ Number: 206 Title: unhelpful parser error message (new parser) Keywords: Submitter: Dave Date: 3/15/90 Version: 0.52 Transcript: - structure A = struct val x = if true then if true then 1 else 2 end; std_in:4.1 Error: syntax error found at END - Comment: what we need is %prefer ELSE 0, that is, the ability to give a hint for the insertion of two tokens in a row. Right now, %prefer can only hint about single-token insertions. This fix has to be done in mlyacc. Fix: multitoken inserts Status: fixed in 1.03f ------------------------------------------------------------------------------- Number: 207 Title: uncaught tycStamp exception Keywords: types, modules, signatures, functors Submitter: Nevin.Heintze@PROOF.ERGO.CS.CMU.EDU Date: 4/3/90 Version: 0.44 (0.53) Problem: tycStamp raised during compilation Code: (file bug207.sml) signature SS = sig datatype t = B of t | A of t list end functor F(X:SS) = struct fun f(X.B(v)) = (v :: nil = v :: nil) | f _ = false end Transcript: Standard ML of New Jersey, Version 0.44, 4 December 1989 val it = () : unit - use "bug.sml"; [opening bug.sml] bug.sml, line 11: Error: Compiler bug: tycStamp equal: type = ?.ttt list [closing bug.sml] - Comments: The problem appears to be the typing of the equality test. It is sensitive to the use of lists, both in the datatype definition and the equality test. Status: fixed in 0.56 ------------------------------------------------------------------------------- Number: 208 Title: bug in optimizer causing bad free variable Keywords: Submitter: Appel & MacQueen Date: 4/27/90 Version: 0.56 Problem: impossible error in cpsopt phase, on MIPS machine, with default optimization settings Code: functor MipsCoder(val emit : 'a -> unit) = struct fun needs _ = true fun pass now = let fun gen inst = if now andalso needs() then () else if now then let fun gen1() = gen(raise Match) in case inst of NONE => gen1() | SOME b => let fun bc1f offset = () fun bc1t offset = () in if inst=NONE then (emit((if b then bc1t else bc1f) inst); gen1()) else () end end else () in gen end val assemble = pass true end Comment: this can be avoided by setting closurestrategy to 2, which we now do; Trevor may fix this bug eventually. Status: fixed in 0.60 (avoided) ------------------------------------------------------------------------------- Number: 209 Title: equality types and functors, again Keywords: modules, functors, equality Submitter: Appel & MacQueen Date: 4/30/90 Version: 0.56 Problem: Problem in eqtypes/defineEqTycon/eqty. failure when attempting to reevaluate equality properties of generative/defined tycons in functor body after functor is applied. Code: signature S1 = sig type t end; structure A = struct type t = int end; functor F(X : S1) = struct structure B = struct datatype s1 = K of X.t end type s = B.s1 end; structure C = F(A); Comments: we've put in a warning message, and assumed a non-equality type when this happens. (still causes impossible error in 0.56). Fix: "fixed" by following the lead of the Definition and not recalculating equality properties on functor applications. Status: fixed in 0.66 -------------------------------------------------------------------------------- Number: 210 Title: sharing checking with fixed stamps Keywords: modules, signatures, sharing Submitter: Appel & MacQueen Date: 5/3/90 Version: 0.56 Problem: Union exception is not caught when sharing specs try to identify two distinct types or structures (with differing fixed stamps). Code: structure S = struct end; structure T = struct end; signature Q = sig sharing S=T end; Comments: Easy to fix. Just add a handler for the Union exception in Sharing.doSharing and produce and appropriate error message. Status: fixed in 0.57 -------------------------------------------------------------------------------- Number: 211 Title: Union exception processing correct sharing in functor body Keywords: modules, functors, sharing Submitter: MacQueen Date: 5/4/90 Version: 0.56 Problem: Union exception is raised in doSharing when processing correct sharing specs in a functor body. Code: (* bug211.sml *) functor F(type t) = struct structure K = struct type s = t end structure M : sig structure L : sig type s sharing type s = t end sharing L=K end = struct structure L = K end end; Comments: The bug occurs because the type definition shortcut (for "type s = t", s is made a copy (modulo path) of t) is not done when t has a bound stamp, as in the code above. Here s is a DEFtyc tycon with a different stamp from t. Status: fixed in 0.58 -------------------------------------------------------------------------------- Number: 212 Title: polymorphic exception declarations Keywords: exceptions, polymorphism Submitter: Dave Berry (for Jo Blishen) (submitted to ml-bugs) Date: 5/11/90 Version: 0.56 Severity: major Problem: rejects proper weak polymorphic type for locally declared exception Code: fun f (l:'_a) = let exception E of '_a in (raise (E l)) handle E t => t end; Comments: Worked in 0.44a. Status: fixed in 0.58 (suspect related bugs because of the way TyvarSet.union_tyvars is defined.) -------------------------------------------------------------------------------- Number: 213 Title: equality on int*int Keywords: equality Submitter: Soren Christensen, University of Aarhus, Computer Science Dep., Denmark schristensen@daimi.dk Date: 5/16/90 Version: 0.56 System: Sun4/280 / SunOS 4.0.1 Severity: Critical Problem: failure compiling equality on type int*int Code: (* filename: bug213.sml *) (3,3,) = (3,3); Transcript: Standard ML of New Jersey, Version 0.56, 13 April 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - use "fun"; [opening fun] datatype 'a $$$ con $ : 'a -> 'a $$$ con $$ : 'a $$$ LOOKUP FAILS in close(FIX 2795 2799 2707 2996 ) on 2927 in environment: 2792 2790 2791 [closing fun] uncaught exception Match - val x = 5; Illegal instruction Comments: [Christensen] It looks like the compiler is messed up after this error. It core-dumps parsing the next declaration. Version 0.44 has no problem handling this declaration. [dbm] The code "(3,3) = (3,3);" reproduces the bug. Haven't been able to reproduce the core dump. Status: fixed in 0.58 (bug was in codegen) -------------------------------------------------------------------------------- Number: 214 Title: Compiler bug: EnvAccess.lookPath when printing Keywords: modules, functors, printing Submitter: Frank Pfenning (Frank.Pfenning@proof.ergo.cs.cmu.edu Date: 5/17/90 Version: 0.56 Severity: critical Problem: Compiler bug: EnvAccess.lookPath occurs when printing a top-level result. Code: signature TERM = sig datatype term = Const of string and varbind = Varbind of string * term end functor Term ( ) : TERM = struct datatype term = Const of string and varbind = Varbind of string * term end signature BUG = sig structure Term : TERM type progentry val bug : progentry list end functor Bug ( structure Term : TERM ) : BUG = struct structure Term = Term open Term datatype progentry = Progentry of string * Term.term * Term.varbind list * Term.term val bug = [Progentry("test",Const "test", [Varbind("v",Const("test"))],Const("test"))] end structure Term : TERM = Term (); structure Bug : BUG = Bug ( structure Term = Term ); Bug.bug; Status: fixed in 0.58 -------------------------------------------------------------------------------- Number: 215 Title: sin gives incorrect values Keywords: Submitter: Thomas M. Breuel (tmb@ai.mit.edu) Date: 5/18/90 Version: 0.59 System: SPARC/SunOS 4.0.3c Severity: major Problem: sin function is incorrect Transcript: (* SparcStation 1, SunOS 4.0 *) Standard ML of New Jersey, Version 0.56, 13 April 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - sin(4.0); val it = ~0.756802495307928 : real - sin(5.0); val it = ~0.958924274663138 : real - sin(6.0); val it = 0.279415498198926 : real - (* ^^^^^^^^^^^^^^^^^ this should be negative, since it is between pi and 2 pi *) Comments: Probably someone transcribed the sin function from the Berkeley math library incorrectly in boot/math.sml. Status: fixed in 0.58 (Appel) -------------------------------------------------------------------------------- Number: 216 Title: floating point on SPARC Keywords: Submitter: tmb@ai.mit.edu Date: 19/5/90 Version: 0.56 System: Sun SS1, Sun OS 4.0.3 Severity: critical Problem: floating point broken in Sparc compiler?! Transcript: (everything that begins with a TAB comes from an actual transcript) Standard ML of New Jersey, Version 0.56, 13 April 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - fun ilist(from:int,to:int,step:int) = f = if (from (int -> 'a) -> 'a list - ilist(0,10,1) (fn x => x); val it = [0,1,2,3,4,5,6,7,8,9] : int list - ilist(0,10,1) print; 0123456789val it = [(),(),(),(),(),(),(),(),(),()] : (unit) list all is as it should be--so far - fun rlist(from:real,to:real,step:real) f = = if (from (real -> 'a) -> 'a list this is the same definition with different type constraints - rlist(0.0,10.0,1.0) (fn x => x); val it = [] : real list ??? - rlist(0.0,10.0,1.0) (fn x => x); val it = [0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0] : real list same expression, different result??? - rlist(0.0,10.0,1.0) (fn x => x); val it = [0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0] : real list now it seems to work... - rlist(0.0,10.0,1.0) print; 0.0val it = [()] : (unit) list but it still doesn't work with "print" - rlist(0.0,10.0,1.0) (fn x => x); val it = [0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0] : real list - Comments: These problems don't occur on the m68 version of SML. In fact, the problem with "sin" that I reported previously also doesn't occur with the m68 version. Maybe this is an installation problem, but if it is, then there is probably something wrong with the makeml script. The Sparc version was generated with "makeml -sun4 -sunos" if I remember correctly. Here is the transcript from a Sun-3: Standard ML of New Jersey, Version 0.56, 13 April 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - [opening /tmp_mnt/home/vi/tmb/cad/bad.sml] val identity = fn : 'a -> 'a val ilist = fn : int * int * int -> (int -> 'a) -> 'a list val rlist = fn : real * real * real -> (real -> 'a) -> 'a list [closing /tmp_mnt/home/vi/tmb/cad/bad.sml] val it = () : unit these are the same definitions as above - ilist(0,10,1) (fn x => x); val it = [0,1,2,3,4,5,6,7,8,9] : int list - ilist(0,10,1) print; 0123456789val it = [(),(),(),(),(),(),(),(),(),()] : (unit) list - rlist(0.0,10.0,1.0) (fn x => x); val it = [0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0] : real list - rlist(0.0,10.0,1.0) print; 0.01.02.03.04.05.06.07.08.09.0val it = [(),(),(),(),(),(),(),(),(),()] : (unit) list - sin 6.0; val it = ~0.279415498198926 : real - sin 5.0; val it = ~0.958924274663138 : real - Status: fixed in 0.58 (Reppy) -------------------------------------------------------------------------------- Number: 217 Title: simultaneous opens Keywords: Submitter: Larry Paulson (lcp@lfcs.ed.ac.uk) Date: 5/25/90 Version: 0.56 Severity: major Problem: opening several structures simultaneously can result in Runbind Code: code/bug217.sml structure A = struct val x = 3 end; structure B = struct structure A = A; end; open A B; x; Comments: This works if "open A B;" is replaced with "open A; open B;" Status: fixed in 0.59 -------------------------------------------------------------------------------- Number: 218 Title: compiler bug after unbound variable Keywords: types, type checking Submitter: John Reppy (jhr@cs.cornell.edu) Date: 5/26/90 Version: 0.57 Severity: major Problem: Compiler bug: generalizeTy -- bad arg occurs after top level unbound var Transcript: - x; std_in:2.1 Error: unbound variable x Error: Compiler bug: generalizeTy -- bad arg Status: fixed in 0.59 -------------------------------------------------------------------------------- Number: 219 Title: parsing layered patterns Keywords: Submitter: Andrew Appel Date: 5/1/90 Version: 0.56 and later Severity: minor Problem: parsing of layered pattern is too liberal. An atomic pattern is accepted where a variable is required by the Definition syntax. Code: let val (x) as (y :: z) = [1,2] in x end Comments: Seems to require nontrivial change to the mlyacc grammar Status: fixed in 1.04 (actually 1.03f) -------------------------------------------------------------------------------- Number: 220 Title: Match exception after error Keywords: modules, signatures, signature matching Submitter: John Reppy Date: 6/1/90 Version: 0.58 System: Sun 4 Severity: minor Problem: uncaught exception Match after signature matching error Code: signature S = sig type foo val f : int -> foo end structure Foo : S = struct datatype foo_t = Foo of int val f = Foo end Transcript: xxx.sml:6.21-9.3 Error: unmatched type spec: foo xxx.sml:6.21-9.3 Error: value type in structure doesn't match signature spec name: f spec: int -> [closing xxx.sml] uncaught exception Match - Comment: Now produces std_in:10.21-13.3 Error: unmatched type spec: foo std_in:10.21-13.3 Error: value type in structure doesn't match signature spec name: f spec: int -> NULLtyc actual: int -> foo_t The NULLtyc is undesirable. Status: fixed in 0.65 -------------------------------------------------------------------------------- Number: 221 Title: profiling broken Keywords: profiling Submitter: Benjamin Pierce (Benjamin.Pierce%proof.ergo.cs.cmu.edu Date: 5/22/90 System: 0.56 (and later) Problem: Profiling provides call counts bug not timings. For separately compiled modules, profiling provides neither call counts nor timings. Transcript: (1) for separately compiled code %time cumsecs #call ms/call name .00 0 (toplevel) .00 0 (gc) .00 0 (unprofiled) (2) for "used" code %time cumsecs #call ms/call name .00 2398 .0000 anon.AType.==.anon .00 2398 .0000 anon.AType.== .00 2051 .0000 anon.Id.==.anon .00 2051 .0000 anon.Id.== .00 1890 .0000 anon.AType.apply_rule.anon [etc...] Fix: Some of the problems may be caused by handleprof() in runtime/signal.c being braindamaged. I changed it to be: SIGH_RET_TYPE handleprof () { extern ML_val_t current0[]; ML_val_t cur_barray = current0[1]; cur_barray[1] = (unsigned int)INT_incr(cur_barray[1],1); } and it seemed to work for simple examples. However, I'm not too sure that the times mean anything for larger examples. Perhaps there's some bad interaction with GC? Status: fixed in 0.70 -------------------------------------------------------------------------------- Number: 222 Title: equality on ref types Keywords: equality Submitter: Larry Paulson Date: 11/6/90 Version: 0.56, 0.59 Severity: major Problem: ref type not being recognized as unconditionally an equality type Transcript: - fun silly x = (ref x = ref x); val silly = fn : ''1a -> bool - silly not; std_in:4.1-4.9 Error: operator and operand don't agree (equality type required) operator domain: ''0S operand: bool -> bool in expression: silly not And anyway the type checker behaves inconsistently by admitting the following: - ref not = ref not; val it = false : bool Status: fixed in 0.65 --- before -------------------------------------------------------------------------------- Number: 223 Title: nontty standard input and uncaught exceptions Keywords: Submitter: KINOSHITA Yoshiki yoshiki@etl.go.jp Date: 6/4/90 Version: SML of NJ 0.56 System: Sparc Station 330 (SUN4), SUN-OS 4.0.3 (generic version) Severity: major Problem: If the standard input is a pipe, the system ends abnormally after it sends an error message. Code: None. The problem concerns with the interface to UNIX. Transcript: % cat - | sml Standard ML of New Jersey, Version 0.56, 13 April 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - foo; std_in:2.1-2.3 Error: unbound variable foo uncaught exception Stop ^Z Stopped % jobs [1] + Stopped cat - | Done sml % Comments: This problem makes it impossible to use the system with its input sent through a UNIX filter. from jhr: You might call this a feature. It appears that the person who wrote the top-level loop code (interact.sml), decided that exceptions should only be caught at the top-level loop when std_in is a tty (look at lines 292-309 in interact.sml). The following work-around avoids the problem cat - | sml Standard ML of New Jersey, Version 0.59, 4 June 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - set_term_in(std_in, true); val it = () : unit - foo; std_in:3.1-3.3 Error: unbound variable foo - 1+2; val it = 3 : int - But, maybe the code should change. It isn't clear to me what the correct semantics are in this case. This problem came up here at Cornell when Bill Aitken was using "rsh" to run sml on a remote machine. Status: fixed in 0.65 -------------------------------------------------------------------------------- Number: 224 Title: weakness 0 type variables in let declaration Keywords: types, type checking, weak types Submitter: Larry Paulson Date: 6/4/90 Version: 0.56, 0.59 Severity: major Problem: A weakness 0 type variable should be admitted, but not generalized, in local declarations. Transcript: - let val f = ref(fn x => x) in f := not; !f true end; std_in:1.9-1.26 Error: nongeneric weak type variable f : ('0Y -> '0Y) ref std_in:1.9-1.26 Error: nongeneric weak type variable f : ('0Y -> '0Y) ref Comments: This worked in 0.44. Status: fixed in 0.65 --- (before) -------------------------------------------------------------------------------- Number: 225 Title: import broken in 0.59 Keywords: Submitter: Lars Bo Nielsen Date: 6/5/90 Version: Version 0.59 System: Sparc/sunos Severity: critical Problem: import broken. A simple 'import "file"' doesn't work, if only 'file.sml' is present. If 'file.bin' is present it works. I DIDN'T have this problem with version 0.56. Transcript: The following example shows the problem. SHELL% ll total 68 2 calc.dsl 11 calc.grm.sml 31 calc.parser.sml 3 calc.grm 1 calc.instr 2 calc.sml 4 calc.grm.desc 2 calc.lex 1 calc.grm.sig 11 calc.lex.sml SHELL% sml Standard ML of New Jersey, Version 0.59, 4 June 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - import "calc.parser"; uncaught exception SystemCall - ^Z Stopped SHELL% touch calc.parser.bin SHELL% fg sml - import "calc.parser"; [reading calc.parser.bin... ] [calc.parser.bin is the wrong format; recompiling [closing calc.parser.bin] [reading calc.parser.sml] [Major collection... 69% used (1475096/2123360), 1700 msec] [Increasing heap to 4451k] ..... etc ..... Status: fixed in 0.60 (jhr) -------------------------------------------------------------------------------- Number: 226 Title: uncaught exception Match while printing type (same as 220) Keywords: modules, types, printing Submitter: John Reppy Date: 6/1/90 Version: 0.56 Severity: major Problem: Uncaught Match exception occurs when printing out the spec type in an error message. Code: signature S = sig type foo val f : int -> foo end structure Foo : S = struct datatype foo_t = Foo of int val f = Foo end Transcript: xxx.sml:6.21-9.3 Error: unmatched type spec: foo xxx.sml:6.21-9.3 Error: value type in structure doesn't match signature spec name: f spec: int -> [closing xxx.sml] uncaught exception Match - Status: fixed in 0.65 --- partially fixed (before 0.65) -------------------------------------------------------------------------------- Number: 227 Title: equality property of datatypes Keywords: types, datatypes, equality Submitter: Brian Boutel (brian@comp.vuw.ac.nz) Date: 5/25/90 Version: 0.56 System: Sun3/sunos and H-P workstation (More/bsd) Severity: major Problem: Equality test for recursive types may fail in various ways (similar to bug 45, reported fixed) Description: Given datatype 'a d1 = c11 | c12 of ('a * 'a d1); datatype 'a d2 = c21 | c22 of ('a d2 * 'a ); datatype d3 = c31 | c32 of ( d3 * int); a) c11 = c11 works correctly b) c12(1,c11) = c12(1,c11) gets uncaught exception Match (* ok in 0.59 *) c) c21 = c21 loops forever (* in 0.59 as well *) d) c22(c21,1) = c22(c21,1) gets uncaught exception Match (* ok in 0.59 *) e) c31 = c31 works correctly f) c32(c31,1) = c32(c31,1) gets uncaught exception Match (* ok in 0.59 *) Transcript: (with System.Control.debugging := true) b) - c12(1,c11) = c12(1,c11); parse semantics BEFORE: val it = = (c12 (1,c11),c12 (1,c11)) AFTER: val it = = (c12 (1,c11),c12 (1,c11)) test: int d1 test: int d1 find: int d1 find-notfound enter: int d1 test: int * int d1 find: int * int d1 find-notfound enter: int * int d1 test: int test: int test: int d1 find: int d1 translate reorder convert cpsopt closure LOOKUP FAILS in close(FIX 4146 4150 ) on 4161 in environment: 4143 4141 4142 globalfix spill codegen uncaught exception Match - c) - c21 = c21; parse semantics BEFORE: val it = = (c21,c21) AFTER: val it = = (c21,c21) test: ''S d2 test: ''S d2 find: ''S d2 find-notfound enter: ''S d2 test: ''S d2 * ''S find: ''S d2 * ''S find-notfound enter: ''S d2 * ''S test: ''S d2 find: ''S d2 find-notfound enter: ''S d2 test: ''S d2 * ''S find: ''S d2 * ''S find-notfound enter: ''S d2 * ''S test: ''S d2 find: ''S d2 find-notfound ..... Status: fixed in 0.60 -------------------------------------------------------------------------------- Number: 228 Title: string to real conversion Keywords: Submitter: jubu@tub.UUCP or jubu@tub.BITNET (Juergen Buntrock TUB) Date: 27/4/90 Version: 0.44 System: Sun4, SunOS Release 4.0.3c Severity: critical Code: and Transcript: Script started on Fri Apr 27 13:49:54 1990 jubu@curry mlj/handel 1) cat bug.sml exception bad_number; fun string2real (s : string) = let val (fac,li) = case explode s of "-" :: li => (~1.0,li) | "+" :: li => (1.0,li) | li => (1.0,li) val (res,_) = (revfold (fn (c,(a,fac1)) => let val n = ord c - ord "0" in output std_out ""; (* comiler bug ! *) if fac1 > 0.0 then if n < 0 orelse n > 9 then raise bad_number else (a + fac1 * (real n),fac1/10.0) else if c = "." then (a,1.0/10.0) else if n < 0 orelse n > 9 then raise bad_number else (10.0 * a + (real n),0.0) end) li (0.0,0.0)) in res * fac end fun string2real_bug (s : string) = let val (fac,li) = case explode s of "-" :: li => (~1.0,li) | "+" :: li => (1.0,li) | li => (1.0,li) val (res,_) = (revfold (fn (c,(a,fac1)) => let val n = ord c - ord "0" in if fac1 > 0.0 then if n < 0 orelse n > 9 then raise bad_number else (a + fac1 * (real n),fac1/10.0) else if c = "." then (a,1.0/10.0) else if n < 0 orelse n > 9 then raise bad_number else (10.0 * a + (real n),0.0) end) li (0.0,0.0)) in res * fac end jubu@curry mlj/handel 2) sml Standard ML of New Jersey, Version 0.44, 4 December 1989 val it = () : unit - use"bug.sml"; [opening bug.sml] exception bad_number val string2real = fn : string -> real val string2real_bug = fn : string -> real [closing bug.sml] val it = () : unit - string2real "123.456"; val it = 123.456 : real - string2real_bug "123.456"; val it = 12346.0 : real - open System.Control.CG; structure M68 : sig val trapv : bool ref end val reducemore = ref 15 : int ref val printit = ref false : bool ref val knowngen = ref 12 : int ref val etasplit = ref true : bool ref val comment = ref false : bool ref val knowncl = ref 0 : int ref val scheduling = ref true : bool ref val printsize = ref false : bool ref val reduce = ref true : bool ref val closureprint = ref false : bool ref val stdgen = ref 64 : int ref val alphac = ref true : bool ref val profile = ref false : bool ref val hoist = ref true : bool ref val foldconst = ref true : bool ref val tailrecur = ref true : bool ref val path = ref false : bool ref val rounds = ref 1 : int ref val closureStrategy = ref 1 : int ref val recordopt = ref true : bool ref val bodysize = ref 0 : int ref val tail = ref true : bool ref - script done on Fri Apr 27 13:55:57 1990 Comments: the Sun3 Compiler is correct Status: fixed in 0.56 -------------------------------------------------------------------------------- Number: 229 Title: uncaught Match after signature spec error Keywords: modules, signatures, signature matching Submitter: Peter Buneman Date: 4/21/89 Version: 0.59 Severity: major Problem: Following code produces uncaught Match exception Code: signature SS = sig type t1 val t2:t1 end; structure ss:SS = struct local datatype t = T of int in val t2 = T 3 end end; Comment: Output in 0.65 is std_in:8.1-12.3 Error: unmatched type spec: t1 std_in:8.1-12.3 Error: value type in structure doesn't match signature spec name: t2 spec: NULLtyc actual: ?.ss.t NULLtyc for spec is undesirable (similar to 220,226 problem). Status: fixed in 0.65 --- partially fixed (before 0.65) -------------------------------------------------------------------------------- Number: 230 Title: printing reals on mips Keywords: Submitter: David MacQueen, Andrew Tolmach Date: 6/12/90 Version: 0.59 System: MIPS, RISCos Severity: critical Problem: Uncaught exception Overflow when printing real numbers at top level. Infinite loop in other cases (e.g. code/bug230.sml). Transcript: - 1.0; val it = uncaught exception Overflow - Comment: works ok on Sun3 and Sun4. works ok on DECsystem (with MIPS chip) / Ultrix Status: fixed in 0.64 -------------------------------------------------------------------------------- Number: 231 Title: equality property of DEFtyc Keywords: types, equality Submitter: Nick Rothwell Date: 6/21/90 Version: 0.56? Severity: major Problem: A type abbreviation for an abstract type admits equality. Code: abstype A = A with type B = A end; fn (x: B) => (x=x); Comments: The type name associated with A (and therefore with B) should be stripped of its equality attribute outside the "abstype". Status: fixed in 0.69 -------------------------------------------------------------------------------- Number: 232 Title: user bound type variable in exception declaration Keywords: types, type variables, exceptions Submitter: Jo Blishen, Nick Rothwell Date: 6/20/90 Version: 0.59 Severity: minor Problem: User-bound tyvar is not generalized at val binding containing it. Transcript: - fun f l = let exception E of '_a in (raise (E l)) handle E t => t end; std_in:2.30-2.32 Error: unbound tyvars in exception declaration Comments: According to the Definition '_a should be considered bound at the outermost val (fun f l ...) where it is the type of the lambda-bound variable l. Status: fixed in 0.65 -------------------------------------------------------------------------------- Number: 233 Title: opening locally declared structure causes Runbind Keywords: modules, open, dynamic env Submitter: Richard O'Neill (cmp7130%sys.uea.ac.uk@nsfnet-relay.ac.uk) Date: 6/20/90 Version: 0.56 (applies to 0.59 as well I believe) System: Sun3, SunOS 4.1 Severity: You decide.... Problem: You cannot declare a local structure and open it. Transcript: Standard ML of New Jersey, Version 0.56, 13 April 1990 val it = () : unit - local = structure Bug = = struct = val message = "Try to evaluate me !" = end = in = open Bug = end ; open Bug - message; uncaught exception Runbind - Status: fixed in 0.60 -------------------------------------------------------------------------------- Number: 234 Title: Compiler Bug: abstractBody.abstractType 1 Keywords: modules, functors Submitter: deutsch@poly.polytechnique.fr. Alain Deutsch, Laboratoire d'Informatique de l'Ecole Polytechnique (LIX) 91128 Palaiseau Cedex France. Date: 6/19/90 Version: Standard ML of New Jersey, Version 0.56, 13 April 1990 System: Sun 3/60, SunOS Release 4.0_Export Severity: major (?) Problem: Compiler Bug: abstractBody.abstractType 1 Code: Too long, ommited. Transcript: - use "/home/icsla/deutsch/ESTFM/basic_ev.sml"; [opening /home/icsla/deutsch/ESTFM/basic_ev.sml] [reading Powerset.bin... done] signature FunctionLattice signature ProductLattice signature OrderedSet signature Lattice signature Product signature PartialFunction signature TotalFunction functor Powerset [reading HashTable.bin... done] signature arrayext functor HashTable functor arrayext [reading lattice.sig.bin... done] signature FunctionLattice signature ProductLattice signature OrderedSet signature Lattice signature Product signature PartialFunction signature TotalFunction [reading Syntax.sig.bin... done] signature Syntax [reading StrgHash.sig.bin... done] signature StrgHash [reading Error.sig.bin... done] signature Error [reading ListUtilities.sig.bin... [Major collection... 66% used (2325300/3480644), 2680 msec] [Increasing heap to 7023k] done] signature ListUtilities [reading Io.sig.bin... done] signature Io [closing /home/icsla/deutsch/ESTFM/basic_ev.sml] /home/icsla/deutsch/ESTFM/basic_ev.sml:20.3 Compiler Bug: abstractBody.abstractType 1 - Comments: the bug is not systematic, and hard to reproduce, this is why the source code has been ommited, as I have not been able to isolate the faulty part of the source. Status: fixed in 0.65 (same as 261) -------------------------------------------------------------------------------- Number: 235 Title: repeated type variables in typdesc and datdesc Keywords: modules, signatures, type variables, duplicate bindings Submitter: Don Sannella Date: 6/13/90 Version: 0.44? Severity: major Problem: The Definition of SML seems to allow repeated type variables in a typdesc and datdesc, making the following signatures legal: signature SIG1 = sig eqtype ('a,'a) t1 type ('a,'a) t2 end signature SIG2 = sig datatype ('a,'a) t3 = foo of 'a end Section 2.9 forbids repeated variables in a typbind and datbind, but I don't see anything forbidding it in a typdesc or datdesc. I assume below that the omission of a syntactic restriction here was intentional. Repeated type variables in a typdesc seem unproblematic if strange, since the semantics only looks at the number of variables. SML-NJ accepts SIG1 above, and treats it the same as a signature without repeated type variables, which is correct. Repeated type variables in a datdesc are more of a problem, since the constructors refer to them. According to the Definition, foo in SIG2 above gets type 'a -> ('a,'a) t3. Both of the following structures then match SIG2: structure A = struct datatype ('a,'b) t3 = foo of 'a end structure B = struct datatype ('a,'b) t3 = foo of 'b end SML-NJ (version 0.44a) says foo : 'a -> ('a,'b) t3, which is wrong. The result of this is that A matches SIG2 but B does not. I don't know about Poly-SML, since I don't have it here. Status: fixed in 0.65 -------------------------------------------------------------------------------- Number: 236 Title: Mach problems in 0.59 Keywords: Submitter: David Tarditi Date: 6/18/90 Version: 0.59 System: Mach Severity: critical Comments: I have installed version 0.59 on Vaxes, Suns, and Pmaxes running Mach. There were two problems: VAX.prim.s contained a reference to the variable maskSignals. The name should be _maskSignals instead. The file export.c should also include the file ml_os.h, which contains some definitions needed for Decstations running Mach. Status: fixed in 0.60 -------------------------------------------------------------------------------- Number: 237 Title: Can't parse most-negative integer constant Keywords: Submitter: David Berry Date: 6/5/90 Version: 0.56 System: All Severity: mild Comments: - ~1073741823; exception Overflow - ~1073741822; val it = ~1073741822: int - it - 1; val it = ~1073741823: int Status: fixed in 0.60 -------------------------------------------------------------------------------- Number: 238 Title: div is unreliable at extremes Keywords: Submitter: Andrew Appel Date: 7/5/90 Version: 0.56 System: All Severity: mild Comments: - val a = ~1073741822 - 2; val a = ~1073741824: int - a div 2; uncaught exception Overflow; Status: fixed in 0.60 -------------------------------------------------------------------------------- Number: 239 Title: INCONSISTENT exception raised in sharing analysis Keywords: modules, signatures, sharing, functors Submitter: Nick Date: 7/13/90 Version: 0.56, 0.59 System: Severity: Serious Problem: Internal exception raised in the typechecker during sharing analysis Code: signature A = sig type A datatype Foo = FOO of A end; signature B = sig type B end; signature C = sig datatype C = C of int -> int end; functor XYZZY(structure A: A structure B: B sharing type A.A = B.B structure C: C sharing type C.C = B.B ) = struct end; Transcript: signature A = sig type A datatype Foo con FOO : A -> Foo end signature B = sig type B end signature C = sig datatype C con C : (int -> int) -> C end [closing Kit/foo.sml] uncaught exception INCONSISTENT Status: fixed in 0.61 (dbm) -------------------------------------------------------------------------------- Number: 240 Title: concrete printing of abstype value Keywords: types, abstypes, sharing Submitter: Allen Leung. allen@sbcs.sunysb.edu Date: 7/12/90 Version: v59 4 June, 1990 System: SUN 3 on bsd Severity: minor Problem: Toplevel printing of abstype is transparent. Code: - abstype Foo = Foo of int = with fun foo i = Foo i end = val bar = foo 0; > type Foo > val foo = fn : int -> Foo > val bar = Foo 0 : Foo (* instead of - : Foo *) - Transcript: Comments: Is this a new feature of v59+? It does help debugging. Status: fixed in 0.64 -------------------------------------------------------------------------------- Number: 241 Title: sharing constraint error ignored Keywords: modules, signatures, functors, sharing Submitter: David Turner Date: 7/12/90 Version: 0.59 System: Sun4 Severity: Slightly irritating Problem: Ignores error in sharing constraint even though it obviously detects it. Input: - signature S = sig type t end; - functor F (structure A : S structure B : S sharing type B.t = A.s) = struct end; Output: Error: unbound type in structure: s functor F : Comment: Nonstandard function used in doSharing to report the bug. In 0.65 error message is: std_in:9.6-11.23 Error: unbound type in structure: s This doesn't provide as much useful information as it should. Error message should read something like "unbound type A.s in sharing spec". Status: fixed in 0.65 ------------------------------------------------------------------------------- Number: 242 Title: incorrect forward referencing allowed Keywords: modules, functors, scoping Submitter: Nick Date: 7/12/90 Version: 0.56, 0.59 System: Irrelevant Severity: Major (& Embarrassing?) Problem: Incorrect forward referencing when analysing SPECs in functor arguments. Input: signature SIG = sig type t end functor F(structure STR1: sig type t end sharing type STR1.t = Foo.t structure Foo: SIG ) = struct end; Output: functor F: Status: fixed in 0.73 -------------------------------------------------------------------------------- Number: 243 Title: include compiler bug Keywords: modules, signatures, include Submitter: Nick Rothwell Date: 7/5/90 Version: 0.59 Problem: The following file produces the error Compiler bug: Parse.includeSig.newTyc. Code: (* This "batch" file has been generated from the original sources by MAKE. If you want to make alterations, make them to the originals, and execute Make.make_task again. *) (*$DECTREE_DT*) (* Just the bare datatype for decision trees. *) signature DECTREE_DT = sig type lab type lvar type longvar type longcon type longexcon type scon type pat type type_info eqtype (*pah!*) RuleNum sharing type RuleNum = int type Decision type (''a, 'b) map datatype 'a option = NONE | SOME of 'a datatype DecisionTree = LAB_DECOMPOSE of {bind: lvar, parent: lvar, lab: lab, child: DecisionTree, info: type_info } | CON_DECOMPOSE of {bind: lvar, parent: lvar, child: DecisionTree} | EXCON_DECOMPOSE of {bind: lvar, parent: lvar, child: DecisionTree} | CON_SWITCH of {arg: lvar, selections: (longcon, DecisionTree) map, wildcard: DecisionTree option, (* An `option' because we may notice that all the constructors are present. *) info: type_info } | SCON_SWITCH of {arg: lvar, selections: (scon, DecisionTree) map, wildcard: DecisionTree } | EXCON_SWITCH of {arg: lvar, selections: (longexcon * DecisionTree) list, wildcard: DecisionTree } | END of {ruleNum: RuleNum, environment: (longvar, lvar) map } | FAIL end; (*$MATCH_COMPILER: DECTREE_DT*) (* The match compiler interface; the actual match compiler is built from a number of sub-functors, but this top-level interface is the only one which the rest of the compiler cares about. Given a series of patterns, it returns a DecisionTree (which is essentially an abstract form of the final lambda-code), in which all the lvars for identifiers and temporaries have been generated. At each leaf of the decision tree, there's a single rule number (the rule reached by this series of decisions), and an environment from identifiers to lvars, which is used to compile the right-hand-side expression for this rule. Nice, huh? *) signature MATCH_COMPILER = sig include DECTREE_DT val matchCompiler: lvar * pat list * {warnInexhaustive: bool, warnNoBindings: bool} -> DecisionTree (* these flags are set when the warnings are required. *) type StringTree val layoutDecisionTree: DecisionTree -> StringTree end; Status: fixed in 0.69 ------------------------------------------------------------------------------- Number: 244 Title: compiler bug on product of large integer constants on SPARC Keywords: Submitter: Bennet Vance (bennet@cse.ogi.edu) Date: 7/1/90 Version: 0.59 System: Sun 4/60 - SunOS Release 4.0.3c Severity: minor Problem: compiler bug on large products of integer constants Transcript: val it = () : unit - 2*268435455; val it = 536870910 : int - 2*268435456; Error: Compiler bug: [SparcCM.ashr] Status: fixed in 0.61 (jhr) -------------------------------------------------------------------------------- Number: 245 Title: NeXT installation problem Keywords: Submitter: Lyman Taylor ( respond to lyman@portia.stanford.edu ) Date: 07/12/90 Version: 0.56 System: NeXT , 8M , hard disk , & OD ( build done on OD ) Severity: major Problem: install script does not excute Code: none Transcript: following ouput of makeml ( machine name helen ) helen> makeml -next makeml> (cd runtime; make clean) rm -f *.o lint.out prim.s linkdata allmo.s run makeml> rm -f mo makeml> ln -s ../mo.m68 mo makeml> (cd runtime; rm -f run allmo.o) makeml> (cd runtime; make MACHINE=M68 'DEFS= -DBSD -DNeXT -DRUNTIME=\"runtime\"' linkdata) cc -O -DM68 -DBSD -DNeXT -DRUNTIME=\"runtime\" -o linkdata linkdata.c makeml> runtime/linkdata [runtime/IntM68.mos] runtime/linkdata> as runtime/allmo.s -o runtime/allmo.o makeml> (cd runtime; make MACHINE=M68 'DEFS= -DBSD -DNeXT' CPP=/lib/cpp 'CFL=' 'AS=as') cc -O -DM68 -DBSD -DNeXT -c run.c ml_os.h:113: can't find include file `sys/syscall.h' *** Exit 1 Stop. Comments: I'm not skilled at development for the NeXT. I was just looking to compile the latest version of SMLNJ so I could try it out there is an older version ( 0.43 ) on the Sparcs around here but the Next allows me to dump all this onto an OD so noone can complain about the space all the source is taking up. Status: fixed in 0.59 (jhr) -------------------------------------------------------------------------------- Number: 246 Title: repeated import consumes too much memory Keywords: Submitter: Peter Canning Date: 6/27/90 Version: 0.56 System: HP900S370 (m68030) HP-UX 7.0 Severity: major Problem: repeated use of the import facility causes the heap to grow Comments: In particular, if I repeatedly modify a file, import the file, then run the program defined in the file (the standard edit/compile/debug loop), my sml image seems to grow (and never shink again). When I was just using "use", sml would garbage collect freqently, but the process size would stay between 4000 and 5000 Kbytes. Using import (working on the same program), the process has grown as large as 11000 Kbytes. It appears that for some reason some data related to importing/compiling files is not being reclaimed by the garbage collector. Status: not a bug --- (defunct feature) -------------------------------------------------------------------------------- Number: 247 Title: close_out std_out Keywords: Submitter: Mark R. Leone Date: 6/29/90 Version: 0.59 Problem: If standard output is closed, the top level exits ungracefully: Transcript: [r.ergo]/usr/mleone/sml/hypo-pl> sml Standard ML of New Jersey, Version 0.59, 4 June 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - close_out std_out; Uncaught exception Io with "output "": closed outstream" Status: not a bug -------------------------------------------------------------------------------- Number: 248 Title: abstract types are not abstract Keywords: types, abstypes Submitter: Dave MacQueen Date: 7/16/90 Version: 0.59 (0.57 and later) Severity: major Problem: Abstract types defined by abstype declarations are not made abstract (i.e. converted from DATAtyc to ABStyc form), and their equality property is not reset to NO. Equality properties of types defined in terms of the abstype are not recomputed (see bug 231.) Comments: After the abstype body has been processed, the concrete form of the abstract types must be replaced by the abstract form throughout the 'signature' of the exported bindings (values, constructors, types). Also equality properties of exported types have to be reevaluated. Currently, there is a function that attempts to transform the tycons in the type checker, but it affects only the abstract syntax, and not the static environment. The problem results from the removal of the ref around tycons in 0.57. Status: fixed in 0.64 -------------------------------------------------------------------------------- Number: 249 Title: separate compilation printing problems Keywords: Submitter: Nick Rothwell (also Richard O'Neill) Date: 7/5/90 Version: 0.59 Severity: minor Problem: 0. If only one or other of the files exists (say, Foo.sml without Foo.bin or vice versa), the exception SystemCall gets raised. 1. The error message [Foo.bin is in the wrong format; recompiling] seems to have lost its closing "]" in 0.59. 2. The final bindings from a separately compiled module get printed on one line, as in: signature Asignature Bsignature Csignature D- rather than signature A signature B etc. Fix: (Richard O'Neill) For some reason the function printBindingTbl in print/printdec.sml was changed from its form in release 0.56 to a slightly modified forn in 0.59. The new form is functionally equivalent appart from omiting to generate newlines. Fix (currently untried): Return printBindingTbl to it 0.56 form. Status: fixed in 0.64 (?) -------------------------------------------------------------------------------- Number: 250 Title: interpreter broken Keywords: Submitter: Richard O'Neill (cmp7130%sys.uea.ac.uk@nsfnet-relay.ac.uk) Date: 7/17/90 Version: 0.59 System: Sun3, SunOS 4.1 Severity: Major Problem: In interpret mode, version 0.59 fails with no explanation when compiling a grammar from mlyacc (slightly modified to use 'import'), whilst in compile mode, the grammar is compiled correctly. Version 0.56 does not exhibit the same problem. This seems a significant problem since using compile mode takes significant time and memory. Equally, I cannot use version 0.56 due to some of its bugs which manifest themselves when compiling other modules. I have not included the files as they are rather long (being an mlyacc generated parser and the relevant support files). I can supply you with a uuencoded compressed tar archive of them all if you desire. Transcript: unix% sml Standard ML of New Jersey, Version 0.59, 4 June 1990 - System.Control.interp; val it = ref true : bool ref - import "clean.grm"; [clean.grm.bin is out of date; recompiling] [reading clean.grm.sml] [reading lib/token.sig.bin... done] [closing clean.grm.sml] IMPORT failed (compile-time exception: SystemCall) - import "clean.grm"; [clean.grm.bin is out of date; recompiling] [reading clean.grm.sml] [reading lib/token.sig.bin... done] [reading clean.grm.sig.bin... done] [Major collection... 60% used (648480/1067380), 1900 msec] [Major collection... 96% used (1015412/1055228), 3000 msec] [Increasing heap to 3088k] [Major collection... 96% used (1526764/1586468), 4740 msec] [Increasing heap to 4640k] [Major collection... 96% used (2287536/2378284), 7480 msec] [Increasing heap to 6952k] [Major collection... [Increasing heap to 10528k] 96% used (3515248/3635044), 11120 msec] [Increasing heap to 10632k] [closing clean.grm.sml] IMPORT failed (compile-time exception: Cascade) - ^D unix% old-sml Standard ML of New Jersey, Version 0.56, 13 April 90 val it = () : unit - System.Control.interp; val it = ref true : bool ref - import "clean.grm"; [clean.grm.bin is out of date; recompiling] [reading clean.grm.sml] [reading lib/token.sig.bin... ] [lib/token.sig.bin is the wrong format; recompiling] [closing lib/token.sig.bin] [reading lib/token.sig.sml] [reading lib/lrtable.sig.bin... ] [lib/lrtable.sig.bin is the wrong format; recompiling] [closing lib/lrtable.sig.bin] [reading lib/lrtable.sig.sml] [writing lib/lrtable.sig.bin... done] [closing lib/lrtable.sig.sml] [writing lib/token.sig.bin... done] [closing lib/token.sig.sml] [reading clean.grm.sig.bin... ] [clean.grm.sig.bin is the wrong format; recompiling] [closing clean.grm.sig.bin] [reading clean.grm.sig.sml] [reading lib/parserdata.sig.bin... ] [lib/parserdata.sig.bin is the wrong format; recompiling] [closing lib/parserdata.sig.bin] [reading lib/parserdata.sig.sml] [reading lib/token.sig.bin... ] [import(s) of lib/token.sig are out of date; recompiling] [closing lib/token.sig.bin] [reading lib/token.sig.sml] [reading lib/lrtable.sig.bin... done] [writing lib/token.sig.bin... done] [closing lib/token.sig.sml] [reading lib/lrtable.sig.bin... done] [writing lib/parserdata.sig.bin... done] [closing lib/parserdata.sig.sml] [writing clean.grm.sig.bin... done] [closing clean.grm.sig.sml] [Major collection... 66% used (1058292/1581868), 3360 msec] [Increasing heap to 3249k] [Major collection... 96% used (1629952/1687576), 5020 msec] [Increasing heap to 4929k] [Major collection... 96% used (2478864/2562240), 7800 msec] [Increasing heap to 7481k] [Major collection... 30% used (1226344/3978648), 4200 msec] [Decreasing heap to 4153k] [Major collection... 92% used (1982616/2147092), 6060 msec] [Increasing heap to 6081k] [Major collection... 85% used (2731764/3199400), 8480 msec] [Increasing heap to 8593k] [Major collection... 62% used (2809816/4478688), 9180 msec] [Increasing heap to 8657k] [Major collection... 60% used (2770384/4573952), 8920 msec] [Major collection... 62% used (2804296/4452412), 8980 msec] [Increasing heap to 8721k] [Major collection... 67% used (3031468/4473120), 8700 msec] [Increasing heap to 9033k] [writing clean.grm.bin... done] [closing clean.grm.sml] signature Clean_TOKENS signature TOKEN signature PARSER_DATA signature Clean_LRVALS signature LR_TABLE functor CleanLrValsFun - ^D unix% sml Standard ML of New Jersey, Version 0.59, 4 June 1990 - System.Control.interp := false; val it = () : unit - import "clean.grm"; [reading clean.grm.bin... ] [clean.grm.bin is the wrong format; recompiling [closing clean.grm.bin] [reading clean.grm.sml] [reading lib/token.sig.bin... ] [lib/token.sig.bin is the wrong format; recompiling [closing lib/token.sig.bin] [reading lib/token.sig.sml] [reading lib/lrtable.sig.bin... ] [lib/lrtable.sig.bin is the wrong format; recompiling [closing lib/lrtable.sig.bin] [reading lib/lrtable.sig.sml] [writing lib/lrtable.sig.bin... done] [closing lib/lrtable.sig.sml] [writing lib/token.sig.bin... done] [closing lib/token.sig.sml] [reading clean.grm.sig.bin... ] [clean.grm.sig.bin is the wrong format; recompiling [closing clean.grm.sig.bin] [reading clean.grm.sig.sml] [reading lib/parserdata.sig.bin... ] [lib/parserdata.sig.bin is the wrong format; recompiling [closing lib/parserdata.sig.bin] [reading lib/parserdata.sig.sml] [reading lib/token.sig.bin... done] [reading lib/lrtable.sig.bin... done] [writing lib/parserdata.sig.bin... done] [closing lib/parserdata.sig.sml] [writing clean.grm.sig.bin... done] [closing clean.grm.sig.sml] [Major collection... 61% used (679180/1109552), 2060 msec] [Increasing heap to 2240k] [Major collection... 80% used (932040/1158752), 2780 msec] [Increasing heap to 2848k] [Major collection... 95% used (1403328/1463408), 4240 msec] [Increasing heap to 4272k] [Major collection... 96% used (2109420/2194020), 6680 msec] [Increasing heap to 6408k] [Major collection... [Increasing heap to 9656k] 96% used (3255168/3361612), 10700 msec] [Increasing heap to 9824k] [Major collection... 36% used (1914068/5201708), 6400 msec] [Decreasing heap to 6208k] [Major collection... 85% used (2811340/3298792), 8620 msec] [Increasing heap to 8816k] [Major collection... 61% used (2810740/4607236), 8320 msec] [Major collection... 63% used (2882812/4569184), 8900 msec] [Increasing heap to 8928k] [Major collection... 57% used (2705236/4669212), 8360 msec] [Major collection... 61% used (2854268/4612180), 8560 msec] [writing clean.grm.bin... done] [closing clean.grm.sml] signature Clean_TOKENSsignature TOKENsignature PARSER_DATAsignature Clean_LRVALSsignature LR_TABLEfunctor CleanLrValsFun- Comment: import and interpreter mode are currently incompatible Status: not a bug ------------------------------------------------------------------------------- Number: 251 Title: omits tests for repeated bindings Keywords: duplicate bindings Submitter: Dave Berry db@lfcs.ed.ac.uk Date: 7/18/90 Version: 0.59 System: All (I presume; actually tested on a Sun 3 with SunOS 4.0) Severity: minor Problem: omits tests for repeated bindings Code: type t = int and t = string; exception E and E; val rec f = fn x => x + 1 and f = fn n => if n > 0 then 1 else n * f (n - 1); Transcript: - type t = int and t = string; type t = int type t = string - exception E and E; exception E exception E - val rec f = fn x => x + 1 = and f = fn n => if n > 0 then 1 else n * f (n - 1); val f = fn : int -> int val f = fn : int -> int Comments: I expect that few people would make these mistakes in "real" code, but they might be more common when teaching. The tests are made for repeated constructors in a datatype, and in some (non-recursive?) value bindings, e.g. - datatype a = A | A; std_in:3.14-3.18 Error: duplicate constructor name - val a = 1 and a = 2; std_in:2.5-2.19 Error: duplicate variable-name `a' in pattern(s) Page 9 is the relevant part of the definition. Status: fixed in 0.65 -------------------------------------------------------------------------------- Number: 252 Title: include broken in 0.59 Keywords: modules, signatures, sharing, include Submitter: Nick Date: 7/17/90 Version: 0.59 System: Irrelevant Severity: Major Problem: Inclusion of signatures with shared types: >Blam!<. Code: signature SIG1 = sig type ty sharing type ty = int end; signature SIG2 = sig include SIG1 end; Transcript: signature SIG1 = sig eqtype ty end Error: Compiler bug: Parse.includeSig.newTyc Comments: Works in 0.56 (which has different problems - see a previous report). Status: fixed in 0.64 -------------------------------------------------------------------------------- Number: 253 Title: SML Dumping core compiling mlyacc with -pervshare Keywords: Submitter: Richard O'Neill (cmp7130%sys.uea.ac.uk@nsfnet-relay.ac.uk) Date: 7/18/90 Version: 0.59 System: Sun3/50, SunOS 4.1 Severity: You decide... Problem: Attempting to compile mlyacc (as supplied with version 0.56 of SML of NJ) with a '-pervshare' version of SML of NJ 0.59 causes a Segmentation Fault. This does not seem to happen with the sharable SML compiler. I have the core dump if that would help... Status: fixed in 0.74 --- sometime between 0.59 and 0.74 -------------------------------------------------------------------------------- Number: 254 Title: failure to detect type error Keywords: modules, functors, types Submitter: Andrew Appel Date: 7/23/90 Version: 0.60 Severity: critical Problem: type error not detected Code: signature SIG = sig type EA val fopt : ((EA * EA) -> unit) option end functor CPSgen(M: SIG) : sig end = struct val g = case M.fopt of SOME f => let fun h x = f (x,x) in h end val x = g 2 end Comments: Caused by missing case in scan function in the definition of Unify.instantiate. Status: fixed in 0.61 (dbm) -------------------------------------------------------------------------------- Number: 255 Title: space leak with redeclaration of variables Keywords: Submitter: John Reppy Date: 7/24/90 Version: 0.60 Severity: major Problem: I think that there is a space leak in the top-level loop/environment. If I keep redefining the same identifiers, the amount of live data grows, when it should be fairly constant. I assume that the problem is that the top-level symbol table is holding onto something it shouldn't. Transcript: Here is a simple demonstration of the space leak (60 bytes/iteration): Standard ML of New Jersey, Version 0.60, 13 July 1990 val it = () : unit - structure S = struct val _ = System.Unsafe.CInterface.gc 1 end; [Major collection... 98% used (516680/526692), 610 msec] structure S : sig end - structure S = struct val _ = System.Unsafe.CInterface.gc 1 end; [Major collection... 98% used (517100/525980), 550 msec] structure S : sig end - structure S = struct val _ = System.Unsafe.CInterface.gc 1 end; [Major collection... 98% used (517160/526388), 550 msec] structure S : sig end - structure S = struct val _ = System.Unsafe.CInterface.gc 1 end; [Major collection... 98% used (517220/526448), 550 msec] structure S : sig end - structure S = struct val _ = System.Unsafe.CInterface.gc 1 end; [Major collection... 98% used (517280/526508), 540 msec] structure S : sig end Comment: (appel) This is the top-level line-number information, and is a few bytes per line, regardless of size of defined structures. Status: fixed in 0.65 (actually, it's now a 48-byte leak) ------------------------------------------------------------------------------- Number: 256 Title: mcopt compiler bug with improper function definition Keywords: Submitter: John Mitchell (jcm@iswim.stanford.edu) Date: 7/24/90 Version: 0.60 Severity: critical Problem: Compiler bug "r_o in mcopt" raised as a result of improper clausal function definition. Transcript: - datatype 'a stack = empty | stk of 'a *'a stack; datatype 'a stack con empty : 'a stack con stk : 'a * 'a stack -> 'a stack - fun pop stk(e,s) = s; Error: Compiler bug: r_o in mcopt adding parens fixes the problem, so not serious as is: fun pop (stk (e,s)) = s; std_in:2.5-2.23 Warning: match not exhaustive stk (e,s) => ... val pop = fn : 'a stack -> 'a stack >Submitter: Sergio Antoy, antoy@vtodie.cs.vt.edu >Date: 8/9/90 >Version: SML of NJ version number 056 >System: DEC3100 V2.2 (Rev. 15) >Severity: >Problem: "using" following file sml generates "Compiler bug" msg >Code: datatype 'a Xlist = Xnil | Xcons of 'a * 'a Xlist | Xappend of 'a Xlist * 'a Xlist; fun incr Xappend(Xnil,Xnil) = Xnil | incr Xappend(Xnil,Xcons(a,b)) = Xcons(a,b); Transcript: goliat[8]% sml Standard ML of New Jersey, Version 0.56, 13 April 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - use "trans.sml"; [opening trans.sml] datatype 'a Xlist con Xappend : 'a Xlist * 'a Xlist -> 'a Xlist con Xcons : 'a * 'a Xlist -> 'a Xlist con Xnil : 'a Xlist Error: Compiler bug: r_o in mcopt [closing trans.sml] - Status: fixed in 0.62? -------------------------------------------------------------------------------- Number: 257 Title: Compiler bug: EnvAccess.lookPath with imported functors (bug 214 again) Keywords: modules, functors Submitter: Richard O'Neill (cmp7130%sys.uea.ac.uk@nsfnet-relay.ac.uk) Date: 7/30/90 Version: 0,59, 0.60 System: Sun3/180, SunOS 4.1 Severity: Major Problem: Bug #214 ('Compiler bug: EnvAccess.lookPath occurs when printing a top level result') has not been laid to rest, it still occurs with imported functors. Transcript: unix% cat > one.sml functor classes () = struct datatype symbol_class = DataClass of data_class | SpecialClass of special_class and data_class = Int | Real | Bool | String and special_class = Any | None end ^D unix% cat > two.sml signature classes = sig datatype symbol_class = DataClass of data_class | SpecialClass of special_class and data_class = Int | Real | Bool | String and special_class = Any | None end functor nodes ( structure Classes : classes ) = struct structure Classes = Classes local open Classes in datatype node = ClassNode of symbol_class | ValueNode of data_class end end ^D unix% sml Standard ML of New Jersey, Version 0.60, 13 July 1990 val it = () : unit - import "one" "two"; [reading one.sml] [writing one.bin... done] [closing one.sml] functor classes [reading two.sml] [writing two.bin... done] [closing two.sml] signature classes functor nodes - structure Classes = classes () = structure Nodes = nodes ( structure Classes = Classes ) = open Classes Nodes ; structure Classes : sig datatype special_class con Any : special_class con None : special_class datatype symbol_class con DataClass : data_class -> symbol_class con SpecialClass : special_class -> symbol_class datatype data_class con Bool : data_class con Int : data_class con Real : data_class con String : data_class end structure Nodes : sig structure Classes : sig...end datatype node con ClassNode : symbol_class -> node con ValueNode : data_class -> node end open Classes Nodes - ClassNode (DataClass Int); val it = ClassNode Error: Compiler bug: EnvAccess.lookPath - ValueNode Int; val it = ValueNode Int : node - ^D unix% sml Standard ML of New Jersey, Version 0.60, 13 July 1990 val it = () : unit - app use ["one.sml","two.sml"]; [opening one.sml] functor classes : [closing one.sml] [opening two.sml] signature classes = sig datatype special_class con Any : special_class con None : special_class datatype symbol_class con DataClass : data_class -> symbol_class con SpecialClass : special_class -> symbol_class datatype data_class con Bool : data_class con Int : data_class con Real : data_class con String : data_class end functor nodes : [closing two.sml] val it = () : unit - structure Classes = classes () = structure Nodes = nodes ( structure Classes = Classes ) = open Classes Nodes ; structure Classes : sig datatype special_class con Any : special_class con None : special_class datatype symbol_class con DataClass : data_class -> symbol_class con SpecialClass : special_class -> symbol_class datatype data_class con Bool : data_class con Int : data_class con Real : data_class con String : data_class end structure Nodes : sig structure Classes : sig...end datatype node con ClassNode : symbol_class -> node con ValueNode : data_class -> node end open Classes Nodes - ClassNode (DataClass Int); val it = ClassNode (DataClass Int) : node - ValueNode Int; val it = ValueNode Int : node - ^D Status: fixed in 0.66 (?) -------------------------------------------------------------------------------- Number: 258 Title: System.Directory.cd failure Keywords: Submitter: Dave MacQueen Date: 8/15/90 Version: 0.63 Problem: System.Directory.cd applied to nonexistent directory name raises uncaught exception Transcript: - System.Directory.cd "foo"; uncaught exception SysError - Status: fixed in 0.65 -------------------------------------------------------------------------------- Number: 259 Title: uncaught exception Match compiling normperv.sml Keywords: Submitter: Richard O'Neill (cmp7130%sys.uea.ac.uk@nsfnet-relay.ac.uk) Date: 8/14/90 Version: 0.63 (not in 0.62 or earlier) System: Sun3/180, SunOS 4.1 Severity: Critical Problem: Version 0.63 has a new bug whereby it cannot compile dbguser/normperv.sml This prevents creating the '-debug' version. Transcript: unix% sml Standard ML of New Jersey, Version 0.63, 10 August 1990 val it = () : unit - use "dbguser/normperv.sml"; [opening dbguser/normperv.sml] [closing dbguser/normperv.sml] uncaught exception Match - Comments: Smlc, version 0.62, created the 680X0 '.mo' files from which a -pervshare runtime system was built using gcc. This runtime system was then used to build a normal and then a -debug system (which failed). I've marked the severity as critical because it is a critical problem for this version. For me however, its not so critical as I seem to be managing OK with 0.62. Status: fixed in 0.75 approxiamtely -------------------------------------------------------------------------------- Number: 260 Title: failure to raise overflow Keywords: Submitter: David.Tarditi@B.GP.CS.CMU.EDU Date: 8/13/90 Version: 0.63? Problem: The following program should raise an Overflow exception on all 32-bit 2's complement machines but it doesn't: ------- fun exp 0 = 1 | exp i = 2 * exp (i-1); val a = exp 29; val minint = ~a + ~a; (* should raise overflow *) val test = minint div ~1; ------- An overflow exception was not raised in version 0.59 on a Sun 3 running Mach emluating 4.3 BSD. It was raised in version 0.59 on a MicroVax 3 running Mach emulating 4.3 BSD. Comments: This is the only case where overflow can occur in division. It occurs since MININT = -(MAXINT+1) in 2's complement. Division of MININT by -1 causes an overflow. Status: fixed in 0.64 ------------------------------------------------------------------------------- Number: 261 Title: Compiler Bug: abstractBody.abstractType 1 (assumed same as 234) Keywords: modules, functors Submitter: George Beshers, beshers@sun2.brc.uconn.edu Date: 8/9/90 Version: 0.56, sparc Severity: Significant Problem: Compiler generates ``Regex.sml:21.17 Compiler Bug: abstractBody.abstractType 1'' Note: this is somewhat delicate to reproduce. If you break the following into files and start a clean sml and do "use Regex.sml;" it consistently generates the error. However, if you *repeat* the use Regex.sml it compiles (however I have a lingering suspision about the correctness of the code produced...). On one occasion I tried "using" all the files in sequence and that worked OK, at least the working parts of the module did. Also I have tried to cut parts of the Regex.sml file and reproduce the error but without success. In particular, the error is dependent on at least some of the code appearing later in the file. Code: (*---------------------------- Ordinal.sml ---------------------*) signature ORD_RANGE = sig type elem val ord : elem -> int and de_ord : int -> elem end functor NatFn() : ORD_RANGE = struct type elem = int fun ord x = x fun de_ord x = x end functor CharFn() : ORD_RANGE = struct type elem = string val ord = String.ord val de_ord = chr end (*------------------------ BitSet.sml ---------------------------*) import "Ordinal"; signature BITSET = sig structure Elem : ORD_RANGE exception NoSuchElement type bitset val empty: bitset and singleton : Elem.elem -> bitset and range : Elem.elem * Elem.elem -> bitset and setFromList : Elem.elem list -> bitset and exists : Elem.elem -> bitset -> bool and union : bitset * bitset -> bitset and intersect : bitset * bitset -> bitset and difference : bitset * bitset -> bitset val isempty : bitset -> bool and eq : bitset * bitset -> bool and subset : bitset * bitset -> bool and subset': bitset * bitset -> bool val select : bitset * (Elem.elem -> bool) -> bitset val lowest : bitset -> Elem.elem val lowest' : bitset -> Elem.elem -> Elem.elem val highest : bitset -> Elem.elem val highest' : bitset -> Elem.elem -> Elem.elem val totOrder : bitset * bitset -> bool val forall : bitset -> Elem.elem list val makeString : bitset -> string end; (* trivialized version *) functor BitSetFn(Elem1 : ORD_RANGE) : BITSET = struct structure Elem = Elem1 local open Elem Bits val bits_per_int = 30; val all_bits = 1073741823 (* 077777777777 *) in datatype bitset = BS of {lo : int, hi : int, setx : int array} val empty = BS{lo = 0, hi = ~1, setx = array(0, 0)} fun singleton x = empty fun range(l, h) = empty fun exists x (BS{lo, hi, setx}) = false fun union(set1, set2) = empty exception NoSuchElement fun lowest (BS{lo,...}) = de_ord lo fun lowest' (BS{lo,...}) start = de_ord lo fun highest (BS{hi,...}) = de_ord hi fun highest' (BS{hi,...}) start = de_ord hi fun reduce bs = empty fun intersect(set1, set2) = empty fun difference(set1, set2) = empty fun isempty (BS{lo, hi,...}) = hi < lo fun eq (set1, set2) = true fun op subset(s1, s2) = isempty (reduce (difference (s1, s2))) fun op subset'(s1, s2) = isempty (reduce (difference (s1, s2))) andalso (not (isempty (reduce (difference (s2, s1))))) fun lowQuery (bs, q) = let val BS{lo, hi, setx} = bs val i = ref lo in de_ord (!i) end fun highQuery (bs, q) = let val BS{lo, hi, setx} = bs val i = ref hi in de_ord (!i) end fun select (bs, q) = bs fun totOrder (set1, set2) = true fun forall s = nil fun makeString s = "" fun setFromList (l' : Elem.elem list) = empty end end (*------------------------------ RedBlack.sml ------------------*) signature RED_BLACK = sig type tree type key val empty : tree val insert : key * tree -> tree val lookup : key * tree -> key exception notfound of key end functor RedBlack(B : sig type key val > : key*key->bool end): RED_BLACK = struct open B datatype color = RED | BLACK datatype tree = empty | tree of key * color * tree * tree exception notfound of key fun insert (key,t) = let fun f empty = tree(key,RED,empty,empty) | f (tree(k,BLACK,l,r)) = if key>k then case f r of r as tree(rk,RED, rl as tree(rlk,RED,rll,rlr),rr) => (case l of tree(lk,RED,ll,lr) => tree(k,RED,tree(lk,BLACK,ll,lr), tree(rk,BLACK,rl,rr)) | _ => tree(rlk,BLACK,tree(k,RED,l,rll), tree(rk,RED,rlr,rr))) | r as tree(rk,RED,rl, rr as tree(rrk,RED,rrl,rrr)) => (case l of tree(lk,RED,ll,lr) => tree(k,RED,tree(lk,BLACK,ll,lr), tree(rk,BLACK,rl,rr)) | _ => tree(rk,BLACK,tree(k,RED,l,rl),rr)) | r => tree(k,BLACK,l,r) else if k>key then case f l of l as tree(lk,RED,ll, lr as tree(lrk,RED,lrl,lrr)) => (case r of tree(rk,RED,rl,rr) => tree(k,RED,tree(lk,BLACK,ll,lr), tree(rk,BLACK,rl,rr)) | _ => tree(lrk,BLACK,tree(lk,RED,ll,lrl), tree(k,RED,lrr,r))) | l as tree(lk,RED, ll as tree(llk,RED,lll,llr), lr) => (case r of tree(rk,RED,rl,rr) => tree(k,RED,tree(lk,BLACK,ll,lr), tree(rk,BLACK,rl,rr)) | _ => tree(lk,BLACK,ll,tree(k,RED,lr,r))) | l => tree(k,BLACK,l,r) else tree(key,BLACK,l,r) | f (tree(k,RED,l,r)) = if key>k then tree(k,RED,l, f r) else if k>key then tree(k,RED, f l, r) else tree(key,RED,l,r) in case f t of tree(k,RED, l as tree(_,RED,_,_), r) => tree(k,BLACK,l,r) | tree(k,RED, l, r as tree(_,RED,_,_)) => tree(k,BLACK,l,r) | t => t end fun lookup (key,t) = let fun look empty = raise (notfound key) | look (tree(k,_,l,r)) = if k>key then look l else if key>k then look r else k in look t end end (*------------------------ Regex.sml ------------------------*) import "Ordinal"; import "BitSet"; import "RedBlack"; signature CHAR_REG_EXP = sig structure Alphabet : ORD_RANGE structure AlphaSet : BITSET structure range : ORD_RANGE structure Set : BITSET sharing type Set.Elem.elem = range.elem = int type pattern datatype Ch_Reg_Exp = CONCAT of Ch_Reg_Exp list | ALTERNATE of Ch_Reg_Exp list | STAR of Ch_Reg_Exp | PLUS of Ch_Reg_Exp | OPTION of Ch_Reg_Exp | LETTER of AlphaSet.bitset | AUG (* For internal use only *) type Aug_Reg_Exp val re_to_Aug : Ch_Reg_Exp -> {aug_re : Aug_Reg_Exp, count : int, leafList : Aug_Reg_Exp list} val Aug_to_Follow : {aug_re : Aug_Reg_Exp, count : int, leafList : Aug_Reg_Exp list} -> Set.bitset array val Build_FSM : {aug_re : Aug_Reg_Exp, count : int, leafList : Aug_Reg_Exp list} * Set.bitset array -> pattern val Print : Aug_Reg_Exp -> unit end functor Reg_ExpFn() (* : CHAR_REG_EXP *) = struct structure Alphabet = CharFn() structure AlphaSet : BITSET = BitSetFn(Alphabet) structure range = NatFn() structure Set : BITSET = BitSetFn(range) type InfoTy = { fp : Set.bitset, lp : Set.bitset, null : bool } datatype pattern = Pat datatype Ch_Reg_Exp = CONCAT of Ch_Reg_Exp list | ALTERNATE of Ch_Reg_Exp list | STAR of Ch_Reg_Exp | PLUS of Ch_Reg_Exp | OPTION of Ch_Reg_Exp | LETTER of AlphaSet.bitset | AUG (* Internal use only *) datatype Aug_Reg_Exp = AugCONCAT of InfoTy * Aug_Reg_Exp list | AugALTERNATE of InfoTy * Aug_Reg_Exp list | AugSTAR of InfoTy * Aug_Reg_Exp | AugPLUS of InfoTy * Aug_Reg_Exp | AugOPTION of InfoTy * Aug_Reg_Exp | AugLETTER of InfoTy * AlphaSet.bitset | AugAUG of InfoTy fun mkInfo () = { Fpos = Set.empty, Lpos = Set.empty, Nullable = false } fun info (AugCONCAT(inf, _)) = inf | info (AugALTERNATE(inf, _)) = inf | info (AugSTAR(inf, _)) = inf | info (AugPLUS(inf, _)) = inf | info (AugOPTION(inf, _)) = inf | info (AugLETTER(inf, _)) = inf | info (AugAUG(inf)) = inf (* type 'a Aug = {aug_re : Aug_Reg_Exp, count : int, leafList : Aug_Reg_Exp list} *) fun re_to_Aug re = let fun app_map cnt nil = (nil : Aug_Reg_Exp list, cnt, nil) | app_map cnt (hd::tl) = let val hd' = pass1(cnt, hd) val {aug_re=ar, count=c, leafList=le} = hd' val (arTl, cntTl, leTl) = app_map c tl in (ar::arTl, cntTl, le@leTl) end and pass1 (counter, CONCAT(re_l)) = let val (ar', cnt', le') = app_map counter re_l fun foldConcat (a, b) = let val {fp = fpA, lp = lpA, null = nuA} = a val {fp = fpB, lp = lpB, null = nuB} = b val n = nuA andalso nuB val fp' = if nuB then Set.union (fpA, fpB) else fpB val lp' = if nuA then Set.union (lpA, lpB) else lpA in print "foldConcat\n"; print " given A "; print " fpA="; print (Set.makeString fpA); print " lpA="; print (Set.makeString lpA); print nuA; print "\n"; print " given B "; print " fpB="; print (Set.makeString fpB); print " lpB="; print (Set.makeString lpB); print nuB; print "\n"; print " results "; print " fp'="; print (Set.makeString fp'); print " lp'="; print (Set.makeString lp'); print n; print "\n"; {fp = fp', lp = lp', null = n} end val base = {fp = Set.empty, lp = Set.empty, null = true} val _ = (print " base "; print " fp'="; print (Set.makeString (#fp base)); print " lp'="; print (Set.makeString (#lp base)); print (#null base); print "\n") val info = revfold foldConcat (map info ar') base in {aug_re = AugCONCAT(info, ar'), count = cnt', leafList = le'} end | pass1 (counter, ALTERNATE(re_l)) = let val (ar', cnt', le') = app_map counter re_l fun foldAlt (a, b) = let val {fp = hdA, lp = lpA, null = nuA} = a val {fp = hdB, lp = lpB, null = nuB} = b in {fp = Set.union (hdA, hdB), lp = Set.union (lpA, lpB), null = nuA orelse nuB} end val base = {fp = Set.empty, lp = Set.empty, null = false} val info = fold foldAlt (map info ar') base in {aug_re = AugALTERNATE(info, ar'), count = cnt', leafList = le'} end | pass1 (counter, STAR(re)) = let val {aug_re=ar, count=c, leafList=le} = pass1(counter, re) val {fp = fp', lp = lp', null = nu} = info ar val info = {fp = fp', lp = lp', null = true} in {aug_re = AugSTAR(info, ar), count = c, leafList = le} end | pass1 (counter, PLUS(re)) = let val {aug_re=ar, count=c, leafList=le} = pass1(counter, re) val {fp = fp', lp = lp', null = nu} = info ar val info = {fp = fp', lp = lp', null = nu} in {aug_re = AugPLUS(info, ar), count = c, leafList = le} end | pass1 (counter, OPTION(re)) = let val {aug_re=ar, count=c, leafList=le} = pass1(counter, re) val {fp = fp', lp = lp', null = nu} = info ar val info = {fp = fp', lp = lp', null = true} in {aug_re = AugOPTION(info, ar), count = c, leafList = le} end | pass1 (counter, LETTER(a)) = let val c = Set.singleton counter val info = {fp = c, lp = c, null = false} val aug_r = AugLETTER(info, a) in {aug_re = aug_r, count = counter+1, leafList = [aug_r]} end | pass1 (counter, AUG) = let val c = Set.singleton counter val info = {fp = c, lp = c, null = false} val aug_r = AugAUG(info) in {aug_re = aug_r, count = counter+1, leafList = [aug_r]} end in pass1 (0, CONCAT [re, AUG]) end fun prFollow fp = let val l = Array.length fp fun prx i = (print i; print " "; print (Set.makeString (fp sub i)); print "\n") fun p i = if i < l then (prx i; p (i + 1)) else () in p 0 end fun Aug_to_Follow {aug_re, count, leafList} = let val followPos = array(count, Set.empty) val count = ref 0 fun updSet fp i = update(followPos, i, Set.union(followPos sub i, fp)) fun pass2 (AugCONCAT(inf, re_l)) = let fun foldConcat (x, y) = let val updList = Set.forall y val {fp, lp, ...} = info x val updSet' = updSet fp fun ms nil = "" | ms (x::y) = (makestring x) ^ (ms y) in print ("[" ^ (ms updList) ^ "]" ^ "\n"); print (Set.makeString lp ^ "\n"); app updSet' updList; lp end val c = !count in inc count; print "before fold "; print c; print "\n"; prFollow followPos; print "\n"; revfold foldConcat re_l Set.empty; print "after fold "; print c; print "\n"; prFollow followPos; print "\n"; app pass2 re_l; print "after app "; print c; print "\n"; prFollow followPos; print "\n" end | pass2 (AugALTERNATE(inf, re_l)) = app pass2 re_l | pass2 (AugSTAR(inf, re)) = let val {fp, lp, ...} = info re val updSet' = updSet fp in app updSet' (Set.forall lp); pass2 re end | pass2 (AugPLUS(inf, re)) = let val {fp, lp, ...} = info re val updSet' = updSet fp in app updSet' (Set.forall lp); pass2 re end | pass2 (AugOPTION(inf, re)) = pass2 re | pass2 (AugLETTER(inf, _)) = () | pass2 (AugAUG(inf)) = () in pass2 aug_re; followPos end datatype transition = TR of AlphaSet.bitset * state and state = ST of {posSet : Set.bitset, stId : int, trans : transition list} fun le (ST{posSet = pS1,...}, ST{posSet = pS2,...}) = Set.totOrder (pS1, pS2) fun getPosSet (ST{posSet,...}) = posSet structure table = RedBlack(struct type key = state val op > = le end) fun Build_FSM ({aug_re, count, leafList}, followPos) = let (* get character set at position i *) fun cSetAt i = case nth (leafList, i) of AugLETTER(inf, x) => x | AugAUG(_) => AlphaSet.empty (* test to see if character has transition at position i *) fun atPos c i = AlphaSet.exists c (cSetAt i) (* Is this position a final position *) fun final i = case nth (leafList, i) of AugAUG(_) => true | _ => false (* return only those elements which match query *) fun sublist query l = let fun ss nil = nil | ss (hd::tl) = let val x = (ss tl) in if query hd then hd::x else x end in ss l end val cnt = ref 1 fun build_auto states unmarked = if unmarked = nil then states else let val T = hd unmarked val _ = print ("build_auto " ^ (Set.makeString T) ^ "\n") val allchar = let fun f (i, x) = AlphaSet.union(cSetAt i, x) in fold f (Set.forall T) AlphaSet.empty end val _ = print (" allchar = " ^ (AlphaSet.makeString allchar) ^ "\n"); fun eachChar states unmarked trans allchar = if AlphaSet.isempty allchar then (states, unmarked, trans) else let val _ = print "eachChar\n" fun next cSet = let val x = AlphaSet.lowest cSet val _ = print ("next cSet=" ^ (AlphaSet.makeString cSet) ^ " ") val _ = print (makestring (AlphaSet.Elem.ord x) ^ "\n") val posSet = Set.select (T, atPos x) val _ = print "Check\n" fun findSet i ch = if i = count then ch else let val y = if Set.exists i posSet then AlphaSet.intersect(ch, cSetAt i) else AlphaSet.difference(ch, cSetAt i) in findSet (i + 1) y end in (findSet 0 cSet, posSet) end (* next *) val (cSet, posSet) = next allchar val _ = print (" cSet=" ^ (AlphaSet.makeString cSet) ^ ", posSet = " ^ (Set.makeString posSet) ^ "\n") fun makeU s = let fun f (i, x) = Set.union (followPos sub i, x) in fold f (Set.forall posSet) Set.empty end (* makeU *) val U = makeU posSet val _ = print (" U=" ^ (Set.makeString U) ^ "\n") fun FindInsert st u = let val dummy = ST{posSet = u, stId = 0, trans = []} in (table.lookup(dummy, st), st, unmarked) handle table.notfound _ => let val u' = ST{posSet = u, stId = !cnt, trans=[]} val st' = table.insert(u', st) in inc cnt; (u', st', unmarked@[u]) end end (* FindInsert *) val (ToState, states', unmarked') = FindInsert states U val trans' = TR(cSet, ToState)::trans in eachChar states' unmarked' trans' (AlphaSet.difference (allchar, cSet)) end (* eachChar *) val (states', unmarked', trans') = eachChar states unmarked [] allchar val dummy = ST{posSet = T, stId = 0, trans = []} val ST{stId = Tid,...} = table.lookup(dummy, states') val s = ST{posSet = T, stId = Tid, trans = trans'} val states2 = table.insert(s, states') in build_auto states' (tl unmarked') end (* build_auto *) val {fp = st',...} = info aug_re val startstate = ST{posSet = st', stId = 0, trans = []} val stTable = table.insert (startstate, table.empty) val autoList = build_auto stTable [st'] in autoList end fun Print re = let val depth = ref 0 fun printInfo ({fp, lp, null} : InfoTy) = ( print "Fpos="; print (Set.makeString (fp)); print " Lpos="; print (Set.makeString (lp)); if null then print " nullable\n" else print "\n" ) fun Pr (AugCONCAT(inf, re_l)) = ( print "CONCAT "; printInfo inf; app Pr1 re_l ) | Pr (AugALTERNATE(inf, re_l)) = ( print "ALTERN "; printInfo inf; app Pr1 re_l ) | Pr (AugSTAR(inf, re)) = ( print "KLEENE "; printInfo inf; Pr1 re ) | Pr (AugPLUS(inf, re)) = ( print "POSITV "; printInfo inf; Pr1 re ) | Pr (AugOPTION(inf, re)) = ( print "OPTION "; printInfo inf; Pr1 re ) | Pr (AugLETTER(inf, _)) = ( print "LETTER "; printInfo inf ) | Pr (AugAUG(inf)) = ( print "AUGMEN "; printInfo inf ) and Pr1 x = let val i = ref 0; in ( while (!i) < (!depth) do (print " "; inc i); inc depth; Pr x; dec depth ) end in Pr1 re end; end; structure RRP_Test = Reg_ExpFn(); open RRP_Test; val a = LETTER(AlphaSet.singleton "a") val b = LETTER(AlphaSet.singleton "b") val c = LETTER(AlphaSet.singleton "c") val d = LETTER(AlphaSet.singleton "d") val a_b_c = ALTERNATE([a, b, c]); val aug = re_to_Aug a_b_c; Print (#aug_re aug); val fol = Aug_to_Follow aug; prFollow fol; print "Before Build_FSM\n"; val t = Build_FSM(aug, fol); print "\n\n\n"; val abc = CONCAT([a, b, c]); val aug' = re_to_Aug abc; Print (#aug_re aug'); val fol' = Aug_to_Follow aug'; prFollow fol'; val t' = Build_FSM(aug', fol'); Status: fixed in 0.64 ------------------------------------------------------------------------------- Number: 262 Title: Using the LIBRARY with v0.62 Keywords: Submitter: "Soren P. Christensen" Date: 8/8/90 Problem: I just tried to build the library found in /dist/ml/LIBRARY.tar.Z and this fails. We are using a spark version of 0.62. I am not dependent on the Library and the reson I report this is only so that you can use it in your testing. I had to make small changes like the definition of the quit function by means of cleanup. 1) There seems to be problems with the exceptions. --------------- Transcript: Standard ML of New Jersey, Version 0.62, 1 August 1990 val it = () : unit - fn () => (() handle Interrupt=>()); val it = fn : unit -> unit - exception xx = Interrupt; std_in:3.16-3.24 Error: unbound exn: Interrupt - raise Interrupt; std_in:1.7-1.15 Error: unbound variable Interrupt std_in:1.1-1.15 Error: argument of raise is not an exception raised: undef in expression: raise Interrupt ---------------- 2) later on it terminates with a runbind, I think this is related to the exceptions too. Comments: (1) The Interrupt exception constructor has gone away, and Interrupt handling should be replaced by handling the interrupt signal. (2) The runbind exception seems to be a genuine bug. Status: fixed in 0.65 ------------------------------------------------------------------------------- Number: 263 Title: problem with input via datakit con Keywords: Submitter: pjw Date: 8/8/90 Transcript: con tempel connected to tempel.mesgdcon on /net/dk/4 $ cd /usr/dbm/sml/60/src $ sml Standard ML of New Jersey, Version 0.60, 13 July 1990 val it = () : unit - -3; std_in:2.1 Error: nonfix identifier required std_in:2.1-2.2 Error: operator and operand don't agree (tycon mismatch) operator domain: 'Z * 'Z operand: int in expression: - 3 std_in:2.1 Error: overloaded variable "-" cannot be resolved uncaught Io exception (Loader): input "": negative character count $ Status: fixed in 0.65 -------------------------------------------------------------------------------- Number: 264 Title: No type-explicitness check in nj-sml Keywords: modules, signatures, type-explicitness Submitter: David Turner Date: 7/8/90 Version : SML of NJ 0.56 and 0.59 System : Sun Severity : Dunno, but its pretty anti-social Problem : The compiler doesn't seem to check for type explicitness in signatures (see section 5.8 and also rule 65 of the ML definition). This means many signatures which can never be matched are still accepted as valid signatures. Transcript : - signature X = sig type t val x : t type t end; signature X = sig type t val x : ?.t end Status: fixed in 0.73 -------------------------------------------------------------------------------- Number: 265 Title: strong type variables accepted in exception declarations Keywords: types, exceptions, weak types Submitter: Dave Berry, db@lfcs.ed.ac.uk Date: 8/7/90 Version: 0.56, 0.59 Severity: Minor (although it presumably means that the type system can be broken!) Problem: The compiler doesn't reject applicative type variables in exception declarations. Code: val id: 'a -> 'a = let exception dummy of 'a in fn x => x end; Transcript: The above code produces: val id = fn : 'a -> 'a Status: fixed in 0.65 -------------------------------------------------------------------------------- Number: 266 Title: uncaught Io exception in use Keywords: From: John Reppy Date: 8/6/90 System: 0.62 Problem: I've noticed the following new (I think) bug. An Io error in use results in an uncaught exception. Standard ML of New Jersey, Version 0.62, 1 August 1990 val it = () : unit - use "foo"; [cannot open foo] uncaught exception Io "open_in "foo": open failed, No such file or directory" The problem is that in "use_file" in build/interact.sml (line 307), the exception Io gets re-raised. Was this changed for the debugger? [dbm, 8/30/90] Fixed so that exceptions are handled even for nonterminal input. Status: fixed in 0.65 ------------------------------------------------------------------------------- Number: 267 Title: sharing again Keywords: modules, functors, signatures, sharing From: Simon Finn Date: 8/2/90 Version: d64 Problem: The following program breaks Poly/ML v1.88 and NJML v0.44a (the most recent version to which I have access). Code: signature S1 = sig eqtype t val x : t end; signature S2 = sig structure A : sig end structure C : sig structure A : S1 end sharing A = C.A end; functor F(structure A:S1 structure B:S2 sharing A = B.A) = struct val y = (A.x = B.C.A.x) end; Transcript: Standard ML of New Jersey, Version d64, ? August 1990 val it = () : unit - signature S1 = sig eqtype t val x : t end signature S2 = sig structure A : sig...end structure C : sig...end end std_in:21.11-21.25 Error: operator and operand don't agree (tycon mismatch) operator domain: ?.t * ?.t operand: ?.t * ?.t in expression: = (A.x,B.C.A.x) Comment: This program is valid, since structure A shares with B.A which shares with B.C.A, hence A.t and B.C.A.t must be the same (equality) type. However: [dbm, 11/11/97] Not a bug in SML '97. Status: fixed in 0.73 -------------------------------------------------------------------------------- Number: 268 Title: import, equality Keywords: modules, functors, equality Submitter: Jason Fischl Date: 4/9/90 Version: 0.44 System: Sparcstation 1 Severity: major Problem: The module system has a bug in it with regard to equality types (I think). The following is a pretty concise description of what will cause the bug to occur. Code: (*-----------------FILE: term.sig.sml----------------------*) signature termsig = sig datatype term = Const of string | Var of string | Func of string * term list end; (*--------------FILE: term.sml-------------------------*) import "term.sig"; functor termFC ():termsig = struct datatype term = Const of string | Var of string | Func of string * term list end; (*------------FILE: parse_term.sml---------------------------*) import "term.sig"; functor parse_termFC (structure TERM:termsig) = struct open TERM fun term_nil x = (x:term list) = [] end; (*---------------------------------------*) Transcript: - import "parse_term"; [parse_term.bin is out of date; recompiling] [reading parse_term.sml] [reading term.sig.bin... done] parse_term.sml, line 11: Error: Compiler bug: tycStamp equal: type = ?.term list import: code generation failed [closing parse_term.sml] IMPORT failed (codegen) - Comments: I couldn't find any reference to it in the bug reports so I had to assume it was all new. It would have been much nicer if the error message had been a bit more descriptive. All I knew was that it was a type problem. There was no info as to which line the error occurred on or which function or anything really. I would appreciate a reply at some point if you could manage since I am curious as to the nature of my problem. Undoubtedly it will get me again! Fix: In order to fix the problem I had to define the fun term_nil inside the term functor and then also put it in the termsig signature. This took me on the order of 8 hours to figure out! Status: fixed in 0.65 --- (before) ------------------------------------------------------------------------------- Number: 269 Title: failure in abstractBody with embedded signature Keywords: modules, functors, signatures Submitter: Dave MacQueen Date: 8/29/90 Version: 0.63 Code: functor F() = struct datatype d = D structure A : sig type s val x : s * d end = struct datatype s = MKs val x = (MKs,D) end end; structure B = F(); val (_,B.D) = B.A.x; Transcript: - use "bug269.sml"; [opening bug269.sml] functor F : structure B : sig structure A : sig...end datatype d con D : d end bug269.sml:16.5-16.19 Error: pattern and expression in val dec don't agree (tycon mis match) pattern: B.A.s * B.d expression: B.A.s * ?.d in declaration: (_,D) = B.A.x [closing bug269.sml] Status: fixed in 0.65 ------------------------------------------------------------------------------- Number: 270 Title: Compiler bug: TypesUtil.lookTycPath: NULLstr Keywords: modules, functors Submitter: Dave MacQueen Date: 8/29/90 Version: 0.63 Problem: failure to interpret path for X.d in embedded signature Formal paramter X was not bound properly. Code: functor F(X: sig datatype d = A end) = struct structure S : sig val x : X.d end = struct val x = X.A end end Status: fixed in 0.65 ------------------------------------------------------------------------------- Number: 271 Title: secondary compiler bug Keywords: modules, functors, error recovery Submitter: Gary T. Leavens leavens@bambam.cs.iastate.edu Date: 8/29/90 Version: 0.64 System: HP 9000/370, HP-UX 7.0 Severity: minor Problem: get compiler bug report Code: the following in a file "report" signature IntMapSig = sig type 'a map val apply: ('a map)*int -> 'a exception NotFound end; signature ValueSig = sig type value end; signature SymbolSig = sig type sym val hash: sym -> int end; functor SymTblFct(structure IntMap: IntMapSig structure Val: ValSig structure Sym: SymSig): sig type table exception Lookup val lookup: table * Sym.sym -> Val.value val update: table * Sym.sym * Val.value -> table end = struct datatype table = TBL of (Sym.sym * Val.value)list IntMap.map exception Lookup fun find(sym,[]) = raise Lookup | find(sym,(sym',v)::rest) = if sym = sym' then v else find(sym,rest); fun lookup(TBL map, s) = let val n = Sym.hash(s) val l = IntMap.apply(map,n) in find(s,l) end handle IntMap.NotFound => raise Lookup (* ... *) end; Transcript: a transcript of session illustrating problem follows Standard ML of New Jersey, Version 0.64, ? August 1990 val it = () : unit - [opening report] signature IntMapSig = sig type 'a map exception NotFound val apply : 'a map * int -> 'a end signature ValueSig = sig type value end signature SymbolSig = sig type sym val hash : sym -> int end report:20.20-20.25 Error: unbound signature: ValSig [closing report] std_in:1.1 Compiler Bug: ModUtil.shiftStamps.newEnv - bad arg - Comments: obviously the code has bugs, but I thought you'd want to see the "compiler bug" anyway, since it may be triggered by the bugs in the program. Status: fixed in 0.65 ------------------------------------------------------------------------------- Number: 272 Title: generalizing user bound type variables Keywords: types, polymorphism Submitter: Elsa Date: 9/7/90 Version: 0.65 Problem: user bound variables are occurring in the final type of a function. Code: fun f(x) = let val y : 'a -> 'a = x in y y end; Transcript: - fun f(x) = let val y : 'a -> 'a = x in y y end; val f = fn : ('aU -> 'aU) -> 'a -> 'a - f (fn x: 'a => x); std_in:2.1-2.16 Error: operator and operand don't agree (bound type var) operator domain: 'aU -> 'aU operand: 'aU -> 'aU in expression: f ((fn : 'aU => x)) Comments: Error should be detected when function f is defined, rather than when it is applied. Test: bug272.sml Status: fixed in 0.70 ------------------------------------------------------------------------------- Number: 273 Title: generalizing weak variables inside fn abstractions Keywords: types, weak types, polymorphism Submitter: Dave MacQueen Date: 10/3/90 Version: 0.52 and earlier Problem: let-bound variables were being generalized with too strong a weak type. Transcript: - val x = fn y => let val f = ref in f end; val x = fn : 'a -> '3b -> '3b ref Comments: Second bound type variable should be '2b instead of '3b. Fix: Added abs field to POLYty constructor to remember abstraction level at point where type generalization took place. Status: fixed in 0.53 ------------------------------------------------------------------------------- Number: 274 Title: weakness lost with flex record pattern Keywords: types, weak types, polymorphism Submitter: Colin Meldrum Date: 3/19/90 Version: 0.66 Problem: flex record patterns can cause weakness to be dropped, resulting in whole in type system. Code: - val a = let val foo = ref nil in (fn x as {...} => foo:=[x] | (y,z) => (); foo) end > val a = ref [] : ('a * 'b) list ref Comment: This is very unsafe and can for example allow the definition of a 'cast' function... fun cast (x) = ((a := (x,0) :: (!a)); #1(hd (!a))); Comment: regression failure. Now results in compiler bug. See also 1066. bug274E.sml:4.7-4.24 Warning: value restriction prevents type variable generalization : 'Z Error: Compiler bug: PickMod: uninstatiated VARty in pickmod Test: bug274.sml Status: fixed in 109.26 [dbm, 3/18/97. see bug 1066] ------------------------------------------------------------------------------- Number: 275 Title: illegal token with structure named ? Keywords: modules Submitter: Nick Rothwell Date: 3/16/90 Version: ? Transcript: - structure ? = struct val x = 3 end; [succeeds] - ?.x; [fails with "illegal token"] - let open ? in x end; [succeeds] Status: fixed in 0.66 ------------------------------------------------------------------------------- Number: 276 Title: overriding included value spec Keywords: modules, signatures, include Submitter: Dave Berry (db@lfcs.ed.ac.uk) Date: 3/22/90 Version: 0.66 Severity: major Problem: If a value spec in an included signature is redefined in the including signature, the value identifier keeps the type from the included signature, but it is printed as the type from the including signature. Transcript: signature Foo1 = sig val foo: string end; signature Foo2 = sig include Foo1 val foo: bool end; structure Foo: Foo2 = struct val foo = true end; Error: value type in structure doesn't match signature spec name: foo spec: string actual: bool Comments: Note: Once I worked out what was going on I was actually grateful, because I hadn't realised that the names clashed. Perhaps it would be useful if implementations could warn about such cases? Test: bug276.1.sml, bug276.2.sml Status: fixed in 0.73 ------------------------------------------------------------------------------- Number: 277 Title: incorrect "inconsistent equality property" error Keywords: modules, functors, equality Submitter: dbm Date: 3/16/90 Version: 0.66 Severity: major Problem: Code: bug277.sml signature S1 = sig type d end; functor F(X: S1) : sig datatype a = C of X.d end = struct datatype a = C of X.d val f = fn (x : a) => x end; Transcript: bug277.sml: 11.3-11.24 Error: inconsistent equality properties (2) Status: fixed in 0.73 ------------------------------------------------------------------------------- Number: 278 Title: local structure declaration at top level Keywords: modules, top level, local Submitter: R. M. O'Neill (cmp7130@sys.uea.ac.uk) Date: 4/3/90 Version: 0.44a System: Sun 3/50 & 3/160S SunOS 3.5 Severity: Minor (but, should be easy to fix and I would prefer it fixed) Problem: Using 'local ... in ... end' with structures does not work at the top level, but does work when wrapped in a 'struct ... end' construct Code: local structure Internal = struct val x=1 val y=2 end in structure First : sig val x : int end = Internal structure Second : sig val y : int end = Internal end [** As a TOP-LEVEL declaration **] Transcript: - local = structure Internal = struct val x=1 val y=2 end Error: expected IN, found STRUCTURE Error: expected END, found STRUCTURE = in Error: declaration or expression expected, found IN - structure First : sig val x : int end = Internal = structure Second : sig val y : int end = Internal Error: unbound structure name: Internal Error: unmatched val spec: x = end ; Error: unbound structure name: Internal Error: unmatched val spec: y Error: declaration or expression expected, found END - Compare-With: - structure Kludge = struct = local = structure Internal = struct val x=1 val y=2 end = in = structure First : sig val x : int end = Internal = structure Second : sig val y : int end = Internal = end = end ; structure Kludge : sig structure First : sig...end structure Second : sig...end end - Comments: Parser problem ? ( Expecting an 'ldec' rather than an 'sdec' ? ) [ I'm no SML internal workings guru !] Status: fixed in 0.66 ------------------------------------------------------------------------------- Number: 279 Title: big integers causing uncaught exception Keywords: Submitter: John Reppy (jhr@cs.cornell.edu) Date: 4/4/90 Version: 0.55 System: ? Severity: major Problem: There seems to be a problem in the compiler with integers that are larger than 2^29-1. Transcript: Standard ML of New Jersey, Version 0.55, 1 April 1990 val it = () : unit - fun f (i : int, two_i : int) = ( = print i; print ": "; print two_i; print "\n"; f(i+1, two_i+two_i)); val f = fn : int * int -> 'a - f(0, 1); 0: 1 1: 2 2: 4 3: 8 ... 27: 134217728 28: 268435456 29: 536870912 uncaught exception - 536870912; uncaught exception - 536870911; val it = 536870911 : int Status: fixed in 0.66 on mipsb ------------------------------------------------------------------------------- Number: 280 Title: included infix specs not printed Keywords: modules, signatures, include, infix Submitter: John Reppy Date: 4/17/90 Version: 0.56 Severity: minor Problem: I noticed that if you include a signature that contains an infix specification, the infix specification doesn't get printed. Code: Transcript: - signature S1 = sig infix ## end; signature S1 = sig infix 0 ## end - signature S2 = sig include S1 end; signature S2 = sig end Status: fixed in 0.73 ------------------------------------------------------------------------------- Number: 281 Title: Import bombs out when it can't find files. Keywords: Submitter: Richard O'Neill (cmp7130%sys.uea.ac.uk@nsfnet-relay.ac.uk) Date: 7/17/90 Version: 0.59 System: Sun3, SunOS 4.1 Severity: You decide... Problem: Importing new files (ones which do not already have a '.bin' file) fails (with an uncaught exception) whilst attempting to import files which do not exist produces the same unfriendly message. Transcript: unix% ls file.sml unix% sml Standard ML of New Jersey, Version 0.59, 4 June 1990 - import "file"; uncaught exception SystemCall - import "nofile"; uncaught exception SystemCall - Perceived Reason: The timeFile function in sepcomp/importer.sml believes that the SysIO.mtime function will raise an Io exeption if it cannot find the file. In fact this exception is never returned by any of the routines in the SysIO module. When they encounter a problem they raise the SystemCall exception. Fix (currently untried): Option 1: Change the code for timeFile to trap the SystemCall exeption instead of the Io exception. e.g. *** sepcomp/importer.sml.orig Fri Jun 1 14:08:02 1990 --- sepcomp/importer.sml Tue Jul 17 10:29:22 1990 *************** *** 159,165 **** in SOME sec end ! handle (Io _) => NONE fun createBinary(indent, filename, statModule: statModule, --- 159,165 ---- in SOME sec end ! handle (SystemCall _) => NONE fun createBinary(indent, filename, statModule: statModule, Option 2: Create a new exception SysIO wich the module SysIO raises on failure and trap that. ( This is to my mind better since SystemCall is a rather wide exception to be trapping ). Status: fixed in 0.73 ------------------------------------------------------------------------------- Number: 282 Title: 'sharable' & 'pervshare' compilers produce different .bin Keywords: Submitter: Richard O'Neill (cmp7130%sys.uea.ac.uk@nsfnet-relay.ac.uk) Date: 7/23/90 Version: 0.60 System: Sun3/50, SunOS 4.1 Severity: You decide... Problem: The 'bin' files produced by the normal and the '-pervshare' versions of the compiler are different and each 'version' cannot load the other's '.bin' file reliably. Perhaps I have built the two versions differently, but I cannot see how since they were both built at the same time with the same .mo files (compiled with the 0.59 batch compiler). Below is a comprehensive transcript which should help in reproducing the bug, if it can be reproduced... Transcript: unix% cat > bug.sml functor test () = struct val it = "testing, testing, 1, 2, 3..." end unix% sml.pervshare Standard ML of New Jersey, Version 0.60, 13 July 1990 val it = () : unit - import "bug"; [reading bug.sml] [writing bug.bin... done] [closing bug.sml] functor test - ^D unix% sml.sharable Standard ML of New Jersey, Version 0.60, 13 July 1990 val it = () : unit - import "bug"; [reading bug.bin... done] [Major collection... 99% used (530424/535668), 1500 msec] [Increasing heap to 6920k] [Major collection... 100% used (530424/530424), 1400 msec] [Increasing heap to 11160k] [Major collection... 100% used (530424/530424), 1400 msec] [Increasing heap to 17520k] [Major collection... 100% used (530424/530424), 1400 msec] [Increasing heap to 22288k] [Major collection... 100% used (530424/530424), 1400 msec] [Increasing heap to 22656k] [Major collection... 100% used (530424/530424), 1420 msec] [Increasing heap to 22744k] [Major collection... 100% used (530424/530424), 1400 msec] [Increasing heap to 22752k] [Major collection... 100% used (530424/530424), 1400 msec] Warning: can't increase heap Ran out of memory unix% mv bug.bin bug.bin.sharable unix% sml.sharable Standard ML of New Jersey, Version 0.60, 13 July 1990 val it = () : unit - import "bug"; [reading bug.sml] [writing bug.bin... done] [closing bug.sml] functor test - ^D unix% sml.pervshare Standard ML of New Jersey, Version 0.60, 13 July 1990 val it = () : unit - import "bug"; [reading bug.bin... done] functor test - structure Test=test (); insttyc: NULLtyc Error: Compiler bug: Functor.applyFunctor.insttyc - ^D unix% mv bug.bin bug.bin.pervshare unix% cmp bug.bin.sharable bug.bin.pervshare bug.bin.sharable bug.bin.pervshare differ: char 62, line 2 unix% ll bug.bin.* -rw------- 1 cmp7130 1415 Jul 23 10:21 bug.bin.pervshare -rw------- 1 cmp7130 17331 Jul 23 10:18 bug.bin.sharable Status: not a bug --- (defunct feature) ------------------------------------------------------------------------------- Number: 283 Title: openread (run.c) checking Keywords: Submitter: Peter Weinberger Date: 8/17/90 Version: ? Severity: minor Problem: openread() in run.c does not check to see if it runs off the end of its allowed space. Comments: in practice, this shouldn't be a problem, since openread() only reads the first two or three mo files, which should be smaller than the initial heap size. Status: fixed in 0.74 ------------------------------------------------------------------------------- Number: 284 Title: Poor type specification handling in mutually recursive functions. Keywords: types Submitter: Richard O'Neill (rmo%sys.uea.ac.uk@nsfnet-relay.ac.uk) Date: 8/14/90 Version: 0.64, 0.62, 0.56, ... System: Sun3/180, SunOS 4.1 Problem: When processing mutually recursive functions, Sml of NJ's current type mechanism prefers its own inferred types of functions to those specifically declared by the user. Code: type 'a foobar = {foo:'a, bar:'a} fun Foo (acc : 'a list foobar) (nil : 'a list) = acc | Foo {foo, bar} (h :: t) = Bar {foo=(h :: foo), bar=bar} t and Bar (acc : 'a list foobar) (nil : 'a list) = acc | Bar {foo, bar} (h :: t) = Foo {foo=foo, bar=(h :: bar)} t Transcript: unix% sml Standard ML of New Jersey, Version 0.64, 24 August 1990 val it = () : unit - use "code.sml"; [opening code.sml] type 'a foobar = {bar:'a,foo:'a} val Foo = fn : 'a list foobar -> 'a list -> 'a list foobar val Bar = fn : {bar:'a list,foo:'a list} -> 'a list -> 'a list foobar [closing code.sml] - - (* One would expect Foo & Bar to have the SAME type *) Comments: The type system seems to be deciding on the type of 'Bar' when it encounters it in the definition of 'Foo', and then sticking to that. Whilst it checks to see whether the type in the declaration of foo matches the type it has inferred, it does not change the 'Foo's type to be in line with its declaration. One can work around the problem by making sure that 'Bar' has the desired type the first time it is encountered. Thus, if Foo is defined as :- fun Foo (acc : 'a list foobar) (nil : 'a list) = acc | Foo {foo,bar} (h :: t) = Bar ({foo=(h :: foo), bar=bar} : 'a list foobar) t the correct types result :- type 'a foobar = {bar:'a,foo:'a} val Foo = fn : 'a list foobar -> 'a list -> 'a list foobar val Bar = fn : 'a list foobar -> 'a list -> 'a list foobar My (ancient) version of Poly/ML also exhibits the same behaviour. Status: not a bug; type abbreviations are not new types ------------------------------------------------------------------------------- Number: 285 Title: Bus error Keywords: modules Submitter: Alain Deutsch, Laboratoire d'Informatique, LIX, Ecole Polytechnique, 91128 Palaiseau Cedex, France. Date: 8/30/90 Version: Standard ML of New Jersey, Version 0.56, 13 April 1990 System: ULTRIX V4.0 (Rev. 174) System #1: Sat Feb 10 01:14:11 MET 1990 UWS V4.0 (Rev. 164) Severity: critical Problem: Bus error. Code: use "bug.sml"; (see enclosed files below, tarmail format) Transcript: Standard ML of New Jersey, Version 0.56, 13 April 1990 Warning: input and output are now uncurried, arithmetic exceptions are re-arranged, div and mod are different; see doc/NEWS val it = () : unit - [opening /usr/users/lix/icsla/deutsch/ModeleSemantique/Bug/bug.sml] [opening Extensions.sml] type 'a printer = outstream * 'a -> unit type 'a transformer = 'a -> 'a [closing Extensions.sml] val it = () : unit [opening Utilities.sig.sml] signature Utilities = sig val assoc : ''a * (''a * 'b) list -> 'b option val butlast : 'a list -> 'a list val cartesian_product : 'a list * 'b list -> ('a * 'b) list val display_list : string * string * string * 'a printer -> 'a list printer val display_pair : string * string * string * 'a printer * 'b printer -> ('a * 'b) printer val error : string * string -> 'a val is_prefix : ''a list * ''a list -> bool val makestring_list : string * string * string * ('a -> string) -> 'a list -> string val member : ''a * ''a list -> bool val replace_prefix : (''a list * ''a list) * ''a list -> ''a list val update_alist : ''a * 'b * (''a * 'b) list -> (''a * 'b) list end [closing Utilities.sig.sml] val it = () : unit [opening Strings.sig.sml] signature Strings = sig type T val < : T * T -> bool val Display : T printer val Hash : T -> int val MakeString : T -> string val New : string -> T end [closing Strings.sig.sml] val it = () : unit [opening Aliases.sig.sml] signature Aliases = sig type Aliases type Path datatype Accessor con IntAcc : int -> Accessor con NamedAcc : string -> Accessor val ++ : Path * Accessor -> Path val Add : Path * Path -> Aliases transformer val Adds : Path list * Path list -> Aliases transformer val Aliased : Path * Path -> Aliases -> bool val Aliases : Path * Aliases -> Path list val DisplayAccessor : Accessor printer val DisplayPath : Path printer val MakeStringAcc : Accessor -> string val MakeStringPath : Path -> string val NewPath : Accessor list -> Path val PathDrop : Path * int -> Path val PathLength : Path -> int val PathNth : Path * int -> Accessor val Remove : Path list -> Aliases transformer val SetVariable : Path * Path -> Aliases transformer end [closing Aliases.sig.sml] val it = () : unit [opening Object.sig.sml] signature Object = sig type T val Display : T printer end [closing Object.sig.sml] val it = () : unit [opening OrderedSet.sig.sml] signature OrderedSet = sig type T val < : T * T -> bool val Display : T printer end [closing OrderedSet.sig.sml] val it = () : unit [opening Map.sml] Map.sml:125.6-127.68 Warning: match not exhaustive tree ((key,_),_,empty,_) => ... tree ((key,_),_,nonempty_subtree,_) => ... pid 4566 (sml) was killed on unaligned access, at pc 0x6016e0 Process SML bus error Comments: The files loaded in "use.sml" are indeed necessary to reproduce the bug. Removing any one of them suppresses that particular occurence of the bug, bug, but only shifts the problem. Fix: Perhaps the GC, as suggested by the vanishing nature of the bug. Enclosed files: see bug285.tarmail Status: fixed in 0.73 (approximately) ------------------------------------------------------------------------------- Number: 286 Title: Compiler bug: inststr NULLstr Keywords: Submitter: Bob Harper (Robert.Harper@cs.cmu.edu) Date: 9/6/90 Version: ? Severity: minor Problem: Compiler bug secondary error Code: functor AbsSyn( structure Id : ID and UnOp : UNOP and BinOp : BINOP ): ABSSYN = struct end; structure AbsSyn : ABSSYN = AbsSyn( structure Id = Id ); (* because I forgot to add in the extra parameters *) Transcript: The result on execution is: /tmp/sml.tmp.k01743:2.5-2.10 Error: unmatched structure spec: UnOp /tmp/sml.tmp.k01743:2.5-2.10 Error: unmatched structure spec: BinOp Error: Compiler bug: inststr NULLstr Status: fixed in 0.70 ------------------------------------------------------------------------------- Number: 287 Title: cosine function incorrectly defined Keywords: Submitter: Valerio Pinci Date: 9/6/90 Version: 0.62 System: Sparc Station 1, SUN OS 0.43 Severity: major Problem: cos function returns wrong values. Code: cos 0.0; Transcript: - cos 0.0; val it = 0.0 : real Fix: In boot/math.sml, change "fun cos x = sin(PI-x)" to "fun cos x = sin(PIo2-x)". Status: fixed in 0.66 ------------------------------------------------------------------------------- Number: 288 Title: extraneous "match not exhaustive" warning Keywords: Submitter: John (jhr@cs.cornell.edu) Date: 9/8/90 Version: 0.64 System: sun-4 Severity: minor Problem: extraneous "match not exhaustive" warning Code: Transcript: Standard ML of New Jersey, Version 0.64, 24 August 1990 val it = () : unit - fun f 0 = 0 | f i = 1; std_in:1.5-1.21 Warning: match not exhaustive val f = fn : int -> int - fun f 0 = 0 | f _ = 1; std_in:3.5-3.21 Warning: match not exhaustive val f = fn : int -> int - f 5; val it = 1 : int Comments: [Appel] I tried this on version 0.64 on our dec 5810, and it works fine (no extraneous "match not exhaustive" messages). Was yours a profiling version or something like that? I tried it on a sun-4 here (version 0.64) and the bug did not show up, so it's not machine-specific. Status: fixed in 0.69 ------------------------------------------------------------------------------- Number: 289 Title: 0.65 prerelease core dumps Keywords: Submitter: Bob Ballance (ballance@cascade.cs.unm.edu Date: 9/13/90 Version: 0.65 System: ? Severity: critical Problem: core dump Code: >>>>>>>>>> Sample file --- Causes failure of 0.65. Running "agcd" after failed load causes core dump.<<<<<<<<< (* * Stephen R. Wheat, 9/6/90 * CS550 - HW1 *) (* * Find the greatest common divisor *) fun gcd(1,b) = 1 (* avoid an endless situation *) | gcd(a,1) = 1 (* avoid an endless situation *) | gcd(0,b) = b (* most likely the one evenly divides the other *) | gcd(a,0) = a (* most likely the one evenly divides the other *) | gcd(a,b) = if (a '_a) -> '_a stream val cons : '_a * '_a stream -> '_a stream val get : '_a stream -> '_a * '_a stream end Comments: same as 282 Status: not a bug --- (defunct feature) ------------------------------------------------------------------------------- Number: 291 Title: floating point on sparc Keywords: Submitter: Bernard Sufrin Date: 9/18/90 Version: 0.56 System: Sparc Problem: The ``bad'' functions seem to compile incorrectly on Sparc machines but ok on 68020 machines. Looks like >=0.0 is compiled wrongly, but the circumstances are mystifying. Why does the presence of the pair parameter seem to be critical (offset calculation in the machine-specific code-generator?). Code: (* try ??bad(0.0, 0.0) (~0.2) *) fun bad (x, y) l = if l >= 0.0 then x else bad(x+l, y) (~l); fun alsobad (x, y) l = if l>0.0 orelse l=0.0 then x else alsobad(x+l, y) (~l); fun good (x, y) l = if 0.0 <= l then x else good(x+l, y) (~l); fun alsogood x y l = if l >= 0.0 then x else alsogood(x+l) y (~l); Status: fixed in 0.65 ------------------------------------------------------------------------------- Number: 292 Title: debugger and interpreter incompatible Keywords: debugger Submitter: Todd Knoblock Todd@eecs.umich.edu Date: 9/24/90 Version: 0.65 System: Decstation 3100 under bsd AND Sun4/sparc under sunos Severity: Very Minor Problem: Compilation of sml with interpretor and debug packages fails Transcript: command: makeml -decstation bsd -i -debug or makeml -sun4 sunos -i -debug appears to progress normally until [closing dbguser/hio.sml] val it = () : unit [opening dbguser/hstore.sml] [opening debug/weak.sml] Error: Compiler bug: bad primop in interp [closing debug/weak.sml] [closing dbguser/hstore.sml] [closing dbguser/userlevel.sml] Comments: Running the compilation without the -i works on both platforms. If the interpretor and debugger are truly incompatible, then makeml should flag it. (apt) They aren't incompatible: the interpreter was broken. Status: fixed in 0.88, but interpreter breaks elsewhere on debugger code. ------------------------------------------------------------------------------- Number: 293 Title: debug problems Keywords: debugger, emacs Submitter: Todd Knoblock, todd@eecs.umich.edu Date: 9/26/90 Version: SML 0.65, emacs 18.55.1 System: Decstation under ultrix and Sun sparc under sunos Severity: error message: minor, no output: critical Synopsis: I am having two problems with the emacs debug package. The first is quite minor: on start-up on a non-x-display (like my terminal at home), emacs reports the following error when loading sml-init: file mode specification error: (void-variable-x-button-m-left). The second is more serious. When sending to the sml process, I do not get output until I move (c-x o/c-x b) into the process buffer. For example, if I have this in a buffer fun f(0) = 1 | f(x) = x*(f (x-1)); and type c-c c-c, then if sml has not been run before, emacs will bring up a window, and start it properly. However, the only output is Standard ML of New Jersey, Version 0.65, 10 September 1990 val it = () : unit - emacsInit (); cd "/afs/engin.umich.edu/user/t/o/todd/"; [opening /tmp/sml.tmp.a02351] Once I move into the buffer, then I get the rest of the output: val f = fn : int -> int [closing /tmp/sml.tmp.a02351] If sml is already running, and the window is not visible, then sending to the buffer does not cause it to become visible. Comments: If I disable the debugging code, by removing the two "hooks" in sml-init, then the interface works as in the past. I am running emacs version 18.55.1, and have tried it on two platforms: decstation under ultrix, and a sparc under sunos. Finally, it appears that the file outdent.el is redundant now, and could be removed from the distribution. Comments: [apt, 2/1/93] These bugs aren't fixed. The first is just a trivial error message. As to the second: we don't really guarantee that c-c c-c and similar emacs interface tricks will work with the debugger. You could "not a bug" these if you want, though they should get addressed eventually -- I deliberately didn't spend time on minor emacs-related problems last summer. Owner: Status: open ------------------------------------------------------------------------------- Number: 294 Title: weak polymorphic types Keywords: types, weak types, polymorphism Submitter: David Berry Date: 9/24/90 Version: 0.65 Severity: major Problem: The Memo structure in the Library still doesn't compile under SML-NJ 0.65 It compiles under Poly/ML, and is based on a version for Edinburgh ML. Transcript: - use "memo.sml"; [opening memo.sml] [opening ../signatures/Memo.sml] signature Memo = sig val memo : (Nat -> Nat) -> ('a -> Nat) -> (('a -> '_b) -> 'a -> '_b) -> ('a -> '_b) * ('a -> '_b) val memo2 : (Nat -> Nat) -> ('a -> Nat) -> ('_b -> Nat) -> (('a -> '_b -> '_ c) -> 'a -> '_b -> '_c) -> ('a -> '_b -> '_c) * ('a -> '_b -> '_c) val memo3 : (Nat -> Nat) -> ('a -> Nat) -> ('_b -> Nat) -> ('_c -> Nat) -> ( ('a -> '_b -> '_c -> '_d) -> 'a -> '_b -> '_c -> '_d) -> ('a -> '_b -> '_c -> '_ d) * ('a -> '_b -> '_c -> '_d) val version : real end [closing ../signatures/Memo.sml] val it = () : unit memo.sml:41.7-53.33 Error: nongeneric weak type variable memo : (Nat -> Nat) -> ('aU -> Nat) -> (('aU -> '~3Z) -> 'aU -> '~3Z) -> ('aU -> '~3Z) * ('aU -> '~3Z) memo.sml:41.7-53.33 Error: nongeneric weak type variable memo : (Nat -> Nat) -> ('aU -> Nat) -> (('aU -> '~3Z) -> 'aU -> '~3Z) -> ('aU