Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /bugs/trunk/bugs.1001-1200
ViewVC logotype

Annotation of /bugs/trunk/bugs.1001-1200

Parent Directory Parent Directory | Revision Log Revision Log


Revision 944 - (view) (download)

1 : macqueen 944 Number: 1001
2 :     Title: matching exn constructor against valspec fails
3 :     Keywords: signature matching, representation
4 :     Submitter: sestoft@research.att.com
5 :     Date: 3 April 1995
6 :     Version: 107.8
7 :     System: SGI MIPS
8 :     Severity: Compiler bug
9 :     Problem:
10 :    
11 :     Matching an exception constructor against a valspec causes code in
12 :     cps/convert.sml to fail.
13 :    
14 :     Code:
15 :    
16 :     structure S : sig val e : exn end = struct exception e end;
17 :    
18 :     Transcript:
19 :    
20 :     Standard ML of New Jersey, Version 107.8, March 24, 1995 [new runtime]
21 :     - structure S : sig val e : exn end = struct exception e end;
22 :     The lvar 166 is not in the current hashtable!
23 :     Error: Compiler bug: TypeInfo hash table in convert.sml
24 :    
25 :     Comments:
26 :    
27 :     The problem did not come up in `real code', but is a side effect of an
28 :     attempt to understand the implementation of signature matching.
29 :    
30 :     The problem occurs also if the exception takes an argument. Matching
31 :     a value constructor against a valspec works. Both cases were OK in
32 :     0.93.
33 :    
34 :     Fix:
35 :    
36 :     The problem is probably in signature matching (trimmings), in
37 :     representation analysis, or in their interaction.
38 :    
39 :     [Zhong Shao:] The problem is that signature matching didn't generate
40 :     the correct thinning function when an exception is matched against a
41 :     val spec.
42 :    
43 :     The above bug is now fixed by slightly changing the "modules/sigmatch.sml"
44 :     file (based on the version in 107.8). [New sigmatch.sml file supplied.]
45 :    
46 :     Owner: Zhong
47 :     Status: fixed in 107.8+ [dbm]
48 :     ----------------------------------------------------------------------
49 :     Number: 1002
50 :     Title: reappearance of various abstype bugs
51 :     Keywords: abstype
52 :     Submitter: Thomas Yan (tyan@cs.cornell.edu)
53 :     Date: 4/3/95
54 :     Version: 1.07
55 :     System: any
56 :     Severity: major
57 :     Problem: reappearance of various abstype bugs
58 :     Code:
59 :    
60 :     fun foo x = let abstype t1 = T | F with val goo = foo end in goo x end
61 :     and,
62 :     abstype 'a foo = Foo of 'a list with fun test x = (x = Foo []) end
63 :    
64 :     Transcript:
65 :    
66 :     (* see 72, 311, 317 *)
67 :    
68 :     - abstype 'a foo = Foo of 'a list with fun test x = (x = Foo []) end;
69 :     147-159 Error: operator and operand don't agree (equality type required)
70 :     operator domain: ''Z * ''Z
71 :     operand: ''Z * 'Y foo
72 :     in expression:
73 :     = (x,Foo nil)
74 :     type 'a foo
75 :     val test = fn : ''a -> _
76 :     - val a = test 3;
77 :     val a = - : 'a
78 :     - a a;
79 :     Bus Error
80 :    
81 :     Process Inferior eXene exited abnormally with code 138
82 :    
83 :     (* see 936 (middle example, Compiler bug: CoreInfo.coreLty3) *)
84 :    
85 :     - fun foo x = let abstype t1 = T | F with val goo = foo end in goo x end;
86 :     The lvar 139685 is not in the current hashtable!
87 :     Error: Compiler bug: TypeInfo hash table in convert.sml
88 :    
89 :     Comments: (these are on the 72/311/317 variant *)
90 :    
91 :     + according to 311, this should compile; but perhaps 317
92 :     indicates that it should not. i would expect abstypes to
93 :     behave like datatypes inside the "with". so Foo would be
94 :     an eqtype inside, and abstract outside; but 317 shows how
95 :     Foo being an eqtype inside could leak out.
96 :     + note how, despite the error, it is compiled w/ bogus type ''a -> _
97 :     (and hence one can crash the machine)
98 :     + also note the odd location: 147-159, instead of something
99 :     like std_in:147.0-147.60
100 :    
101 :     Owner: dbm
102 :     Status: open
103 :     ----------------------------------------------------------------------
104 :     Number: 1003
105 :     Title: extra newline in non-exhaustive match warning
106 :     Keywords: error message, printing
107 :     Submitter: Thomas Yan (tyan@cs.cornell.edu)
108 :     Date: 4/3/95
109 :     Version: 1.07
110 :     System: all
111 :     Severity: minor
112 :     Problem: extra newline in non-exhaustive match warning
113 :     Transcript: (* note lack of extra newline for non-exhaustive binding *)
114 :     - val 1 = 1;
115 :     std_in:65.1-65.9 Warning: binding not exhaustive
116 :     (1 : int) = ...
117 :     - fn 1 => 2;
118 :     std_in:0.0-0.0 Warning: match nonexhaustive
119 :     (1 : int) => ...
120 :    
121 :     val it = fn : int -> int
122 :     Comments: this can create an annoying additional 50% (3 lines
123 :     instead of 2) of warning messages
124 :     Fix: this is untested, but i think this will work,
125 :     since bindPrint does not print a trailing newline.
126 :     replace matchPrint in mc.sml by:
127 :    
128 :     fun matchPrint (env,rules,unused) = fn ppstrm => let
129 :     fun matchPrint' ([],_,_) = () (* can this happen? *)
130 :     | matchPrint' ([_],_,_) = () (* never print last rule *)
131 :     | matchPrint' (rules,tags,i) = if null tags orelse i <> hd tags
132 :     then matchPrint''(" ",rules,tags,i)
133 :     else matchPrint''(" --> ",rules,tl tags,i)
134 :     and matchPrint''(pre,(pat,_)::more,tags,i) =
135 :     (if i>0 then add_newline ppstrm else ();
136 :     add_string ppstrm pre;
137 :     PPAbsyn.ppPat env ppstrm (pat,!printDepth);
138 :     add_string ppstrm " => ...";
139 :     matchPrint'(more,tags,i+1))
140 :     in add_newline ppstrm;
141 :     begin_block ppstrm CONSISTENT 0;
142 :     matchPrint'(rules,unused,0);
143 :     end_block ppstrm
144 :     end
145 :    
146 :     Owner:
147 :     Status: open
148 :     ----------------------------------------------------------------------
149 :     Number: 1004
150 :     Title: blastIn and blastOut fail on objects containing code
151 :     Keywords: I/O, blastIn, blastOut
152 :     Submitter: Peter Bailey (Peter.Bailey@cs.anu.edu.au)
153 :     Date: 4/5/95
154 :     Version: 107
155 :     Severity: major
156 :     Problem: blastIn and blastOut fail on objects containing code
157 :     Comments:
158 :     [JHR:] I didn't implement this feature as a way to save time, but it
159 :     shouldn't be too much trouble. I'll try to find some time to fix this
160 :     soon (before the next official release).
161 :     Owner: jhr
162 :     Status: open
163 :     ----------------------------------------------------------------------
164 :     Number: 1005
165 :     Title: selecting an integer component from arg to C function
166 :     Keywords: C
167 :     Submitter: Peter Bailey (Peter.Bailey@cs.anu.edu.au)
168 :     Date: 4/5/95
169 :     Version: 107
170 :     Severity: major
171 :     Problem:
172 :     When you call a C function from ML, and are selecting an integer
173 :     component from the argument that is passed (ie. with REC_SELINT ...)
174 :     the INT_MLtoC conversion that is applied fails when the ML integer
175 :     was negative. The code of INT_MLtoC just performs a right shift (>>)
176 :     of the value to undo the boxing representation, and this works fine
177 :     for positive numbers, but fails for negative numbers, give a result
178 :     (on a SPARC running SunOS 4.1.3 with gcc as the compiler) of (2^31)-1.
179 :     I checked through the list of C functions that exist at the moment
180 :     in the C libraries, and all of them that require integers in their
181 :     arguments would be expecting non-negative integers.
182 :     Owner: John
183 :     Status: fixed in 109.21
184 :     ----------------------------------------------------------------------
185 :     Number: 1006
186 :     Title: BitArray.sub raises Ord rather than Subscript
187 :     Keywords: BitArray, exception
188 :     Submitter: Guhan Viswanathan (gviswana@cs.wisc.edu)
189 :     Date: 3/12/95
190 :     System(s) and Version: Library (0.3)
191 :     SML/NJ Version: 1.03f
192 :     Machine: SparcStation, SunOS 4.1.3
193 :     Severity: Minor
194 :     Problem: BitArray.sub raises Ord rather than Subscript
195 :     Transcript:
196 :    
197 :     - structure BA = BitArray;
198 :     structure BA : BIT_ARRAY
199 :     - val b = BA.bitarray 5;
200 :     val b = BA {bits=-,nbits=5} : BitArray.bitarray
201 :     - BA.sub(b, 6);
202 :     uncaught exception Ord
203 :    
204 :     Comments: Also happens with setBit, clrBit
205 :     Owner:
206 :     Status: obsolete - old basis
207 :     ----------------------------------------------------------------------
208 :     Number: 1007
209 :     Title: Compiler bug: applyTyfun: not enough arguments (no functor)
210 :     Keywords: signature matching
211 :     Submitter: Robert Findler (Robert_Findler@INBOX.FOX.CS.CMU.EDU)
212 :     Date: 3/13/95
213 :     Version: 107.7
214 :     Severity: major
215 :     Problem: Compiler bug: applyTyfun: not enough arguments
216 :     Code:
217 :    
218 :     structure S : sig type 'a t = 'a end = struct type 'a t = 'a end;
219 :    
220 :     Comments: see 932, 964. This example doesn't use a functor.
221 :     Owner:
222 :     Status: fixed in 109.20
223 :     ----------------------------------------------------------------------
224 :     Number: 1008
225 :     Title: makeml uses "rm -f" on a directory
226 :     Keywords: makeml
227 :     Submitter: La Monte H. Yarroll <piggy@baqaqi.chi.il.us>
228 :     Date: Mon Feb 21 16:46:58 DST 1994
229 :     System(s) and Version: SML/NJ 0.93 compiler
230 :     SML/NJ Version: 0.93
231 :     Machine: SparcStation, SunOS 4.1.3
232 :     Severity: minor
233 :     Problem: makeml uses "rm -f" on a directory
234 :     Code:
235 :     from src/makeml:
236 :     ...
237 :     echo "$CMD rm -f mo"
238 :     rm -f mo
239 :     ...
240 :     echo "$CMD rm -f mo"
241 :     rm -f mo
242 :     (cd $RUNTIME; eval make clean; rm -f mo)
243 :     fi
244 :    
245 :     exit 0
246 :    
247 :     Transcript: (Made up transcript...)
248 :    
249 :     # rm -f mo
250 :     # fsck /dev/sd01
251 :     Unreferenced inode 294, reattach? (y/n)
252 :     etc...
253 :    
254 :     Comments:
255 :     Certain simple-minded operating systems (e.g. COHERENT) implement rm
256 :     as a simple unlink. On these systems, an ordinary user is prevented
257 :     from removing a directory. The user must use the setuid program
258 :     "rmdir" which checks to make certain that the directory is empty
259 :     before removing it.
260 :    
261 :     If you do not provide the -r (recurse) flag to rm, it will NOT
262 :     recurse. The -f flag (force) tells rm to try to remove even if it
263 :     doesn't think it's a good idea. SO, "rm -f dir" will cause the link
264 :     to "dir" to be removed, usually leaving an inconsistant filesystem,
265 :     (unless there happens to be another hard link pointing at that
266 :     directory tree).
267 :    
268 :     If you are going to remove whole directory trees, it is a REALLY good
269 :     idea to use "rm -rf dir".
270 :    
271 :     Not many systems use V7-style filesystems any more, but the fix is
272 :     harmless on modern filesystems, and saves headaches on the older
273 :     systems.
274 :    
275 :     Fix:
276 :    
277 :     use "rm -rf" instead of "rm -f" throughout makeml.
278 :     Owner: John
279 :     Status: fixed in 109.21
280 :     ----------------------------------------------------------------------
281 :     Number: 1009
282 :     Title: The Makefile for 1.02 assumes that you have . in your PATH
283 :     Keywords: configuration, installation
284 :     Submitter: La Monte H. Yarroll <piggy@baqaqi.chi.il.us>
285 :     Date: Fri Apr 29 15:40:08 EST 1994
286 :     System(s) and Version: SML/NJ 1.02 compiler
287 :     SML/NJ Version: 1.02
288 :     Machine: SparcStation, SunOS 4.1.3
289 :     Severity: minor
290 :     Problem: The Makefile for 1.02 assumes that you
291 :     have . in your PATH.
292 :     Fix:
293 :     It is safe to explicitly add ./ everywhere it's needed.
294 :    
295 :     # arguments:
296 :     # OS = the SML/NJ operating system name (eg, mach)
297 :     # MACHINE = the SML/NJ machine name (eg, decstation)
298 :     # FLAGS = miscellaneous flag options (eg, -gcc)
299 :     # SOFTLIMIT = the softlimit (-m) argument to makeml (eg, 7000)
300 :     # See doc/release-notes/releaseNotes.{dvi,ps,txt} for information
301 :     # on how to set these parameters.
302 :     SOFTLIMIT = 7000
303 :     most: sml-export sml mllex mlyacc sml-tags sml-conn smlsg
304 :     sml-export:
305 :     ./makeml -$(MACHINE) $(OS) $(FLAGS) -m $(SOFTLIMIT) -noshare
306 :     mv sml sml-export
307 :     sml: sml-export
308 :     ./makeml -$(MACHINE) $(OS) $(FLAGS) -m $(SOFTLIMIT) -noclean
309 :     mlyacc: sml-export
310 :     (cd ../tools/mlyacc; make ec; make stand-alone)
311 :     cat ../tools/mlyacc/smlyacc.sml | ./sml-export
312 :     mllex: sml-export
313 :     cat ../tools/lexgen/lexgen.sml ../tools/lexgen/export-lex.sml \
314 :     | ./sml-export
315 :     sml-tags: sml-export
316 :     cat ../tools/gnutags/export.sml | ./sml-export
317 :     sml-conn: sml-export
318 :     cat ../tools/sourcegroup/sml-conn/export.sml | ./sml-export
319 :     smld: sml-export
320 :     ./makeml -$(MACHINE) $(OS) $(FLAGS) -m $(SOFTLIMIT) -debug -noclean
321 :     smlsg: sml
322 :     cat ../tools/sourcegroup/export.sml | ./sml
323 :    
324 :     Owner: John
325 :     Status: fixed in 109.21
326 :     ----------------------------------------------------------------------
327 :     Number: 1010
328 :     Title: Compiler bug tripped by type abbreviations
329 :     Keywords: type abbreviation, signature
330 :     Submitter: Emden R. Gansner, erg@research.att.com
331 :     Date: 11/26/1994
332 :     Version: 1.06
333 :     System: Probably all
334 :     Severity: minor
335 :     Problem: Compiler bug tripped by type abbreviations.
336 :     Code:
337 :     Transcript:
338 :     Standard ML of New Jersey, Version 106, November 1, 1994 [new runtime]
339 :     - signature s = sig
340 :     = type 'a list_item = string * 'a
341 :     = end;
342 :     Error: Compiler bug: Misc.checkbound
343 :     Owner:
344 :     Status: fixed in 109.20
345 :     ----------------------------------------------------------------------
346 :     Number: 1011
347 :     Title: mod operator causes core dump on Alpha
348 :     Keywords: mod, arithmetic
349 :     Submitter: Yizhong Zhou <zhou@puffin.usmcs.maine.edu>
350 :     Date: 1/26/95
351 :     Version: 106
352 :     System: Alpha, OSF/1 1.2
353 :     Severity: major
354 :     Problem:
355 :     Whenever I used mod operator in an expression, the SML aborted with the message
356 :    
357 :     sml/bin/.run/run.alpha32-osf1: Fatal error -- unexpected fault,
358 :     signal = 8, code = 0x10" message
359 :     Comment: [Blume, 3/18/97]
360 :     bug 1011 is still there: the expression (5 mod 0) or (5 div 0) crashes
361 :     sml on the Alpha32x:
362 :    
363 :     $ uname -a
364 :     OSF1 dynamic V3.2 17 alpha
365 :     $ bin/sml-cm
366 :     Standard ML of New Jersey, Version 109.25.2, March 3, 1997 [CM; autoload enabled]
367 :     - 5 mod 0;
368 :     /u/blume/Research/ML/9.25.2/bin/.run/run.alpha32x-osf1: Fatal error -- unexpected fault, signal = 8, code = 0xc
369 :    
370 :     Comment: [Lal, 3/21/97]
371 :     [This] is fixed. I have tested the fix on both Digital Unix and OSF/1
372 :     v3.2.
373 :    
374 :     The problem was that division is being done in floating point
375 :     registers, and floating point divide-by-zero is supposed to return
376 :     inf. The only reliable mechanism to generate an integer divide-by-zero
377 :     trap is to use a call_pal instruction with a gentrap function code.
378 :    
379 :     I therefore test for zero explicitly in the generated code and branch
380 :     to a shared and off-line piece of code that sets up the pal call.
381 :    
382 :     There is a small change required to the runtime system. Signal
383 :     handling under Digital Unix is still screwed up. The machine ucontext
384 :     is not being passed correctly to the signal handler.
385 :    
386 :     Owner: Lal
387 :     Status: fixed in 109.26 [Lal]
388 :     ----------------------------------------------------------------------
389 :     Number: 1012
390 :     Title: Word32.wordToInt and Word32.signExtend raise Overflow
391 :     Keywords: conversion, word
392 :     Submitter: esb@cs.cmu.edu
393 :     Date: Fri Mar 24 10:34:15 EST 1995
394 :     System(s) and Version: SML-SCB (compiler)
395 :     SML/NJ Version: 107.0
396 :     Machine: Mips only
397 :     Severity: minor
398 :     Problem: Word32.wordToInt and Word32.signExtend raise Overflow
399 :     for some values (generally, high bit set)
400 :     Code/Transcript:
401 :     - val (low, high) = (Word32.intToWord 0xde32, Word32.intToWord 0x8002);
402 :     val high = 32770 : Word32.word
403 :     val low = 56882 : Word32.word
404 :     - val x = Word32.orb (Word32.shift (high, 16), low);
405 :     val x = 2147671602 : Word32.word
406 :     - Word32.wordToInt x;
407 :    
408 :     uncaught exception Overflow
409 :     - Word32.signExtend x;
410 :    
411 :     uncaught exception Overflow
412 :    
413 :     Comments: Works fine on the alpha
414 :    
415 :     As of Sept 3, 1997 the Status was "fixed in 109.21", but
416 :     in fact this is not a bug, Overflow should be raised in both cases.
417 :     -- Andrew
418 :    
419 :     Owner: John
420 :     Status: not a bug
421 :     ----------------------------------------------------------------------
422 :     Number: 1013
423 :     Title: types from included signature
424 :     Keywords: include, signature
425 :     Submitter: Edo Biagioni, esb@cs.cmu.edu
426 :     Date: August 15, 1995
427 :     System(s) and Version: Compiler
428 :     SML/NJ Version: 108.3, June 5, 1995 [CM&CMB 1]. Also 108.8
429 :     Machine: Alpha OSF 2.0
430 :     Severity: headache (somewhere between minor and major)
431 :     Problem: Including signatures do not correctly inherit
432 :     type sharing from included signatures.
433 :    
434 :     Transcript:
435 :     edo@apl 6-> sml
436 :     loading /afs/cs.cmu.edu/project/fox-8/member/cline/port/108.3/bin/.heap/sml-ful
437 :     > l
438 :     -cm.alpha32 ......................... done
439 :     Standard ML of New Jersey, Version 108.3, June 5, 1995 [CM&CMB 1]
440 :     val it = () : unit
441 :     - use "test.sml";
442 :     [opening test.sml]
443 :     signature A =
444 :     sig
445 :    
446 :     ...
447 :    
448 :     con D : {extension:x} -> d
449 :     type t
450 :     type b_x
451 :     sharing type x = b_x
452 :     end
453 :     Error: Compiler bug: tycon_eqprop: RELtyc
454 :     -
455 :    
456 :     Comments:
457 :     This may be the same as previously submitted module-system bugs, but it
458 :     looks different. It seems to have at least two different
459 :     manifestations, one being that an object of type In.x simply won't
460 :     unify with one of type In.b_x. To see this, simply change the type
461 :     of field "a" in b_x to be "bool" instead of "t", i.e.
462 :     type b_x = {a: bool, b: int}
463 :     The result is:
464 :     test.sml:24.12-24.43 Error: case object and rules don't agree (tycon mismatch)
465 :     rule domain: In.b_x
466 :     object: In.x
467 :     in expression:
468 :     (case extension
469 :     of {a=a,...} : In.b_x => {1=a})
470 :    
471 :     Code:
472 :     signature A =
473 :     sig
474 :     type x
475 :     datatype d = D of {extension: x}
476 :     end
477 :    
478 :     signature B =
479 :     sig
480 :     include A
481 :     type t
482 :     type b_x = {a: t, b: int}
483 :     sharing type b_x = x
484 :     end
485 :    
486 :     signature C =
487 :     sig
488 :     include B
489 :     end;
490 :    
491 :     functor F (structure In: C) =
492 :     struct
493 :     fun f arg =
494 :     let val In.D {extension} = arg
495 :     val {a, ...}: In.b_x = extension
496 :     in a
497 :     end
498 :     end
499 :    
500 :     Comment: [dbm] now produces "uncaught exception Unbound" indicating a
501 :     probable out of order instantiation problem.
502 :    
503 :     Test: bug1013.sml
504 :     Owner: dbm
505 :     Status: fixed in 109.23 [109.19m]
506 :     ----------------------------------------------------------------------
507 :     Number: 1014
508 :     Title: Compiler bug: Instantiate: simplify
509 :     Keywords: instantiate, signature, modules
510 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
511 :     Date: 02/25/96
512 :     System(s) and Version: Compiler
513 :     SML/NJ Version: 109.4
514 :     Machine: probably all
515 :     Severity: major
516 :     Problem: Compiler bug: Instantiate: simplify
517 :     Code:
518 :    
519 :     Transcript:
520 :    
521 :     Standard ML of New Jersey, Version 109.4, February 21, 1996 [CM&CMB 1]
522 :     GC #0.0.0.0.1.5: (20 ms)
523 :     val it = () : unit
524 :     - signature SIG = sig type t sharing type t = unit end;
525 :     signature SIG =
526 :     sig
527 :     type t
528 :     sharing type t = unit
529 :     end
530 :     - functor F(S : SIG) = struct end;
531 :     Error: Compiler bug: Instantiate: simplify
532 :     - functor F(type t sharing type t = unit) = struct end;
533 :     Error: Compiler bug: Instantiate: simplify
534 :    
535 :     Owner: dbm
536 :     Status: fixed in 109.20
537 :     ----------------------------------------------------------------------
538 :     Number: 1015
539 :     Title: formatting of real numbers is broken
540 :     Keywords: printing, real
541 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
542 :     Date: 12/01/95
543 :     System(s) and Version: Compiler
544 :     SML/NJ Version: 108.16
545 :     Machine: all
546 :     Severity: minor
547 :     Problem: formatting of real numbers is broken
548 :     Code:
549 :     Transcript:
550 :    
551 :     Script started on Fri Dec 01 14:25:40 1995
552 :     sen14_1_sml
553 :     Standard ML of New Jersey, Version 108.16, November 23, 1995 [CM&CMB 1]
554 :     val it = () : unit
555 :     - 0.3;
556 :     val it = 03 : real
557 :     - 1.0;
558 :     val it = 1 : real
559 :     - 1E~6;
560 :     val it = 1e~06 : real
561 :    
562 :     Comments:
563 :    
564 :     The first problem is that the "." separating the fraction from the
565 :     integer part is lost.
566 :     The second problem is one of design. Should real numbers be output
567 :     in a "nice" format or a "useful" format? As it stands now, the output
568 :     (a) omits zero fractions, i.e. ".0", and (b) uses a lower-case "e" for
569 :     exponents. This makes the output illegal as Standard ML input.
570 :    
571 :     The first problem was caused by using the wrong variable name in
572 :     (sml-nj/boot/real-format.sml)realToGenStr: "num" should have been "frac".
573 :    
574 :     Fix:
575 :     *** sml-nj/boot/real-format.sml.~1~ Mon Nov 27 20:08:46 1995
576 :     --- sml-nj/boot/real-format.sml Fri Dec 1 14:32:10 1995
577 :     ***************
578 :     *** 206,218 ****
579 :    
580 :     fun realToGenStr prec r = let
581 :     val {sign, whole, frac, exp} = realGFormat(r, prec)
582 :     ! val expStr = (case exp
583 :     ! of NONE => ""
584 :     ! | (SOME e) => if I.<(e, 0)
585 :     ! then "e~" ^ zeroLPad(atoi(I.~ e), 2)
586 :     ! else "e" ^ zeroLPad(atoi e, 2)
587 :     (* end case *))
588 :     - val num = if (frac = "") then "" else ("." ^ frac)
589 :     in
590 :     concat[sign, whole, frac, expStr]
591 :     end
592 :     --- 206,221 ----
593 :    
594 :     fun realToGenStr prec r = let
595 :     val {sign, whole, frac, exp} = realGFormat(r, prec)
596 :     ! val (frac,expStr) = (case exp
597 :     ! of NONE => ((if (frac = "") then ".0" else ("." ^ frac)), "")
598 :     ! | (SOME e) =>
599 :     ! let val expStr = if I.<(e, 0)
600 :     ! then "E~" ^ zeroLPad(atoi(I.~ e), 2)
601 :     ! else "E" ^ zeroLPad(atoi e, 2)
602 :     ! in
603 :     ! ((if (frac = "") then "" else ("." ^ frac)), expStr)
604 :     ! end
605 :     (* end case *))
606 :     in
607 :     concat[sign, whole, frac, expStr]
608 :     end
609 :    
610 :     Comment [jhr]
611 :     The missing decimal point has already been fixed.
612 :     The question about ".0", I'll have to think about, since it ties into
613 :     the new basis's definition of Real.toString. I think it is likely that
614 :     the syntax of real literals will be liberalized to include "e".
615 :    
616 :     [jhr, 5/20/97]
617 :     The first two cases have been fixed. The third case is no longer
618 :     a bug in printing, but is a bug in the SML/NJ scanner:
619 :    
620 :     - 1E~6;
621 :     val it = 1e~06 : real
622 :     - 1e~06;
623 :     stdIn:16.2 Error: unbound variable or constructor: e
624 :     stdIn:16.1-16.6 Error: operator is not a function [literal]
625 :     operator: int
626 :     in expression:
627 :     (1 : int) <ERRORvar>
628 :     [dbm, 7/13/97]
629 :     All cases are cleared up in 109.29+.
630 :     Owner: John
631 :     Status: fixed in 109.28
632 :     ----------------------------------------------------------------------
633 :     Number: 1016
634 :     Title: datatype representation conflict
635 :     Keywords: datatype, signature, signature matching
636 :     Submitter: Andrew Appel
637 :     Date: 2/24/1994
638 :     Version: ?
639 :     System: ?
640 :     Severity: Major
641 :     Problem: datatype representation conflict when spec and def are identical
642 :     Transcript:
643 :     - signature S = sig type t = int * int datatype a = J of t | K of int end;
644 :     signature S =
645 :     sig
646 :     type t
647 :     datatype a
648 :     con J : t -> a
649 :     con K : int -> a
650 :     end
651 :     - structure H : S = struct type t = int * int datatype a = J of t | K of int en
652 :     d;
653 :     std_in:9.11-9.79 Error: The constructor J of datatype a
654 :     has different representations in the signature and the structure.
655 :     Change the definition of the types carried by the constructors in the
656 :     functor formal parameter and the functor actual parameter so that
657 :     they are both abstract, or so that neither is abstract.
658 :    
659 :     Test: bug1016.sml
660 :     Owner: Zhong
661 :     Status: fixed in 109.23 [109.19m]
662 :     ----------------------------------------------------------------------
663 :     Number: 1017
664 :     Title: another hard-to-read error message
665 :     Keywords: error message, type checking
666 :     Submitter: John Reppy
667 :     Date: 9/17/94
668 :     Version: ?
669 :     Severity: minor
670 :     Problem: another hard-to-read error message
671 :     Transcript:
672 :     effective-pause.sml:159.13-190.7 Error: operator and operand don't agree (tycon mismatch)
673 :     operator domain: {baseName:string, label:string, outFile:string, yMax:real}
674 :     * {baseName:string, label:string, outFile:string, yMax:real}
675 :     list
676 :     operand: {baseName:string, label:string, outFile:string, yMax:real}
677 :     * {baseName:string, label:string, outfile:string, yMax:real}
678 :     list
679 :     Comment:
680 :     If you stare at it long enough, you see that one "outfile" should be "outFile".
681 :     We reallyn need to have more precise messages for mismatches of record/tuple
682 :     types.
683 :     Owner:
684 :     Status: open
685 :     ----------------------------------------------------------------------
686 :     Number: 1018
687 :     Title: subtraction from smallest int doesn't raise Overflow
688 :     Keywords: arithmetic, bounds, overflow
689 :     Submitter: Lorenz Huelsbergen
690 :     Date: 12/4/95
691 :     Version: 108.16
692 :     Severity: Major
693 :     Problem: subtraction from smallest int doesn't raise Overflow
694 :     Transcript:
695 :     - val x = ~1073741824;
696 :     val x = ~1073741824 : int
697 :     - x - 1;
698 :     val it = 1073741823 : int
699 :     Comments: subtraction should raise Overflow
700 :     Fix:
701 :     The problem is the line
702 :    
703 :     fun subt (Immed xi,y,z) = add(y,Immed (~xi),z)
704 :    
705 :     in mips.sml which I think should be:
706 :    
707 :     fun subt (Immed xi,y,z) = addt(y,Immed (~xi),z)
708 :     Owner:
709 :     Status: fixed in 109.19
710 :     ----------------------------------------------------------------------
711 :     Number: 1019
712 :     Title: floats and Word32 in same closure
713 :     Keywords: float, real, Word32
714 :     Submitter: Emden R. Gansner (erg@research.att.com)
715 :     Date: 8 December 1995
716 :     Version: 108.17 (& 109.19)
717 :     System: irix5/sgi
718 :     Severity: minor
719 :     Problem: trips unimplemented feature
720 :     Code:
721 :     fun loop (0, ws, rs) = ()
722 :     | loop (n, ws, rs) = app print [Word32.toString ws, Real.toString rs];
723 :     Transcript:
724 :     Error: Compiler bug: unimplemented int32 + float (nclosure.2)
725 :     Comments: [Zhong Shao, 12/9/95]
726 :     The current version of the compiler does not support putting
727 :     both floats and word32 into the same closure. It's on my to-do list,
728 :     and this will be supported very soon.
729 :     Test: bug1019.sml
730 :     Owner: Zhong
731 :     Status: fixed in 109.28 [Zhong, 4/30/97]
732 :     ----------------------------------------------------------------------
733 :     Number: 1020
734 :     Title: type definitions in signatures not printed by top level
735 :     Keywords: printing, signatures, type abbreviations
736 :     Submitter: Bob Harper
737 :     Date: 12/11/95
738 :     Version: 108.16 - 109.19
739 :     Severity: medium
740 :     Problem: type definitions in signatures not printed by top level
741 :     Code:
742 :     Transcript:
743 :     - signature S = sig type t=int->int val x:t end;
744 :     signature S =
745 :     sig
746 :     type t (* definition got lost *)
747 :     val x : t
748 :     end
749 :     -
750 :     Test: bug1020.sml
751 :     Owner: dbm
752 :     Status: fixed in 109.19m [dbm, 11/15/96]
753 :     ----------------------------------------------------------------------
754 :     Number: 1021
755 :     Title: StringCft.atof doesn't handle large numbers properly
756 :     Keywords: conversion, bounds
757 :     Submitter: David Gladstein (daveg@amnh.org)
758 :     Date: 12/11/95
759 :     System(s) and Version: library 0.2
760 :     SML/NJ Version: 0.93
761 :     Machine: HPPA
762 :     Severity: minor
763 :     Problem: StringCft.atof doesn't handle large numbers properly
764 :     Transcript:
765 :     - StringCvt.atof "300000000000000.000000";
766 :     val it = 829341696.0 : real
767 :     -
768 :     Comment: It crashes on the unsupported Linux port.
769 :     Comment: [Reppy, 12/13/95]
770 :     The basic conversions have been moved into the Standard Basis. In our latest
771 :     version, this example is not a problem:
772 :    
773 :     Standard ML of New Jersey, Version 108.18, December 11, 1996 [new runtime]
774 :     - Real.fromString "300000000000000.000000";
775 :     val it = SOME 3e14 : real option
776 :     Owner:
777 :     Status: fixed in 108.18 (on SGI/IRIX)
778 :     ----------------------------------------------------------------------
779 :     Number: 1022
780 :     Title: image files grow
781 :     Keywords: performance, memory
782 :     Submitter: Tobias Nipkow <nipkow@sunbroy14.informatik.tu-muenchen.de>
783 :     Date: 12/13/95
784 :     Version: ?
785 :     Severity: minor
786 :     Problem:
787 :     If I repeatedly load a fixed ML-file of the form
788 :    
789 :     structure S = struct end;
790 :     open S;
791 :    
792 :     and export the result using exportML, the size of the created binary will be
793 :     proportional to the number of times I loaded the source file. This looks like
794 :     a bug to me. Note that there is no problem if the line "open S" is missing.
795 :     Comments: [Appel, 12/15/95]
796 :     Well, this is a bug, more or less. It's not a trivial bug to fix, however.
797 :     The best solution is to use the Compilation Manager (available with
798 :     version 108.x for any x) for your edit-compile-debug cycle, and avoid
799 :     this top-level-interactive-loop problem entirely.
800 :    
801 :     We may or may not be able to fix this bug in the long run for the
802 :     top-level interactive loop.
803 :     Owner:
804 :     Status: obsolete (or fixed?) [dbm]
805 :     ----------------------------------------------------------------------
806 :     Number: 1023
807 :     Title: Array.extract over zero length arrays.
808 :     Keywords:
809 :     Submitter: Lal George
810 :     Date: 1/6/96
811 :     Version: 108.21
812 :     System: all
813 :     Severity: major
814 :     Problem: Array.extract over zero length arrays.
815 :     Code:
816 :     fun a2v a = Array.extract(a, 0, NONE);
817 :     val a0 : int Array.array = Array.fromList [];
818 :     a2v a0;
819 :    
820 :     Transcript:
821 :    
822 :     - fun a2v a = Array.extract(a, 0, NONE);
823 :     val a2v = fn : 'a array -> 'a vector
824 :     - val a0 : int Array.array = Array.fromList [];
825 :     val a0 = [||] : int array
826 :     - a2v a0;
827 :     Bus error
828 :    
829 :     Comments:
830 :     The problem is in Array.extract. A special case needs to
831 :     be inserted for when the array is of zero length to begin
832 :     with.
833 :     Owner:
834 :     Status: fixed in 109.19 (on mipseb-irix)
835 :     ----------------------------------------------------------------------
836 :     Number: 1024
837 :     Title: unsound typing
838 :     Keywords: type checking
839 :     Submitter: Kenneth Cline & Bob Harper (ken.cline@CS.cmu.edu, rwh@CS.cmu.edu)
840 :     Date: 1/8/96
841 :     Version: 108.18
842 :     Severity: Extreme
843 :     Problem: bad type generalization leads to unsound typing
844 :     Transcript:
845 :     - fun f x = let fun g y = (x, y) in (g 4, g"4") end;
846 :     val f = fn : 'a -> ('b * int) * ('b * string)
847 :     Comments:
848 :     The type of the resule should have 'a instead of 'b in both places:
849 :    
850 :     'a -> ('a * int) * ('a * string)
851 :    
852 :     This breaks the soundness of the language, and should be fixed as soon
853 :     as possible.
854 :    
855 :     Comment [dbm]: this bug is caused by the function MTDeriv.mtderivDec
856 :     called by Compile.elaborate (build/compile.sml). This function specializes
857 :     polymorphic functions.
858 :    
859 :     Test: bug1024.sml
860 :     Owner: Zhong
861 :     Status: fixed in 109.22 [109.19m]
862 :     ----------------------------------------------------------------------
863 :     Number: 1025
864 :     Title: flakey array of Word32.word
865 :     Keywords: Word32, array
866 :     Submitter: Lorenz Huelsbergen
867 :     Date: 1/18/96
868 :     Version: 108.21
869 :     System: mipseb-irix, x86-linux
870 :     Severity: major
871 :     Problem: flakey array of Word32.word
872 :     Transcript:
873 :     Standard ML of New Jersey, Version 108.21, January 15, 1996 [CM&CMB 1]
874 :     val it = () : unit
875 :     - val a = Array.array(1,0w0:Word32.word);
876 :     val a = [|0wx0|] : Word32.word array
877 :     - Array.update(a,0,0w1);
878 :     val it = () : unit
879 :     - Array.sub(a,0);
880 :     val it = 0wx1 : Word32.word
881 :     - Array.sub(a,0);
882 :     val it = 0wx4aaadc : Word32.word
883 :     - Array.sub(a,0);
884 :     val it = 0wx4aaadc : Word32.word
885 :     - Array.sub(a,0);
886 :     val it = 0wx4abb40 : Word32.word
887 :     - Array.sub(a,0);
888 :     val it = 0wx4a6cc4 : Word32.word
889 :     -
890 :     Owner:
891 :     Status: fixed in 109.19 (on mipseb-irix)
892 :     ----------------------------------------------------------------------
893 :     Number: 1026
894 :     Title: Posix.FileSys.access returns false incorrectly
895 :     Keywords: Posix, files
896 :     Submitter: John Reppy
897 :     Date: 1/19/96
898 :     Version: 108.21
899 :     System: ?
900 :     Severity: major
901 :     Problem:
902 :     Posix.FileSys.access returns false on executable files when the file in not
903 :     owned by the user running ML.
904 :     Transcript:
905 :     <jhr@radish> ls -l /bin/bc
906 :     -rwxr-xr-x 1 root daemon 35584 Apr 12 1994 /bin/bc*
907 :     <jhr@radish> ls -l bin/sgmls.sh
908 :     -rwxr-xr-x 1 jhr jhr 185 Jan 15 14:25 bin/sgmls.sh*
909 :     <jhr@radish> /usr/local/sml/108.21/bin/sml
910 :     Standard ML of New Jersey, Version 108.21, January 15, 1996 [CM&CMB 1]
911 :     val it = () : unit
912 :     - Posix.FileSys.access("/bin/bc", []);
913 :     val it = true : bool
914 :     - Posix.FileSys.access("/bin/bc", [Posix.FileSys.A_EXEC]);
915 :     val it = false : bool
916 :     - Posix.FileSys.access("bin/sgmls.sh", [Posix.FileSys.A_EXEC]);
917 :     val it = true : bool
918 :     -
919 :     Comments:
920 :     In 108.5, OS.FileSys.access worked, but it was a separate implementation.
921 :     In 108.21, OS.FileSys.access and Posix.FileSys.access share an implementation.
922 :     Owner: John
923 :     Status: fixed in 109.21
924 :     ----------------------------------------------------------------------
925 :     Number: 1027
926 :     Title: Word32.fromString and Word.fromString broken
927 :     Keywords: Word32, conversion
928 :     Submitter: Lorenz Huelsbergen
929 :     Date: 1/22/96
930 :     Version: 109 - 109.19
931 :     System: sparc-sunos, x86-linux, mipseb-irix
932 :     Severity: major
933 :     Problem: On sparc and x86 (at least), Word32.fromString (and Word.fromString)
934 :     are broken.
935 :     Transcript:
936 :     : arran 152; sml-cm
937 :     Standard ML of New Jersey, Version 109, January 19, 1996 [CM&CMB 1]
938 :     val it = () : unit
939 :     - Word32.fromString "0wx2";
940 :     val it = SOME 0wx0 : Word32.word option
941 :     - Word.fromString "0w2";
942 :     val it = SOME 0wx0 : word option
943 :    
944 :     Comment: [jhr, 1/23/96]
945 :     Actually, I think the problem is that we are not yet handling the "0w" prefix.
946 :     When I implemented this, the SMLSL specified that these functions did not
947 :     process the prefix, so they are just converting the "0". Since then, the
948 :     SMLSL specification has changed, but not the implementation.
949 :    
950 :     Owner: jhr
951 :     Status: fixed in 109.27 [jhr, 4/11/97]
952 :     ----------------------------------------------------------------------
953 :     Number: 1028
954 :     Title: Char.toString does not escape the backslash character
955 :     Keywords: conversion, string
956 :     Submitter: Emden R. Gansner (erg@research.att.com)
957 :     Date: 25 January 1996
958 :     Version: 109
959 :     System: all
960 :     Severity: minor
961 :     Problem: Char.toString does not escape the backslash character
962 :     Code:
963 :     Transcript:
964 :     - Char.toString #"\\";
965 :     val it = "\\" : string
966 :     Comments:
967 :     Should return "\\\\"
968 :     Owner:
969 :     Status: fixed in 109.19 (mipseb-irix)
970 :     ----------------------------------------------------------------------
971 :     Number: 1029
972 :     Title: use not finding file on x86-solaris
973 :     Keywords: use, files
974 :     Submitter: Norman Ramsey
975 :     Date: 1/12/96
976 :     Version: 108.19
977 :     System: x86-solaris
978 :     Severity: major
979 :     Problem: use not finding file on x86-solaris
980 :     Transcript:
981 :     Here are the results of two compilations of the same source, one
982 :     on sparc-sunOS, and one in x86-Solaris:
983 :    
984 :     : nr@labrador 94 ; /p/sml-108.19/sml
985 :     Standard ML of New Jersey, Version 108.19, December 24, 1995 [CM&CMB 1]
986 :     val it = () : unit
987 :     - use "scheme.sml";
988 :     [opening scheme.sml]
989 :     GC #0.0.0.0.1.7: (10 ms)
990 :     GC #0.0.0.1.2.21: (110 ms)
991 :     scheme.sml:209.62-209.82 Error: operator and operand don't agree (tycon mismatch)
992 :     operator domain: string * string
993 :     operand: string * {cause:exn, function:string, name:string}
994 :     in expression:
995 :     ^ ("I/O error: ",msg)
996 :     scheme.sml:216.69-216.89 Error: operator and operand don't agree (tycon mismatch)
997 :     operator domain: string * string
998 :     operand: string * {cause:exn, function:string, name:string}
999 :     in expression:
1000 :     ^ ("I/O error: ",msg)
1001 :     -
1002 :    
1003 :    
1004 :     : nr@xinu3 25 ; /p/sml-108.19/sml
1005 :     Standard ML of New Jersey, Version 108.19, December 24, 1995 [CM&CMB 1]
1006 :     val it = () : unit
1007 :     - exportFn;
1008 :     val it = fn : string * (string * string list -> ?.OS_Process.status) -> 'a
1009 :     - use "scheme.sml";
1010 :     [opening scheme.sml]
1011 :    
1012 :     uncaught exception SysErr: No such file or directory [<OS.errorName unimplemented>]
1013 :     raised at: build/interact.sml:57.10
1014 :     build/computil.sml:40.41
1015 :     build/compile.sml:209.8
1016 :     util/stats.sml:168.40
1017 :     build/evalloop.sml:193.62
1018 :    
1019 :     Comment: [jhr, 4/3/97]
1020 :     I this was either not a bug, or it has been fixed. I'm not able
1021 :     to reproduce it on our x86/solaris machine.
1022 :     Owner: jhr
1023 :     Status: not reproducible
1024 :     ----------------------------------------------------------------------
1025 :     Number: 1030
1026 :     Title: string literals in presence of CM-library on Alpha
1027 :     Keywords: string, literal
1028 :     Submitter: Andrew Appel <appel@CS.Princeton.EDU>
1029 :     Date: 1/30/96
1030 :     Version: 109
1031 :     System: alpha-aix, not hppa
1032 :     Severity: major
1033 :     Problem: string literals not handled properly
1034 :     Code:
1035 :     Source files:
1036 :    
1037 :     sources.cm:
1038 :     Group is
1039 :     toy.lex.sml
1040 :     /u/appel/ml/109/lib/smlnj-lib.cm
1041 :    
1042 :     toy.lex.sml:
1043 :     structure Lex = struct
1044 :     val s5 =
1045 :     "\105\105\105\105\105\105\105\105\105\105\119\105\105\105\105\105\
1046 :     \\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\
1047 :     \\105\105\118\105\105\105\105\105\105\105\105\105\105\105\105\105\
1048 :     \\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\
1049 :     \\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\
1050 :     \\105\105\105\105\105\105\105\105\105\105\105\105\106\105\105\105\
1051 :     \\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\
1052 :     \\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\105\
1053 :     \\105"
1054 :     fun sum s = foldr op + 0 (map ord (explode s))
1055 :    
1056 :     val _ = (print (sum s5); print "\n")
1057 :     end
1058 :     Transcript:
1059 :     alpha% sml
1060 :     Standard ML of New Jersey, Version 109, January 19, 1996 [CM&CMB 1]
1061 :     val it = () : unit
1062 :     - CM.make();
1063 :     [starting dependency analysis]
1064 :     [scanning sources.cm]
1065 :     [checking .alpha32/sources.cm.stable ... not usable]
1066 :     [scanning /u/appel/ml/109/lib/smlnj-lib.cm -> /tmp_mnt/n/fs/fac1/appel/ml/109/src/smlnj-lib/sources.cm]
1067 :     [checking /tmp_mnt/n/fs/fac1/appel/ml/109/src/smlnj-lib/.alpha32/sources.cm.stable ... ok - stable]
1068 :     GC #0.0.0.0.1.38: (11 ms)
1069 :     [dependency analysis completed]
1070 :     [compiling toy.lex.sml -> .alpha32/toy.lex.sml.bin]
1071 :     [wrote .alpha32/toy.lex.sml.bin]
1072 :     13455
1073 :     [introducing new bindings into toplevel environment...]
1074 :     val it = () : unit
1075 :     -
1076 :    
1077 :     hppa% sml
1078 :     CM.make();
1079 :     Standard ML of New Jersey, Version 109, January 19, 1996 [CM&CMB 1]
1080 :     val it = () : unit
1081 :     - [starting dependency analysis]
1082 :     [scanning sources.cm]
1083 :     [checking .hppa/sources.cm.stable ... not usable]
1084 :     [scanning /u/appel/ml/109/lib/smlnj-lib.cm -> /tmp_mnt/n/fs/fac1/appel/ml/109/src/smlnj-lib/sources.cm]
1085 :     [checking /tmp_mnt/n/fs/fac1/appel/ml/109/src/smlnj-lib/.hppa/sources.cm.stable ... ok - stable]
1086 :     GC #0.0.0.0.1.39: (20 ms)
1087 :     [dependency analysis completed]
1088 :     [compiling toy.lex.sml -> .hppa/toy.lex.sml.bin]
1089 :     [wrote .hppa/toy.lex.sml.bin]
1090 :     13573
1091 :     [introducing new bindings into toplevel environment...]
1092 :     val it = () : unit
1093 :     -
1094 :    
1095 :     Finally, a transcript on the alpha with only the first two lines of the
1096 :     sources.cm file:
1097 :    
1098 :     alpha% sml
1099 :     Standard ML of New Jersey, Version 109, January 19, 1996 [CM&CMB 1]
1100 :     val it = () : unit
1101 :     - CM.make();
1102 :     [starting dependency analysis]
1103 :     [scanning sources.cm]
1104 :     [checking .alpha32/sources.cm.stable ... not usable]
1105 :     [dependency analysis completed]
1106 :     [compiling toy.lex.sml -> .alpha32/toy.lex.sml.bin]
1107 :     GC #0.0.0.0.1.31: (7 ms)
1108 :     [wrote .alpha32/toy.lex.sml.bin]
1109 :     13573
1110 :     [introducing new bindings into toplevel environment...]
1111 :     val it = () : unit
1112 :     -
1113 :     Comments:
1114 :     The last line of the sources.cm file refers to a completely unused
1115 :     library (with a stable-file). On the Alpha, this situation leads
1116 :     to the wrong value for the string literal s5 (I'm quite sure the
1117 :     problem is in s5 and not in the sum or print functions).
1118 :     But when the library reference is deleted from the sources.cm file,
1119 :     it works fine! Or, on the HP-PA, with or without the library reference,
1120 :     it works fine! Most strange.
1121 :    
1122 :     Owner: ?
1123 :     Status: open
1124 :     ----------------------------------------------------------------------
1125 :     Number: 1031
1126 :     Title: signal handling is broken
1127 :     Keywords: signal
1128 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
1129 :     Date: 02/05/96
1130 :     System(s) and Version: Compiler
1131 :     SML/NJ Version: 109.1
1132 :     Machine: SPARC, Solaris 2.4
1133 :     Severity: major
1134 :     Problem: signal handling is broken
1135 :     Code: OS.Process.system "ls"; OS.Process.system "ls";
1136 :     Transcript:
1137 :    
1138 :     Script started on Mon Feb 05 15:27:54 1996
1139 :     sen14_1_109.1/bin/sml
1140 :     Standard ML of New Jersey, Version 109.1, February 2, 1996 [CM&CMB 1]
1141 :     val it = () : unit
1142 :     - OS.Process.system "ls";
1143 :     108.5 109.1 etc smlnj
1144 :     109 bugs mikpe typescript
1145 :     val it = 0 : ?.OS_Process.status
1146 :    
1147 :     (* OK, fine, let's do it again.. *)
1148 :    
1149 :     - OS.Process.system "ls";
1150 :     (* Hangs *HARD* and consumes *LOTS* of CPU *)
1151 :     ^C^C^C^Z
1152 :     Suspended
1153 :     sen14_2_kill -9 %1
1154 :    
1155 :    
1156 :     Script started on Mon Feb 05 15:33:25 1996
1157 :     sen14_1_109.1/bin/sml
1158 :     Standard ML of New Jersey, Version 109.1, February 2, 1996 [CM&CMB 1]
1159 :     val it = () : unit
1160 :     - case Posix.Process.fork()
1161 :     = of NONE => (Posix.Process.exit 0w0; 0)
1162 :     = | _ => 1;
1163 :     val it = 1 : int
1164 :     - val savInt = Signals.setHandler(UnixSignals.sigINT, Signals.IGNORE);
1165 :     (* As before, hangs consuming lots of CPU *)
1166 :     ^C^C^C^Z
1167 :     Suspended
1168 :     sen14_2_kill -9 %1
1169 :    
1170 :     Comments:
1171 :    
1172 :     Using Solaris' `truss' command, I was able to verify that the hanging
1173 :     process loops entirely in user code. It makes no system calls whatsoever.
1174 :    
1175 :     The symptoms are similar, but slightly different in 109. There,
1176 :     it seems to hang right after the first call to OS.Process.system.
1177 :    
1178 :     NotAFix:
1179 :    
1180 :     This doesn't fix the hanging problem, but there is another bug
1181 :     in sml-nj/boot/Unix/os-process.sml: a typo causing SIGINT to be
1182 :     given SIGQUIT's handler.
1183 :    
1184 :     *** sml-nj/boot/Unix/os-process.sml.~1~ Wed Jan 31 17:02:41 1996
1185 :     --- sml-nj/boot/Unix/os-process.sml Mon Feb 5 00:54:06 1996
1186 :     ***************
1187 :     *** 32,38 ****
1188 :     val savSigQuit = savSig UnixSignals.sigQUIT
1189 :     fun restore () = (
1190 :     Signals.setHandler (UnixSignals.sigINT, savSigInt);
1191 :     ! Signals.setHandler (UnixSignals.sigINT, savSigQuit))
1192 :     fun wait () = (case #2(P_Proc.waitpid(P_Proc.W_CHILD pid, []))
1193 :     of P_Proc.W_EXITED => success
1194 :     | (P_Proc.W_EXITSTATUS w) => Word8.toInt w
1195 :     --- 32,38 ----
1196 :     val savSigQuit = savSig UnixSignals.sigQUIT
1197 :     fun restore () = (
1198 :     Signals.setHandler (UnixSignals.sigINT, savSigInt);
1199 :     ! Signals.setHandler (UnixSignals.sigQUIT, savSigQuit))
1200 :     fun wait () = (case #2(P_Proc.waitpid(P_Proc.W_CHILD pid, []))
1201 :     of P_Proc.W_EXITED => success
1202 :     | (P_Proc.W_EXITSTATUS w) => Word8.toInt w
1203 :    
1204 :     Owner: John
1205 :     Status: fixed in 109.21
1206 :     ----------------------------------------------------------------------
1207 :     Number: 1032
1208 :     Title: incorrect type paths in signature printing
1209 :     Keywords: printing, types
1210 :     Submitter: David MacQueen
1211 :     Date: 2/9/96
1212 :     Version: ?
1213 :     Severity: major
1214 :     Problem: incorrect type paths in signature printing
1215 :     Code:
1216 :     signature S =
1217 :     sig
1218 :     structure A : sig type t val y : t end
1219 :     val x : A.t
1220 :     end;
1221 :     Transcript: (with Compiler.Control.Print.signatures := 5)
1222 :     - use "foo.sml";
1223 :     [opening foo.sml]
1224 :     signature S =
1225 :     sig
1226 :     structure A :
1227 :     sig
1228 :     type t
1229 :     val y : A.t (* <--- this should be "t" *)
1230 :     end
1231 :     val x : A.t
1232 :     end
1233 :    
1234 :     In 109.19, this is fixed, but type of val x is printed wrong:
1235 :    
1236 :     signature S =
1237 :     sig
1238 :     structure A :
1239 :     sig
1240 :     type t
1241 :     val y : t
1242 :     end
1243 :     val x : ?.t
1244 :     end
1245 :    
1246 :     Test: bug1032.sml
1247 :     Owner: dbm
1248 :     Status: fixed in 109.19m [dbm, 11/15/96]
1249 :     ----------------------------------------------------------------------
1250 :     Number: 1033
1251 :     Title: assignments to word32 refs are not written to the update log
1252 :     Keywords: Word32
1253 :     Submitter: Kenneth Cline <Kenneth_Cline@SILVER.FOX.CS.CMU.EDU>
1254 :     Date: 2/13/96
1255 :     Version: 109
1256 :     Severity: extreme
1257 :     Problem: In SML/NJ 109, assignments to word32 refs are not written to the
1258 :     update log, which often results in inconsistent heaps (core dumps or
1259 :     GC detected anomolies).
1260 :     Code:
1261 :     val x = ref (0w0:word32);
1262 :     System.Runtime.gc 1;
1263 :     x:=0w1;
1264 :     System.Runtime.gc 1;
1265 :     Fix:
1266 :     To fix this, I modified frun updateOp in translate/unboxed.sml,
1267 :     generating P.BOXEDUPDATE for word32 assignments. The new code,
1268 :     starting at line 50, is:
1269 :    
1270 :     | CONty(tyc,_) =>
1271 :     if equalTycon(tyc,intTycon)
1272 :     orelse equalTycon(tyc,wordTycon)
1273 :     orelse equalTycon(tyc,word8Tycon)
1274 :     then P.UNBOXEDUPDATE
1275 :     else if eqTycon(tyc,realTycon)
1276 :     orelse eqTycon(tyc,word32Tycon)
1277 :     orelse eqTycon(tyc,exnTycon)
1278 :     orelse eqTycon(tyc,contTycon)
1279 :     orelse eqTycon(tyc,arrayTycon)
1280 :     orelse eqTycon(tyc,refTycon)
1281 :     then P.BOXEDUPDATE
1282 :     else P.UPDATE
1283 :    
1284 :     I don't know why some of the tests use `equalTycon' and other
1285 :     `eqTycon'. Please look into this.
1286 :    
1287 :     [jhr, 2/213/96] Thanks for the bug fix; it will appear in 109.3 (we
1288 :     just built 109.2 yesterday). The difference between equalTycon and
1289 :     eqTycon is that the latter does a "shallow" compare. I've changed
1290 :     this to equalTycon in this case.
1291 :    
1292 :     Test: bug1033.sml
1293 :     Owner:
1294 :     Status: fixed in 109.3
1295 :     ----------------------------------------------------------------------
1296 :     Number: 1034 Word8Vector
1297 :     Title:vector and String.string types are currently identical
1298 :     Keywords:
1299 :     Submitter: John Reppy
1300 :     Date: 3/6/96
1301 :     Version: 109.2
1302 :     Severity: minor
1303 :     Problem: Word8Vector.vector and String.string types are currently identical
1304 :     Transcript:
1305 :     Standard ML of New Jersey, Version 109.2, February 10, 1996 [CM&CMB 1]
1306 :     val it = () : unit
1307 :     - String.size(Word8Vector.fromList []);
1308 :     val it = 0 : int
1309 :     -
1310 :    
1311 :     Test: bug1034.sml
1312 :     Owner:
1313 :     Status: fixed in 109.19
1314 :     ----------------------------------------------------------------------
1315 :     Number: 1035
1316 :     Title: spurious secondary error message
1317 :     Keywords: error message, signature matching
1318 :     Submitter: John Reppy
1319 :     Date: 3/7/96
1320 :     Version: 109.2
1321 :     Severity: minor
1322 :     Problem: The second error message seems to be caused by the error correction
1323 :     for the first.
1324 :     Code:
1325 :     signature S =
1326 :     sig
1327 :     type t = int
1328 :     end;
1329 :    
1330 :     structure A: S =
1331 :     struct
1332 :     type t = bool
1333 :     end;
1334 :    
1335 :     Transcript:
1336 :     - use "tests/bug1035.sml";
1337 :     [opening tests/bug1035.sml]
1338 :     signature S = sig eqtype t end
1339 :     tests/bug1035.sml:8.1-11.4 Error: type t does not match definitional specification
1340 :     tests/bug1035.sml:8.1-11.4 Error: unmatched type specification: t
1341 :     Test: bug1035.sml
1342 :     Owner: dbm
1343 :     Status: fixed in 109.28 [dbm, 4/27/97]
1344 :     ----------------------------------------------------------------------
1345 :     Number: 1036
1346 :     Title: Word8Array.extract and CharArray.extract are broken
1347 :     Keywords: Word8Array, CharArray, extract, basis
1348 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
1349 :     Date: 03/10/96
1350 :     System(s) and Version: Compiler
1351 :     SML/NJ Version: 109.6
1352 :     Machine: all
1353 :     Severity: major (for me)
1354 :     Problem: Word8Array.extract and CharArray.extract are broken
1355 :     Code:
1356 :     Transcript:
1357 :    
1358 :     Standard ML of New Jersey, Version 109.6, March 1, 1996 [CM&CMB 1]
1359 :     GC #0.0.0.0.1.4: (20 ms)
1360 :     val it = () : unit
1361 :     - val a = CharArray.fromList(explode "abcdefgh");
1362 :     val a = - : ?.array
1363 :     - val v = CharArray.extract(a, 0, SOME 4);
1364 :     GC #0.0.0.1.2.52: (50 ms)
1365 :     val v = "abcd\000\000\^A\162" : ?.vector
1366 :    
1367 :     (* note the garbage bytes after the "abcd" prefix *)
1368 :    
1369 :     - size v;
1370 :     val it = 8 : int
1371 :    
1372 :     (* asked for 4 bytes, got 8 *)
1373 :    
1374 :     - val a = Word8Array.array(8, 0w65);
1375 :     val a = - : ?.array
1376 :     - val v = Word8Array.extract(a, 0, SOME 4);
1377 :     val v = - : ?.vector
1378 :     - Word8Vector.length v;
1379 :     GC #0.0.0.1.3.114: (20 ms)
1380 :     val it = 8 : int
1381 :     - (System.Unsafe.cast v):string;
1382 :     val it = "AAAA\238\173kh" : string
1383 :    
1384 :     Comments:
1385 :    
1386 :     Unrelated, but while I'm writing this bug report, I might as well
1387 :     mention that the ml-yacc tar file has a junk directory ml-yacc/lib/.depend
1388 :     and the smlnj-lib tar file has a junk directory smlnj-lib/.rs6000 .
1389 :    
1390 :     Fix:
1391 :    
1392 :     The problem is that the size of the result vector is set to be
1393 :     the size of the input array rather than the number of items
1394 :     actually extracted. CharVector.extract does this correctly.
1395 :    
1396 :     *** sml-nj/boot/char-array.sml.~1~ Thu Mar 7 23:19:12 1996
1397 :     --- sml-nj/boot/char-array.sml Sun Mar 10 14:28:36 1996
1398 :     ***************
1399 :     *** 74,80 ****
1400 :     fun extract (arr, base, optLen) = let
1401 :     val len = length arr
1402 :     fun newVec n = let
1403 :     ! val newV = Assembly.A.create_s len
1404 :     fun fill i = if (i < n)
1405 :     then (vecUpdate(newV, i, unsafeSub(arr, base+i)); fill(i+1))
1406 :     else ()
1407 :     --- 74,80 ----
1408 :     fun extract (arr, base, optLen) = let
1409 :     val len = length arr
1410 :     fun newVec n = let
1411 :     ! val newV = Assembly.A.create_s n
1412 :     fun fill i = if (i < n)
1413 :     then (vecUpdate(newV, i, unsafeSub(arr, base+i)); fill(i+1))
1414 :     else ()
1415 :     *** sml-nj/boot/word8-array.sml.~1~ Thu Mar 7 23:19:13 1996
1416 :     --- sml-nj/boot/word8-array.sml Sun Mar 10 14:29:55 1996
1417 :     ***************
1418 :     *** 75,81 ****
1419 :     fun extract (v, base, optLen) = let
1420 :     val len = length v
1421 :     fun newVec n = let
1422 :     ! val newV : vector = V.create len
1423 :     fun fill i = if (i < n)
1424 :     then (vecUpdate(newV, i, unsafeSub(v, base+i)); fill(i+1))
1425 :     else ()
1426 :     --- 75,81 ----
1427 :     fun extract (v, base, optLen) = let
1428 :     val len = length v
1429 :     fun newVec n = let
1430 :     ! val newV : vector = V.create n
1431 :     fun fill i = if (i < n)
1432 :     then (vecUpdate(newV, i, unsafeSub(v, base+i)); fill(i+1))
1433 :     else ()
1434 :    
1435 :     Comment:
1436 :     Thanks for the bug report. I must have broken this when I was changing
1437 :     these types to be distinct. I'll fix it for 109.7.
1438 :    
1439 :     Test: bug1036.sml
1440 :     Owner:
1441 :     Status: fixed in 109.19
1442 :     ----------------------------------------------------------------------
1443 :     Number: 1037
1444 :     Title: inconsistent type sharing with DEFtycs (Compiler bug)
1445 :     Keywords: modules, sharing, signatures, instantiation
1446 :     Submitter: John Reppy
1447 :     Date: 3/11/96
1448 :     Version: 109.x
1449 :     Severity: major
1450 :     Problem: "Compiler bug: setTycSaccess ERRORtyc" produced by
1451 :     inconsistent type sharing.
1452 :     Code:
1453 :     Transcript:
1454 :     html-elements.sml:8.9-202.5 Error: Inconsistent type sharing (DEFtyc/DEFtyc) attrs,attrs
1455 :     Error: Compiler bug: setTycSaccess ERRORtyc
1456 :     Comments:
1457 :     This error arises when I use the signature in a functor argument,
1458 :     The error message should say something about sharing of type abbreviations are
1459 :     not allowed, and should be generated for the signature definition.
1460 :    
1461 :     [dbm, 11/1/96] The SML '97 restrictions, when implemented, will rule
1462 :     out this sort of signature. Here are two signatures that should not
1463 :     elaborate, but do without complaint in 109.19:
1464 :    
1465 :     (* bug1037.sml *)
1466 :     signature S =
1467 :     sig
1468 :     type s = int
1469 :     type t = bool
1470 :     sharing type t = s
1471 :     end;
1472 :    
1473 :     (* bug1037.1.sml *)
1474 :     signature S =
1475 :     sig
1476 :     type s = int
1477 :     type a t = bool * 'a
1478 :     sharing type t = s (* here the arities don't even agree! *)
1479 :     end;
1480 :    
1481 :     Instantiation is no longer being done when a signature is declared.
1482 :     An error will occur when the sharing constraint is processed during
1483 :     instantiation, for instance when the signature is used in a functor
1484 :     parameter spec. For SML '97, these should be rejected when the signature
1485 :     is elaborated.
1486 :    
1487 :     Comment:
1488 :     Sharing constraints involving rigid tycons like these are now rejected
1489 :     by instantiate. However, instantiate is not called until the signature
1490 :     is used as a functor parameter or the constraint of an opaque match
1491 :     (abstraction), so the error will not occur when the signature is defined.
1492 :     Test: bug1037.sml, bug1037.1.sml
1493 :     Owner: dbm
1494 :     Status: fixed in 109.28 [dbm, 5/20/97]
1495 :     ----------------------------------------------------------------------
1496 :     Number: 1038
1497 :     Title: signature instantiation causes uncaught exception Unbound
1498 :     Keywords: modules, signatures, instantiation
1499 :     Submitter: Kenneth Cline <Kenneth_Cline@SILVER.FOX.CS.CMU.EDU>
1500 :     Date: 3/12/96
1501 :     Version: 109.6 - 109.21
1502 :     Severity: major
1503 :     Problem: signature instantiation causes uncaught exception Unbound
1504 :     Code: (bug1038.sml)
1505 :    
1506 :     signature S =
1507 :     sig
1508 :     type U
1509 :     type a
1510 :     datatype 'a internal_address = Address of 'a
1511 :     type T = a internal_address
1512 :     sharing type T = U
1513 :     end;
1514 :    
1515 :     functor f(structure s : S) = struct end;
1516 :    
1517 :     Transcript:
1518 :     uncaught exception exception Unbound
1519 :     raised at: modules/moduleutil.sml:260.58-260.68
1520 :     util/stats.sml:168.40
1521 :     build/evalloop.sml:145.36
1522 :     build/evalloop.sml:232.54
1523 :     build/evalloop.sml:316.38-316.41
1524 :    
1525 :     Code: (bug1038.4.sml: another example from Mikael Pettersson, 10/29/96)
1526 :    
1527 :     signature SIGA =
1528 :     sig
1529 :     type t
1530 :     end;
1531 :    
1532 :     signature SIGB =
1533 :     sig
1534 :     datatype tt = TT
1535 :     type t = tt (*XXX*)
1536 :     end;
1537 :    
1538 :     functor F2(structure A : SIGA
1539 :     structure B : SIGB
1540 :     sharing type A.t = B.t) = struct end; (* fails *)
1541 :    
1542 :     Comments:
1543 :     Because of this, the fox net doesn't compile in 109.6. However, the
1544 :     polymorphic "'a internal_address" datatype is only there as a
1545 :     workaround for a bug in the previous module system! We may be able to
1546 :     work with 109.6.
1547 :    
1548 :     Test: bug1038.{1,2,3,4}.sml
1549 :     Owner: dbm
1550 :     Status: fixed in 109.22 [109.19m]
1551 :     ----------------------------------------------------------------------
1552 :     Number: 1039
1553 :     Title: "Compiler bug: SigMatch.lookTyc 2a" after signature match failure
1554 :     Keywords: modules, signature matching, secondary error
1555 :     Submitter: John Reppy, Emden Gansner
1556 :     Date: 3/13/96
1557 :     Version: 109.6 - 109.21
1558 :     Severity: major
1559 :     Problem: failed signature match causes "Compiler bug: SigMatch.lookTyc 2a"
1560 :     Code: (* bug1039.sml *)
1561 :     structure C =
1562 :     struct
1563 :     type elem = int
1564 :     end;
1565 :    
1566 :     signature MV =
1567 :     sig
1568 :     eqtype elem
1569 :     end;
1570 :    
1571 :     signature MA =
1572 :     sig
1573 :     eqtype elem
1574 :     structure Vector : MV
1575 :     sharing type Vector.elem = elem
1576 :     end;
1577 :    
1578 :     structure s : MA = C;
1579 :    
1580 :     Transcript:
1581 :     - use "tests/bug1039.sml";
1582 :     [opening tests/bug1039.sml]
1583 :     structure C :
1584 :     sig type elem = int end
1585 :     signature MV =
1586 :     sig eqtype elem end
1587 :     signature MA =
1588 :     sig
1589 :     eqtype elem
1590 :     structure Vector : sig eqtype elem end
1591 :     sharing type elem = Vector.elem
1592 :     end
1593 :     test/tests/hack/g.sml:20.1-20.21 Error: unmatched structure specification: Vector
1594 :     Error: Compiler bug: SigMatch:lookTyc 2a
1595 :    
1596 :     uncaught exception Error
1597 :     raised at: util/errormsg.sml:51.14-51.19
1598 :     modules/sigmatch.sml:376.37
1599 :     modules/sigmatch.sml:694.36
1600 :     modules/sigmatch.sml:758.24
1601 :     elaborate/elabmod.sml:920.8
1602 :     util/stats.sml:168.40
1603 :     test/evalloop.sml:127.37
1604 :     test/evalloop.sml:203.20-203.23
1605 :    
1606 :     Comment: [dbm,11/25/96] There is an analogous bug for a missing substructure.
1607 :     This case is represented by bug1039.1.sml.
1608 :    
1609 :     Test: bug1039.sml, bug1039.1.sml
1610 :     Owner: dbm
1611 :     Status: fixed in 109.23 [109.19m]
1612 :     ----------------------------------------------------------------------
1613 :     Number: 1040
1614 :     Title: Match exception after unbound signature name
1615 :     Keywords: modules, error recovery
1616 :     Submitter: Kenneth Cline <Kenneth_Cline@SILVER.FOX.CS.CMU.EDU>
1617 :     Date: 3/15/96
1618 :     Version: 109.6--
1619 :     Severity: minor
1620 :     Problem: Match exception after unbound signature name
1621 :     Transcript:
1622 :     - functor a(structure b:b) = struct end;
1623 :     stdIn:0.0 Error: unbound signature: b
1624 :    
1625 :     uncaught exception in compiler: Match
1626 :     raised at: modules/instantiate.sml:273.7
1627 :     modules/instantiate.sml:564.27
1628 :     modules/instantiate.sml:1003.30
1629 :     util/stats.sml:168.40
1630 :     build/evalloop.sml:127.34
1631 :     build/evalloop.sml:196.62
1632 :     -
1633 :    
1634 :     Comment [dbm, 11/15/96]]: The secondary error in 109.19m is
1635 :    
1636 :     Error: Compiler bug: Instantiate: lookSlot
1637 :    
1638 :     Test: bug1040.sml
1639 :     Owner: dbm
1640 :     Status: fixed in 109.28 [dbm, 4/29/97]
1641 :     ----------------------------------------------------------------------
1642 :     Number: 1041
1643 :     Title: eqtype mismatch despite sharing
1644 :     Keywords: modules, sharing, signature matching
1645 :     Submitter: Kenneth Cline <Kenneth_Cline@SILVER.FOX.CS.CMU.EDU>
1646 :     Date: 3/18/96
1647 :     Version: 109.6?
1648 :     Severity: major
1649 :     Problem:
1650 :     Here's an example that the new module system won't accept: The problem
1651 :     that is reported is lack of eqtype in the line declaring result, but
1652 :     the sharing constraint ensures that X.t is an eqtype.
1653 :     Code: (* bug1041.sml *)
1654 :     signature XTERN =
1655 :     sig
1656 :     type T
1657 :     val t: T
1658 :     end
1659 :    
1660 :     structure W =
1661 :     struct
1662 :     type word = word32
1663 :     val zero = 0w0
1664 :     end
1665 :    
1666 :     functor Ip_Flag_Extern (structure X: XTERN
1667 :     sharing type X.T = W.word) =
1668 :     struct
1669 :     val result = X.t = W.zero
1670 :     end
1671 :    
1672 :     Test: bug1041.sml
1673 :     Owner: dbm
1674 :     Status: fixed in 109.19
1675 :     ----------------------------------------------------------------------
1676 :     Number: 1042
1677 :     Title: sig match failure produces "Compiler bug: ElabMod: rebind(TYCspec)"
1678 :     Keywords: modules, signature matching, error recovery
1679 :     Submitter: "John H. Reppy" <jhr@research.att.com>
1680 :     Date: 3/19/96
1681 :     Version: 109.7
1682 :     Severity: minor
1683 :     Problem: sig match failure produces "Compiler bug: ElabMod: rebind(TYCspec)"
1684 :     Code: (* bug1042.sml *)
1685 :     signature SIG =
1686 :     sig
1687 :     datatype access_mode = A_READ | A_WRITE | A_EXEC
1688 :     sharing type access_mode = Posix.FileSys.access_mode
1689 :     end;
1690 :    
1691 :     structure S : SIG =
1692 :     struct
1693 :     structure P : sig datatype access = A_EXEC | A_READ | A_WRITE end =
1694 :     Posix.FileSys
1695 :     open P
1696 :     end;
1697 :    
1698 :     Transcript:
1699 :     - use "tests/bug1042.1.sml";
1700 :     [opening tests/bug1042.1.sml]
1701 :     GC #0.0.0.1.5.253: (11 ms)
1702 :     signature SIG =
1703 :     sig
1704 :     datatype access_mode = A_EXEC | A_READ | A_WRITE
1705 :    
1706 :     sharing type access_mode = Posix.FileSys.access_mode
1707 :     end
1708 :     tests/bug1042.1.sml:11.3-12.18 Error: unmatched type specification: access
1709 :     Error: Compiler bug: ElabMod: rebind(TYCspec)
1710 :    
1711 :     uncaught exception exception Error
1712 :     raised at: util/errormsg.sml:51.14-51.19
1713 :     elaborate/elabmod.sml:802.33
1714 :     elaborate/elabmod.sml:847.33
1715 :     elaborate/elabmod.sml:513.33
1716 :     util/stats.sml:168.40
1717 :     build/evalloop.sml:145.36
1718 :     build/evalloop.sml:232.54
1719 :     build/evalloop.sml:316.38-316.41
1720 :    
1721 :     Comment [dbm, 11/15/96]: In 109.19m the secondary error has become
1722 :    
1723 :     Error: Compiler bug: ModuleUtil: tycId
1724 :    
1725 :     Test: bug1042.1.sml, bug1042.2.sml
1726 :     Owner: dbm
1727 :     Status: fixed in 109.28 [dbm, 4/29/97]
1728 :     ----------------------------------------------------------------------
1729 :     Number: 1043
1730 :     Title: prettyprinting datatypes at top level
1731 :     Keywords: prettyprinting, top-level
1732 :     Submitter: Tim Armes <tarmes@armltd.co.uk> (via John Reppy)
1733 :     Date: 3/21/96
1734 :     Version: 109.3-109.7
1735 :     Severity: major
1736 :     Problem: uncaught exception Match raised while printing a datatype
1737 :     decl at top level.
1738 :     Transcript:
1739 :     Standard ML of New Jersey, Version 109.3, February 20, 1996 [new runtime]
1740 :     - datatype 'a tree = Node of 'a tree * 'a tree | Leaf of 'a;
1741 :     datatype 'a tree
1742 :     con Leaf : 'a
1743 :    
1744 :     uncaught exception Match
1745 :     raised at: print/pptype.sml:190.23
1746 :     util/pp.sml:539.6
1747 :     build/evalloop.sml:176.62
1748 :    
1749 :     Test: bug1043.sml
1750 :     Owner:
1751 :     Status: fixed in 109.19
1752 :     ----------------------------------------------------------------------
1753 :     Number: 1044
1754 :     Title: bad type name in top-level printing
1755 :     Keywords: prettyprinting, top-level, type name
1756 :     Submitter: Lal George
1757 :     Date: 3/28/96
1758 :     Version: 109.3 - 109.19+
1759 :     Severity: major
1760 :     Problem: Type names not printed properly at top level. Structure name
1761 :     replaced by "?".
1762 :     Transcript:
1763 :     - val x : Word32.word = 0wx400;
1764 :     val x = 0wx400 : ?.word
1765 :     Test: bug1044.sml
1766 :     Owner: dbm
1767 :     Status: fixed in 109.19m
1768 :     ----------------------------------------------------------------------
1769 :     Number: 1045
1770 :     Title: better message for missing spec in signature match
1771 :     Keywords: printing, error message
1772 :     Submitter: John Reppy
1773 :     Date: 2/29/96
1774 :     Version: 109.19
1775 :     Severity: minor
1776 :     Problem:
1777 :     When reporting a missing spec, where the spec is part of a substructure,
1778 :     it would be useful if the error message could be localized to the substructure.
1779 :     It might also be useful to use a qualified name in the error message.
1780 :     Code:
1781 :     signature S =
1782 :     sig
1783 :     structure A: sig val x:int end
1784 :     end;
1785 :    
1786 :     structure X: S =
1787 :     struct
1788 :     structure A = struct end
1789 :     end;
1790 :    
1791 :     Transcript:
1792 :     - use "tests/bug1045.sml";
1793 :     [opening tests/bug1045.sml]
1794 :     signature S = sig structure A : sig val x : int end end
1795 :     tests/bug1045.sml:8.1-11.4 Error: unmatched value specification: x
1796 :    
1797 :     uncaught exception exception Error
1798 :     raised at: build/evalloop.sml:123.59-123.67
1799 :     build/evalloop.sml:232.54
1800 :     build/evalloop.sml:316.38-316.41
1801 :     -
1802 :     Test: bug1045.sml
1803 :     Owner:
1804 :     Status: open
1805 :     ----------------------------------------------------------------------
1806 :     Number: 1046
1807 :     Title: sharing in include not implemented
1808 :     Keywords: modules, sharing, include
1809 :     Submitter: Dave MacQueen
1810 :     Date: 4/1/96
1811 :     Version: 109.x
1812 :     Severity: major
1813 :     Problem: sharing in include not implemented
1814 :     Code: (* bug1046.sml *)
1815 :     signature S =
1816 :     sig
1817 :     type s
1818 :     type t
1819 :     sharing type s = t
1820 :     end;
1821 :    
1822 :     signature T =
1823 :     sig
1824 :     include S
1825 :     val x : s
1826 :     val y : t -> int
1827 :     end;
1828 :    
1829 :     functor F (X: T) =
1830 :     struct
1831 :     val _ = X.y(X.x)
1832 :     end;
1833 :    
1834 :     Test: bug1046.sml
1835 :     Owner:
1836 :     Status: fixed in 109.19
1837 :     ----------------------------------------------------------------------
1838 :     Number: 1047
1839 :     Title: Not very random, random number generator ... (smlnj-lib)
1840 :     Keywords: random number, smlnj-lib
1841 :     Submitter: Lal George
1842 :     Date: 4/3//96
1843 :     Version: ?
1844 :     Severity: major
1845 :     Problem: successive random numbers are identical
1846 :     Transcript:
1847 :     - Rand.random;
1848 :     val it = fn : real -> real
1849 :    
1850 :     - Rand.random((Rand.randMax + Rand.randMin)/2.0);
1851 :     val it = 1073741823.5 : real
1852 :     - Rand.random it;
1853 :     val it = 1073741823.5 : real
1854 :     - Rand.random it;
1855 :     val it = 1073741823.5 : real
1856 :     Comment: [erg, 4/4/96]
1857 :     In Rand, seeds must be integer-valued. (Rand was implemented
1858 :     using reals because, at the time, we didn't have large enough
1859 :     integers.) This constraint should be added to the man
1860 :     page. Alternatively, Rand could now be reimplemented using
1861 :     integral types.
1862 :    
1863 :     Note that the Random structure provides a much better generator.
1864 :     Test: bug1047.sml
1865 :     Owner:
1866 :     Status: fixed in 110.0.3 (jhr/erg)
1867 :     ----------------------------------------------------------------------
1868 :     Number: 1048
1869 :     Title: std_in not reopened after ^D
1870 :     Keywords: I/O, standard input
1871 :     Submitter: Bob Harper
1872 :     Date: 4/10/96
1873 :     Version: 108.18
1874 :     System: ?
1875 :     Severity: major
1876 :     Problem:
1877 :     There appears to be a bug in 108.18 to do with I/O and the interactive
1878 :     system. It's very easy to reproduce: write a function to read from
1879 :     std_in up to eof and make a list out of it. When you send ^D to
1880 :     std_in to finish your input, the top level correctly prints the
1881 :     returned list, but then immediately exits because std_in is closed.
1882 :     In older versions of SML the behavior was to re-open std_in, which I
1883 :     believe is correct.
1884 :     Code: use bug1048.sml, requires interaction
1885 :     Test: bug1048.sml
1886 :     Owner:
1887 :     Status: fixed in 109.19
1888 :     ----------------------------------------------------------------------
1889 :     Number: 1049
1890 :     Title: extraneous unresolved flex record error
1891 :     Keywords: type checking, flex record, error message
1892 :     Submitter: Thomas Yan (tyan@cs.cornell.edu)
1893 :     Date: 4/10/96
1894 :     System: Compiler
1895 :     SML/NJ Version: 0.93 onwards (including 1.09)
1896 :     Machine: all
1897 :     Severity: minor
1898 :     Problem: although there is sufficient information to
1899 :     determine all fields of a record, the compiler
1900 :     reports an unresolved flex record
1901 :     Code: fun f x = (map real (#1 x); map op o x);
1902 :     Transcript: std_in:211.11-211.39 Error: operator and operand don't agree (type mismatch)
1903 :     operator domain: (('Z -> 'Y) * ('X -> 'Z)) list
1904 :     operand: {1:int list, '...W}
1905 :     in expression:
1906 :     map o x
1907 :     std_in:211.1-211.39 Error: unresolved flex record
1908 :     (can't tell what fields there are besides #1)
1909 :     Comment: The problem here is the confusing secondary type error message.
1910 :     [dbm, 4/9/97]
1911 :     The second error message about "unresolved flex record" appears
1912 :     perfectly valid to me.
1913 :     Test: bug1049.sml
1914 :     Owner: dbm
1915 :     Status: not a bug
1916 :     ----------------------------------------------------------------------
1917 :     Number: 1050
1918 :     Title: uncaught exception Unbound in functor elaboration
1919 :     Keywords: modules, sharing, instantiation
1920 :     Submitter: Roderick Moten
1921 :     Date: April, 12 1996
1922 :     Version: 109.10
1923 :     System: Sparc/SunOS 4.1.3
1924 :     Severity: minor
1925 :     Problem: compiler raises the exception Unbound when compiling a
1926 :     functor definition.
1927 :    
1928 :     Code: see /usr/local/sml/bugs/moten/1050/src
1929 :     Transcript:
1930 :     - signature i = INFERENCE_ENGINE;
1931 :     signature i =
1932 :     sig
1933 :     structure LevelExpression : <sig>
1934 :     structure Parameters : <sig>
1935 :     structure Terms : <sig>
1936 :     structure TermSubst : <sig>
1937 :     structure ParmSubst : <sig>
1938 :     structure Sequent : <sig>
1939 :     structure PrimitiveRule : <sig>
1940 :     sharing PrimitiveRule.Sequent = Sequent
1941 :     sharing Sequent.TermSubst = TermSubst
1942 :     sharing ParmSubst.Terms = TermSubst.Terms = Terms
1943 :     sharing Sequent.Parameters = Terms.Parameters = Parameters
1944 :     sharing Parameters.LevelExpression = LevelExpression
1945 :     end
1946 :     - functor a (i : INFERENCE_ENGINE) = struct val k = 9 end;
1947 :    
1948 :     uncaught exception in compiler: Unbound
1949 :     raised at: modules/moduleutil.sml:260.58-260.67
1950 :     util/stats.sml:168.40
1951 :     build/evalloop.sml:133.34
1952 :     build/evalloop.sml:202.62
1953 :     Owner: dbm
1954 :     Status: fixed in 109.23 [109.19m]
1955 :     ----------------------------------------------------------------------
1956 :     Number: 1051
1957 :     Title: open decl in signature causes Match exception
1958 :     Keywords: error message, signature, modules, Match
1959 :     Submitter: stefan@stefan.hb.north.de (Stefan Westmeier)
1960 :     Date: 4/15/96
1961 :     Version: 109.10
1962 :     System: x86/linux
1963 :     Severity: major
1964 :     Problem: Uncaught Match exception when elaborating a signature with
1965 :     an open declaration.
1966 :     Code:
1967 :     structure Ab =
1968 :     struct
1969 :     type AAb = int
1970 :     fun I (x:AAb) = x
1971 :     end;
1972 :    
1973 :     signature BB =
1974 :     sig
1975 :     open Ab
1976 :     val J : AAb -> AAb
1977 :     end;
1978 :    
1979 :     structure Bb : BB =
1980 :     struct
1981 :     local open Ab in
1982 :     fun J x = I x
1983 :     end
1984 :     end;
1985 :    
1986 :     Transcript:
1987 :     Standard ML of New Jersey, Version 109.10, April 5, 1996 [CM&CMB 1]
1988 :     GC #0.0.0.0.1.1: (10 ms)
1989 :     val it = () : unit
1990 :     - use "test.sml";
1991 :     [opening test.sml]
1992 :    
1993 :     uncaught exception Match
1994 :     raised at: elaborate/elabsig.sml:516.5
1995 :     elaborate/elabmod.sml:639.33
1996 :     util/stats.sml:168.40
1997 :     build/evalloop.sml:133.34
1998 :     build/evalloop.sml:202.62
1999 :     build/evalloop.sml:292.22-292.24
2000 :     -
2001 :     Comments: This is an illegal (SML96) program, but it should produce
2002 :     a sensible error message rather than an uncaught Match.
2003 :    
2004 :     Fix: open is treated as a syntax error
2005 :     Test: bug1051.sml
2006 :     Owner: dbm
2007 :     Status: fixed in 109.19m
2008 :     ----------------------------------------------------------------------
2009 :     Number: 1052
2010 :     Title: crash on closing an input source
2011 :     Keywords: I/O, core dump
2012 :     Submitter: Roderick Moten <rodmoten@cs.cornell.edu>
2013 :     Date: April 16, 1996
2014 :     Version: sml-cm 109.10
2015 :     System: Sun Sparc/Sun OS 4
2016 :     Severity: minor
2017 :     Problem: sml crashes when attempting to close an input source
2018 :     Code:
2019 :     val ppconsumer = {consumer = Compiler.Control.Print.say,
2020 :     linewidth = !Compiler.Control.Print.linewidth,
2021 :     flush = Compiler.Control.Print.flush};
2022 :    
2023 :     structure Source = Compiler.Source;
2024 :    
2025 :     val fname = "../../nuprl/envs/top-loop.sml";
2026 :    
2027 :     val instream = TextIO.openIn fname;
2028 :    
2029 :     val source = Source.newSource(fname,1,instream,false,ppconsumer,
2030 :     SOME TextIO.stdOut);
2031 :    
2032 :     Source.closeSource source;
2033 :    
2034 :     Transcript:
2035 :     virgo>!!
2036 :     ~sml/src/109.10/bin/sml-cm
2037 :     Standard ML of New Jersey, Version 109.10, April 5, 1996 [CM&CMB 1]
2038 :     GC #0.0.0.0.1.5: (20 ms)
2039 :     val it = () : unit
2040 :     - val ppconsumer = {consumer = Compiler.Control.Print.say,
2041 :     linewidth = !Compiler.Control.Print.linewidth,
2042 :     flush = Compiler.Control.Print.flush};
2043 :     = = val ppconsumer = {consumer=fn,flush=fn,linewidth=79}
2044 :     : {consumer:string -> unit, flush:unit -> unit, linewidth:int}
2045 :     - structure Source = Compiler.Source;
2046 :     structure Source : SOURCE?
2047 :     - val fname = "../../nuprl/envs/top-loop.sml";
2048 :     val fname = "../../nuprl/envs/top-loop.sml" : string
2049 :     - val instream = TextIO.openIn fname;
2050 :     val instream = ref (ISTRM (-,0)) : ?.instream
2051 :     - val source = Source.newSource(fname,1,instream,false,ppconsumer,SOME TextIO.stdOut);
2052 :     val source =
2053 :     {anyErrors=ref false,errConsumer={consumer=fn,flush=fn,linewidth=79},
2054 :     fileName="../../nuprl/envs/top-loop.sml",
2055 :     indexStream=SOME
2056 :     (ref
2057 :     (OSTRM
2058 :     {buf=#,bufferMode=#,closed=#,pos=#,writeArr=#,
2059 :     writeVec=#,writer=#})),interactive=false,lineNum=ref 1,
2060 :     linePos=ref [1],sourceStream=ref (ISTRM (-,0))} : ?.inputSource
2061 :     - Source.closeSource source;
2062 :     /usr/u/sml/src/109.10/bin/.run/run.sparc-sunos: Error -- Uncaught exception Io with /usr/u/sml/src/109.10/bin/.run/run.sparc-sunos: Error -- <unknown>
2063 :     virgo>
2064 :    
2065 :     Comment:
2066 :     [jhr, 7/29/1996]
2067 :     The problem has to do with the fact that you specify stdOut as the index stream
2068 :     (the last argument to newSource). I think this is causing stdOut to be closed
2069 :     when you close the source, which causes an exception to be raised in the
2070 :     interactive top-level loop. I suggest you use NONE as the last argument to
2071 :     newSource.
2072 :    
2073 :     I think that the Index code is defunct anyway, so we will probably remove this
2074 :     from the source.
2075 :     [jhr, 4/3/97]
2076 :     This was a feature, not a bug, and anyway it is gone now (I removed the
2077 :     index stuff).
2078 :     Test: bug1052.sml
2079 :     Owner: jhr
2080 :     Status: fixed in 109.27
2081 :     ----------------------------------------------------------------------
2082 :     Number: 1053
2083 :     Title: uncaught exception Bind on opening an unbound structure
2084 :     Keywords: error message, open
2085 :     Submitter: George Chesakov <nobby@cnn.Princeton.EDU>
2086 :     Date: 4/18/96
2087 :     Version: 109.10
2088 :     Severity: major
2089 :     Problem: "open A" where A is not defined produces duplicate error
2090 :     message and then an uncaught Bind exception.
2091 :     Transcript:
2092 :     Standard ML of New Jersey, Version 109.10, April 5, 1996 [CM&CMB 1]
2093 :     GC #0.0.0.0.1.3: (5 ms)
2094 :     val it = () : unit
2095 :     - open A;
2096 :     stdIn:12.1-12.6 Error: unbound structure: A
2097 :     stdIn:12.1-12.6 Error: unbound structure: A
2098 :    
2099 :     uncaught exception in compiler: Bind
2100 :     raised at: elaborate/elabmod.sml:246.6-255.8
2101 :     elaborate/elabmod.sml:513.33
2102 :     elaborate/elabmod.sml:847.33
2103 :     util/stats.sml:168.40
2104 :     build/evalloop.sml:133.34
2105 :     build/evalloop.sml:202.62
2106 :    
2107 :     Test: bug1053.sml
2108 :     Owner: dbm
2109 :     Status: fixed in 109.19m
2110 :     ----------------------------------------------------------------------
2111 :     Number: 1054
2112 :     Title: sequential withtype is broken
2113 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
2114 :     Date: 03/24/96
2115 :     System(s) and Version: Compiler
2116 :     SML/NJ Version: 109.8 (all since at least 109.6)
2117 :     Machine: all
2118 :     Severity: minor
2119 :     Problem: sequential withtype is broken
2120 :     Code:
2121 :    
2122 :     (* bug1054.1.sml *)
2123 :    
2124 :     functor BugFun() =
2125 :     struct
2126 :     datatype t1 = c1 of t2 * t3
2127 :     withtype t2 = t1 list
2128 :     and t3 = t2 list (* this triggers the bug *)
2129 :     end;
2130 :    
2131 :     structure Bug = BugFun();
2132 :    
2133 :     (* bug1054.2.sml *)
2134 :    
2135 :     datatype t1 = c1 of t2 * t3
2136 :     withtype t2 = t1 list
2137 :     and t3 = t2 list;
2138 :    
2139 :    
2140 :     (* bug1054.3.sml *)
2141 :    
2142 :     structure Ok =
2143 :     struct
2144 :     datatype t1 = c1 of t2 * t3
2145 :     withtype t2 = t1 list
2146 :     and t3 = t2 list
2147 :     end;
2148 :    
2149 :     Transcript:
2150 :    
2151 :     Standard ML of New Jersey, Version 109.8, March 25, 1996 [CM&CMB 1]
2152 :     GC #0.0.0.0.1.5: (30 ms)
2153 :     val it = () : unit
2154 :     - use "bug1054.1.sml";
2155 :     [opening bug1054.1.sml]
2156 :     functor BugFun : <sig>
2157 :    
2158 :     uncaught exception Unbound
2159 :     raised at: elaborate/elabmod.sml:513.71-513.80
2160 :     util/stats.sml:168.40
2161 :     build/evalloop.sml:130.34
2162 :     build/evalloop.sml:199.62
2163 :     build/evalloop.sml:289.22-289.24
2164 :     - use "bug1054.2.sml";
2165 :     [opening bug1054.2.sml]
2166 :     GC #0.0.0.0.2.39: (10 ms)
2167 :     datatype t1
2168 :    
2169 :     uncaught exception Match
2170 :     raised at: print/pptype.sml:190.23
2171 :     util/pp.sml:554.6
2172 :     build/evalloop.sml:199.62
2173 :     build/evalloop.sml:289.22-289.24
2174 :     - use "bug1054.3.sml";
2175 :     [opening bug1054.3.sml]
2176 :     structure Ok :
2177 :     sig
2178 :     eqtype t3
2179 :     eqtype t2
2180 :     datatype t1 = c1 of t2 * t3
2181 :    
2182 :     end
2183 :     GC #0.0.0.0.3.92: (20 ms)
2184 :     val it = () : unit
2185 :    
2186 :     Test: bug1054.{1,2,3}.sml
2187 :     Owner: dbm
2188 :     Status: fixed in 109.19m [dbm, 11/15/96]
2189 :     ----------------------------------------------------------------------
2190 :     Number: 1055
2191 :     Title: uncaught Match will printing a datatype decl at top level
2192 :     Keywords: printing, top-level
2193 :     Submitter: Mary Fernandez
2194 :     Date: 3/25/96
2195 :     Version: 109.6
2196 :     Severity: major
2197 :     Problem: uncaught Match will printing a datatype decl at top level
2198 :     Transcript:
2199 :     Standard ML of New Jersey, Version 109.6, March 1, 1996 [CM&CMB 1]
2200 :     GC #0.0.0.0.1.2: (7 ms)
2201 :     val it = () : unit
2202 :     - datatype X = A of X | B of int;
2203 :     datatype X
2204 :    
2205 :     uncaught exception in compiler: Match
2206 :     raised at: print/pptype.sml:190.23
2207 :     util/pp.sml:554.6
2208 :     build/evalloop.sml:196.62
2209 :     Test: bug1055.sml
2210 :     Owner:
2211 :     Status: fixed in 109.19
2212 :     ----------------------------------------------------------------------
2213 :     Number: 1056
2214 :     Title: uncaught exception kills sml
2215 :     Submitter: Roderick Moten <rodmoten@cs.cornell.edu>
2216 :     Date: May 27, 1996
2217 :     Version: SML/NJ 109.10
2218 :     System: Sparc 20/Solaris 2.5
2219 :     Severity: critical
2220 :     Problem: SML dies when a compilation error occurs
2221 :     Code:
2222 :     Transcript:
2223 :     hercules.cs.cornell.edu>~sml/src/109.10/bin/sml
2224 :     Standard ML of New Jersey, Version 109.10, April 5, 1996 [new runtime]
2225 :     - val i = j;
2226 :     stdIn:7.10 Error: unbound variable or constructor: j
2227 :     ^C/usr/u/sml/src/109.10/bin/.run/run.sparc-solaris: Error -- Uncaught exception UNDEFINED with /usr/u/sml/src/109.10/bin/.run/run.sparc-solaris: Error -- 0
2228 :    
2229 :     Comments: Accurately speaking, SML dies when an exception is raised and
2230 :     isn't caught. Entering "raise Match;" at the top level will also cause SML
2231 :     to die.
2232 :    
2233 :     [jhr, 5/30/96]
2234 :     The problem seems to be that SunOS and Solaris are not ABI compatible. The
2235 :     short-term fix is to regenerate the sml.sparc heap image on a Solaris
2236 :     machine. In the longer term, we will either make heap images OS specific,
2237 :     or introduce some kind of linking mechanism to dynamically redefine OS
2238 :     constants.
2239 :    
2240 :     Owner: John
2241 :     Status: fixed in 109.21
2242 :     ----------------------------------------------------------------------
2243 :     Number: 1057
2244 :     Title: typo in error message
2245 :     Keywords: error message
2246 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
2247 :     Date: 06/19/96
2248 :     System(s) and Version: compiler
2249 :     SML/NJ Version: 109.14
2250 :     Machine: all
2251 :     Severity: microscopical
2252 :     Problem: typo in error message
2253 :     Transcript:
2254 :    
2255 :     - fun foo{x,y,...} = x + size y;
2256 :     stdIn:12.1-12.29 Error: unresolved flex record (need to know thenames of ALL the fields
2257 :     in this context)
2258 :     type: {x:int, y:string, '...Z}
2259 :     missing space here --^
2260 :    
2261 :     Comments:
2262 :     Fix:
2263 :    
2264 :     *** sml-nj/typing/typecheck.sml.~1~ Tue Jun 4 15:52:36 1996
2265 :     --- sml-nj/typing/typecheck.sml Wed Jun 19 14:47:02 1996
2266 :     ***************
2267 :     *** 100,106 ****
2268 :     WILDCARDty)
2269 :     | FLEX _ =>
2270 :     (err loc COMPLAIN
2271 :     ! "unresolved flex record (need to know the\
2272 :     \names of ALL the fields\n in this context)"
2273 :     (fn ppstrm =>
2274 :     (PPType.resetPPType();
2275 :     --- 100,106 ----
2276 :     WILDCARDty)
2277 :     | FLEX _ =>
2278 :     (err loc COMPLAIN
2279 :     ! "unresolved flex record (need to know the \
2280 :     \names of ALL the fields\n in this context)"
2281 :     (fn ppstrm =>
2282 :     (PPType.resetPPType();
2283 :    
2284 :     Test: bug1057.sml
2285 :     Owner:
2286 :     Status: fixed in 109.19
2287 :     ----------------------------------------------------------------------
2288 :     Number: 1058
2289 :     Title: misleading error message
2290 :     Keywords: error message, type printing
2291 :     Submitter: Anthony Shipman <als@tusc.com.au>
2292 :     Date: 7/11/96
2293 :     Version: 109.x
2294 :     Severity: major
2295 :     Problem:
2296 :     The error below comes from the array arg to FGDyn.sub being of type
2297 :     FGInfoDyn.array but the error message suggests that the second argument
2298 :     was of the wrong type.
2299 :    
2300 :     Code:
2301 :     type FGNTag = int
2302 :    
2303 :     structure FGDyn = DynamicArrayFn(FGMono)
2304 :     structure FGInfoDyn = DynamicArrayFn(FGInfoMono)
2305 :    
2306 :    
2307 :     type FG = {
2308 :     part: FGDyn.array,
2309 :     info: FGInfoDyn.array
2310 :     }
2311 :    
2312 :     fun get_node_info(fg: FG, tag: FGNTag) =
2313 :     (
2314 :     FGDyn.sub(#info fg, tag)
2315 :     )
2316 :     Transcript:
2317 :     flow_graph.sml:166.5-168.5 Error: operator and operand don't agree (tycon mismatch)
2318 :     operator domain: ?.array * int
2319 :     operand: ?.array * FGNTag
2320 :     in expression:
2321 :     sub ((fn <pat> => <exp>) fg,tag)
2322 :     Comments: [dbm, 11/5/96] another case of inaccurate printing of type names
2323 :     Owner: dbm
2324 :     Status: open
2325 :     ----------------------------------------------------------------------
2326 :     Number: 1059
2327 :     Title: polyeq broken for vectors
2328 :     Keywords: polyeq, vectors
2329 :     Submitter: "Daniel C. Wang" <dw3u+@andrew.cmu.edu>
2330 :     Date: 4/2/96
2331 :     System(s) and Version: Compiler
2332 :     SML/NJ Version: 109.8
2333 :     Machine: SunOS, HPUX
2334 :     Severity: major
2335 :     Problem: polymorphic equality is broken for vector values
2336 :     Code: - #[1] = #[1,2]
2337 :     val it = true : bool
2338 :     Transcript:
2339 :    
2340 :     Standard ML of New Jersey, Version 109.8, March 25, 1996 [CM&CMB 1]
2341 :     - #[1,2] = #[1,2];
2342 :     val it = true : bool
2343 :    
2344 :     - #[1,2] = #[1];
2345 :     val it = false : bool
2346 :    
2347 :     - #[1] = #[1,2];
2348 :     val it = true : bool
2349 :     -
2350 :     Comments: Basicly the polyequal code assumes that it's second
2351 :     argument is shorter than the first.
2352 :     Fix:
2353 :    
2354 :     >From core.sml
2355 :    
2356 :     fun polyequal (a : 'a, b : 'a) = peql(a,b)
2357 :     orelse (boxed a andalso boxed b
2358 :     andalso let val aTag = getObjTag a
2359 :     fun pairEq () =
2360 :     let val bTag = getObjTag b
2361 :     in (ieql(bTag,0x02) orelse ineq(andb(bTag,0x3),0x2))
2362 :     andalso polyequal(sub(a,0), sub(b,0))
2363 :     andalso polyequal(sub(a,1), sub(b,1))
2364 :     end
2365 :     in case aTag
2366 :     of 0x02 (* tag_pair *) => pairEq()
2367 :     | 0x06 (* tag_reald *) => feql(cast a,cast b)
2368 :     | 0x12 (* tag_special *) => false
2369 :     | 0x22 (* tag_record *) =>
2370 :     if ieql(getObjTag b,aTag)
2371 :     then let val lenm1 = (length a)-1
2372 :     fun m (j : int) = if ieql(j,lenm1)
2373 :     then polyequal(sub(a,j),sub(b,j))
2374 :     else polyequal(sub(a,j),sub(b,j))
2375 :     andalso m(j+1)
2376 :     (****Change*********)
2377 :     in ieql(length a,length b) andalso m 0
2378 :     (****Change*********)
2379 :     end
2380 :     else false
2381 :     | 0x26 (* tag_array *) => false
2382 :     | 0x2a (* tag_string *) =>
2383 :     stringequal(cast a,cast b)
2384 :     | 0x32 (* tag_bytearray *) => false
2385 :     | 0x36 (* tag_realdarray *) => false
2386 :     | _ (* tagless pair *) => pairEq()
2387 :     (* end case *)
2388 :     end)
2389 :    
2390 :     Test: bug1059.sml
2391 :     Owner:
2392 :     Status: fixed in 109.10 [jhr]
2393 :     ----------------------------------------------------------------------
2394 :     Number: 1060
2395 :     Title: modmap cleanup expensive
2396 :     Keywords: modmap, top level
2397 :     Submitter: Dave MacQueen
2398 :     Date: 11/5/96
2399 :     Version: 109.21
2400 :     Severity: major
2401 :     Problem:
2402 :     SCStatEnv (env/scstatenv.sml) doesn't cleanup the modmaps when
2403 :     layering its augmented static environments (function atop), which
2404 :     means that inaccessible structures, signatures, functors etc.
2405 :     may not be garbage collected because they still appear in the
2406 :     modmaps. This could cause some noticeable space bloat.
2407 :    
2408 :     The modmaps in the top level static environments are now cleaned up by
2409 :     applying unSC and then SC to the sc staticEnv. This is unacceptably
2410 :     expensive. Need a new method of cleaning up, or need to do this only
2411 :     occasionally.
2412 :    
2413 :     The following code is in the main loop in build/evalloop.sml, and
2414 :     it appears to be the culprit in a fairly noticeable slowdown in
2415 :     the interactive system, especially on slow systems (see message
2416 :     below).
2417 :    
2418 :     val newEnv = SCEnv.Env.concatEnv
2419 :     ({static=newenv,dynamic=new_dynenv,symbolic = new_symenv},
2420 :     #get localEnvRef ())
2421 :     (* refetch localEnvRef because execution may
2422 :     have changed its contents *)
2423 :    
2424 :     It looks like the reason this is slow is the definition of
2425 :     SCEnv.Env.concatEnv:
2426 :    
2427 :     fun concatEnv(a,b) = SC(E.concatEnv(unSC a, unSC b))
2428 :    
2429 :     In this case, parameter b is the contents of localEnvRef, which in
2430 :     sml-cm has a lot of stuff in it, and SC is having to rescan this
2431 :     environment and rebuild the modmap at each top-level binding. I
2432 :     guess this drastic approach is taken to make sure that inaccessible
2433 :     entities (types, signatures, modules) get cleaned out of the modmap
2434 :     component of the top-level environment so they can be
2435 :     garbage-collected.
2436 :    
2437 :     We need to find a more efficient way of doing this, assuming this
2438 :     is the correct explanation of the slowdown.
2439 :    
2440 :     Dave
2441 :    
2442 :     Date: Mon, 12 Aug 1996 13:57:05 -0500 (CDT)
2443 :     From: Allen Stoughton <cis.ksu.edu!allen>
2444 :     To: research.att.com!sml-nj
2445 :     Subject: Top-level declaration processing overhead in 109.16?
2446 :    
2447 :     I've noticed that there seems to be a large overhead associated with
2448 :     processing a top-level declaration in SML/NJ 109.16.
2449 :    
2450 :     E.g., it makes a big difference whether one types
2451 :    
2452 :     - val x = 1; val x = 1; val x = 1; val x = 1; val x = 1; val x = 1; val x = 1;
2453 :    
2454 :     or
2455 :    
2456 :     - val x = 1 val x = 1 val x = 1 val x = 1 val x = 1 val x = 1 val x = 1;
2457 :    
2458 :     On a slow SPARC (SPARCstation 1+) the latter takes about 2 seconds, and
2459 :     the former takes about 14 seconds (two seconds per top-level declaration).
2460 :    
2461 :     On a fast (unloaded!) SPARC, of course, one hardly notices the difference...
2462 :    
2463 :     In contrast, with SML/NJ 0.93, the former takes only slightly more than
2464 :     1 second, and the later seems to take hardly any time.
2465 :    
2466 :     Is this a known problem? I'm worried about teaching with an implementation
2467 :     in which students must put up with such response times...
2468 :    
2469 :     Allen
2470 :    
2471 :     Comment: The main performance problem was an incorrect implementation
2472 :     of Env.fold that is fixed in 109.22.
2473 :    
2474 :     Owner: blume, dbm
2475 :     Status: open
2476 :     ----------------------------------------------------------------------
2477 :     Number: 1061
2478 :     Title: RealArray incorrect on x86/Linux
2479 :     Keywords: RealArray, linux, x86
2480 :     Submitter: Sven Doerr <sd@ira.uka.de>
2481 :     Date: 4/24/96
2482 :     Version: 109.10
2483 :     System: x86-linux (linux 1.3.74)
2484 :     Severity: major
2485 :     Problem: RealArray incorrect on x86/Linux
2486 :     Transcript:
2487 :     Standard ML of New Jersey, Version 109.10, April 5, 1996 [new runtime]
2488 :     - RealArray.array(10,1.0);
2489 :     val it = - : ?.realarray
2490 :     - RealArray.sub(it, 8);
2491 :     val it = 6.15911642003e~312 : real
2492 :    
2493 :     Fix: The fix is in /home/lorenz/sml/nj/109.X/src/runtime/mach-dep/X86.prim.asm
2494 :     Test: bug1061.sml
2495 :     Owner:
2496 :     Status: fixed in 109.19
2497 :     ----------------------------------------------------------------------
2498 :     Number: 1062
2499 :     Title: checkCPUTimer raises exception Time
2500 :     Keywords: checkCPUTTimer, cpu time
2501 :     Submitter: Roland Olsson <ROLANDO@sofus.hiof.no>
2502 :     Date: 4/24/96
2503 :     Version: 109.10
2504 :     System: x86-linux (200 MHz Pentium Pro, Linux 1.2.13)
2505 :     Severity: major
2506 :     Problem: The checkCPUTimer function sometimes gives the following:
2507 :    
2508 :     uncaught exception Time
2509 :     boot/time.sml: 78.19-78.22
2510 :    
2511 :     (checkCPUTimer is being called very soon after creating the timer)
2512 :     Comments: [jhr, 4/24/96]
2513 :     We've seen a similar bug under FreeBSD and NetBSD on x86 machines.
2514 :     The problem is that calls to getrusage may not return monotonically
2515 :     increasing values for CPU time. It has something to do with the way
2516 :     that CPU usage is computed. You could see if this is the problem
2517 :     on your machine by adding "defined(OPSYS_LINUX)" to the #ifdef
2518 :     on line 66 of runtime/kernel/unix-timers.c. Let me know if this fixes
2519 :     the problem (or if it doesn't).
2520 :    
2521 :     Owner: John
2522 :     Status: fixed in 109.21
2523 :     ----------------------------------------------------------------------
2524 :     Number: 1063
2525 :     Title: signals not handled when running a saved heap image
2526 :     Keywords: signals, control-C, exportML
2527 :     Submitter: Robin Sharp <robin@idatm4.it.dtu.dk>
2528 :     Date: 5/8/96
2529 :     Version: 109
2530 :     System: ?
2531 :     Severity: major
2532 :     Problem:
2533 :     The handling of signals in SML-NJ 109 seems to be spoiled if a heap image
2534 :     is saved with exportML, for example in the following way:
2535 :    
2536 :     Code:
2537 :     fun xML filename banner =
2538 :     let val runtime = List.hd (SMLofNJ.getAllArgs())
2539 :     val exec_file = IO.open_out filename
2540 :    
2541 :     val _ = IO.output (exec_file,
2542 :     String.concat
2543 :     ["#!/bin/sh\n",
2544 :     runtime, " @SMLdebug=/dev/null @SMLload=", filename,
2545 :     ".heap\n"])
2546 :     (*"@SMLdebug=..." sends GC messages to /dev/null*)
2547 :    
2548 :     val _ = IO.close_out exec_file;
2549 :     val _ = OS.Process.system ("chmod a+x " ^ filename)
2550 :     in exportML (filename^".heap");
2551 :     print(banner^"\n")
2552 :     end;
2553 :    
2554 :     xML "Goofy" "New image starts here...";
2555 :    
2556 :     Comments:
2557 :     Starting the new image Goofy, one finds that Ctrl/C aborts the program,
2558 :     rather than just causing an interrupt (with printing of "Interrupt").
2559 :    
2560 :     After a very large image has been saved (example: the Isabelle system),
2561 :     the effects of Ctrl/C and Ctrl/D become pretty unpredictable. In the
2562 :     Isabelle case, Ctrl/C has no effect, and a looping/long-running
2563 :     calculation cannot be interrupted. In another case, Ctrl/D is not
2564 :     caught and interpreted as EOF (in the end_of_stream function),
2565 :     but causes immediate program exit.
2566 :    
2567 :     [jhr, 5/8/96]
2568 :     I was able to reproduce this bug in 109, but not in 109.11. Here is the
2569 :     109.11 code:
2570 :    
2571 :     fun xML filename banner =
2572 :     let val runtime = List.hd (SMLofNJ.getAllArgs())
2573 :     val exec_file = TextIO.openOut filename
2574 :    
2575 :     val _ = TextIO.output (exec_file,
2576 :     String.concat
2577 :     ["#!/bin/sh\n",
2578 :     runtime, " @SMLdebug=/dev/null @SMLload=", filename,
2579 :     "-image\n"])
2580 :     (*"@SMLdebug=..." sends GC messages to /dev/null*)
2581 :    
2582 :     val _ = TextIO.closeOut exec_file;
2583 :     val _ = OS.Process.system ("chmod a+x " ^ filename)
2584 :     in SMLofNJ.exportML (filename ^ "-image");
2585 :     print(banner^"\n")
2586 :     end;
2587 :    
2588 :     Owner:
2589 :     Status: fixed in 109.11
2590 :     ----------------------------------------------------------------------
2591 :     Number: 1064
2592 :     Title: type name printing in signature
2593 :     Keywords: type printing, signature
2594 :     Submitter: John Reppy
2595 :     Date: 5/29/96
2596 :     Version: 109.10
2597 :     Severity: major
2598 :     Problem: proper type path not printed, structure name replaced by ?
2599 :     Transcript:
2600 :     Standard ML of New Jersey, Version 109.10, April 5, 1996 [CM&CMB 1]
2601 :     val it = () : unit
2602 :     - signature ORD_KEY = sig
2603 :     = type ord_key
2604 :     = val compare : ord_key * ord_key -> order
2605 :     = end;
2606 :     signature ORD_KEY =
2607 :     sig
2608 :     type ord_key
2609 :     val compare : ord_key * ord_key -> order
2610 :     end
2611 :     - signature ORD_LIST = sig
2612 :     = structure Key : ORD_KEY
2613 :     = type 'a ord_list
2614 :     = val find : ('a ord_list * Key.ord_key) -> 'a
2615 :     = end;
2616 :     signature ORD_LIST =
2617 :     sig
2618 :     structure Key :
2619 :     sig
2620 :     type ord_key
2621 :     val compare : ord_key * ord_key -> order
2622 :     end
2623 :     type 'a ord_list
2624 :     val find : 'a ord_list * ?.ord_key -> 'a
2625 :     end
2626 :     Test: bug1064.sml
2627 :     Owner: dbm
2628 :     Status: fixed in 109.19m [dbm, 11/15/96]
2629 :     ----------------------------------------------------------------------
2630 :     Number: 1065
2631 :     Title: bug in sockets code
2632 :     Keywords: sockets
2633 :     Submitter: Michael Colon <colon@Theory.Stanford.EDU>
2634 :     Date: 6/1/96
2635 :     Version: 109
2636 :     Severity: major
2637 :     Problem: sockets code incorrect
2638 :     Fix:
2639 :    
2640 :     file: boot/Sockets/socket.sml
2641 :     line: 203
2642 :     func: chk
2643 :    
2644 :     reads: else (buf, i, sz - i)
2645 :     should read?: else (buf, i, sz)
2646 :    
2647 :     Owner:
2648 :     Status: fixed in 109.14 (jhr)
2649 :     ----------------------------------------------------------------------
2650 :     Number: 1066
2651 :     Title: Fail: uninstantiated VARty in pickmod
2652 :     Keywords: pickling
2653 :     Submitter: Andy Koenig
2654 :     Date: 6/14/96
2655 :     Version: 109.14, 109.19
2656 :     Severity: major
2657 :     Problem: pickling raises Fail: uninstantiated VARty in pickmod
2658 :     Code: (bug1066.sml)
2659 :     fun f() = [];
2660 :     let val x = f() in x end;
2661 :     Transcript: (109.19)
2662 :     - use "tests/bug1066.sml";
2663 :     [opening tests/bug1066.sml]
2664 :     val f = fn : unit -> 'a list
2665 :     tests/bug1066.sml:4.5-4.16 Warning: value restriction prevents type variable generalization : 'Z
2666 :    
2667 :     uncaught exception Fail: uninstatiated VARty in pickmod
2668 :     raised at: pickle/pickmod.sml:483.14-483.51
2669 :     util/stats.sml:168.40
2670 :     util/stats.sml:168.40
2671 :     build/evalloop.sml:145.36
2672 :     build/evalloop.sml:232.54
2673 :     build/evalloop.sml:316.38-316.41
2674 :     -
2675 :    
2676 :     Here is another instance discovered by Zhong:
2677 :    
2678 :     - local val (x, y) = (ref nil, ref nil)
2679 :     in val z = x
2680 :     end;
2681 :     stdIn:7.7-7.37 Warning: value restriction prevents type variable generalization : 'Z
2682 :     stdIn:7.7-7.37 Warning: value restriction prevents type variable generalization : 'Y
2683 :    
2684 :     uncaught exception in compiler: Fail: uninstatiated VARty in pickmod
2685 :     raised at: pickle/pickmod.sml:467.14-467.50
2686 :     util/stats.sml:168.40
2687 :     util/stats.sml:168.40
2688 :     build/evalloop.sml:142.34
2689 :     build/evalloop.sml:209.62
2690 :    
2691 :     Fix:
2692 :     Added test in META case in Typecheck.decType:generalizeTy:gen to
2693 :     detect when depth was 0, indicating that the type variable had failed
2694 :     to be generalized at top level.
2695 :     Test: bug1066.1.sml, bug1066.2.sml
2696 :     Owner: dbm, Zhong
2697 :     Status: fixed in 109.26 [dbm, 3/18/97]
2698 :     ----------------------------------------------------------------------
2699 :     Number: 1067
2700 :     Title: mkWriter behavior wrong
2701 :     Keywords: mkWriter, posix
2702 :     Submitter: Lorenz Huelsbergen
2703 :     Date: 6/27/96
2704 :     Version: 109.?
2705 :     Severity: major
2706 :     Problem:
2707 :     The mkWriter function in boot/posix-bin-prim-io.sml does not update
2708 :     the file position on a write. This seems to contradict the semantics
2709 :     of the IO document for writers that implement the *Pos functions;
2710 :     or am I missing something?
2711 :    
2712 :     Owner: John
2713 :     Status: fixed in 109.21
2714 :     ----------------------------------------------------------------------
2715 :     Number: 1068
2716 :     Title: function printed as "<primop>" rather than "<fn>"
2717 :     Keywords: printing, top-level
2718 :     Submitter: Allen Stoughton <allen@cis.ksu.edu>
2719 :     Date: 6/26/96
2720 :     Version: 109.?
2721 :     Severity: minor
2722 :     Problem:
2723 :     Is there a reason why SML/NJ chooses to report some built-in function
2724 :     values as <primop>'s rather than as fn's?
2725 :    
2726 :     - op o;
2727 :     val it = <primop> : ('a -> 'b) * ('c -> 'a) -> 'c -> 'b
2728 :     - op hd;
2729 :     val it = fn : 'a list -> 'a
2730 :    
2731 :     From the user's point of view, is there really a good reason to
2732 :     distinguish between these two kinds of things? I ask partly because I
2733 :     have to (try to) explain to my students each semester why <primop> has
2734 :     unexpectedly appeared above...
2735 :    
2736 :     Test: bug1068.sml
2737 :    
2738 :     Owner: ?
2739 :     Status: fixed in 109.26
2740 :     ----------------------------------------------------------------------
2741 :     Number: 1069
2742 :     Title: output not flushed when program terminates
2743 :     Keywords: output, termination
2744 :     Submitter: Anthony Shipman <tusc.com.au!als>
2745 :     Date: 7/19/96
2746 :     Version: 109.15
2747 :     System: ?
2748 :     Severity: major
2749 :     Problem:
2750 :     Output from TextIO is not flushed at the end of program execution.
2751 :     I have to remember to do a closeOut or something. Is this deliberate?
2752 :     Comments: [jhr, 7/19/96]
2753 :     This is a bug. I'll fix it for 109.16.
2754 :     Owner:
2755 :     Status: fixed in 109.16?
2756 :     ----------------------------------------------------------------------
2757 :     Number: 1070
2758 :     Title: cm fails to write file
2759 :     Keywords: cm
2760 :     Submitter: Roderick Moten rodmoten@cs.cornell.edu
2761 :     Date: Mon. July 22, 1996
2762 :     Version: sml-full-cm 109.10
2763 :     System: Sparc/Solaris 2.5
2764 :     Severity: major
2765 :     Problem: When attempting to rebuild the compile, cm fails to write assembly.sig.bin after it compiles it.
2766 :     Comments:
2767 :     In the transcript, PollEvent = 223686 is printed due to a minor change I made to the runtim system to print the value of PollEvent when a garbage collection check is performed.
2768 :    
2769 :     Code: Changes to runtime system can be sent on request. Changes are addition
2770 :     to runtime system to support MP for Solaris.
2771 :    
2772 :     Transcript:
2773 :     /../bin/.run/run.mp-sparc-solaris-asm-g @SMLload=/home/sml/src/109.10/bin/.heap/sml-full-cm.sparc
2774 :     Standard ML of New Jersey, Version 109.10, April 5, 1996 [CM&CMB 1]
2775 :     val it = () : unit
2776 :     - Compiler.Control.CG.pollChecks := true;
2777 :     val it = () : unit
2778 :     - SparcVisComp.Control.CG.pollChecks := true;
2779 :     val it = () : unit
2780 :     - CMB.make();
2781 :     [scanning boot/all-files.cm]
2782 :     PollEvent = 223686
2783 :     PollEvent = 223686
2784 :     PollEvent = 223686
2785 :     [checking boot/CM/sparc-unix/all-files.cm.stable ... not usable]
2786 :     [scanning boot/pervasives.cm]
2787 :     [checking boot/CM/sparc-unix/pervasives.cm.stable ... not usable]
2788 :     Directory bin.sparc already existed
2789 :     [Cleaning out binfile directory]
2790 :     Recompiling boot directory...
2791 :     [compiling (boot) boot/assembly.sig -> bin.sparc/assembly.sig.bin]
2792 :     WARNING: no Core access
2793 :     WARNING: no Core access
2794 :     WARNING: no Core access
2795 :     [writing bin.sparc/assembly.sig.bin failed]
2796 :    
2797 :     uncaught exception Io: openOut failed on file bin.sparc/assembly.sig.bin with SysErr: No such file or directory [<OS.errorName unimplemented>]
2798 :     raised at: boot/NewIO/bin-io-fn.sml:620.25-620.71
2799 :     compile/cunit.sml:139.13-139.15
2800 :    
2801 :     Owner: Matthias
2802 :     Status: not reproducible
2803 :     ----------------------------------------------------------------------
2804 :     Number: 1071
2805 :     Title: nonexhaustive match failure while elaborating signature
2806 :     Keywords: signature, Match, match failure
2807 :     Submitter: John Reppy
2808 :     Date: 7/22/96
2809 :     Version: 109.?
2810 :     Severity: major
2811 :     Problem: nonexhaustive match failure while elaborating signature
2812 :     Code: ~jhr/sml/bmark-suite/programs/boyer
2813 :     Transcript:
2814 :     uncaught exception nonexhaustive match failure
2815 :     raised at: elaborate/elabsig.sml:516.5
2816 :     elaborate/elabmod.sml:639.33
2817 :     util/stats.sml:168.40
2818 :     build/evalloop.sml:133.34
2819 :     build/evalloop.sml:202.62
2820 :     build/evalloop.sml:292.22-292.24
2821 :     Comments: [dbm, 11/5/96] Probably same as bug 1051. open spec in signature
2822 :     at line 8 of boyer.sml.
2823 :     Fix: open in signature is now a syntax error
2824 :     Owner: dbm
2825 :     Status: fixed in 109.19m
2826 :     ----------------------------------------------------------------------
2827 :     Number: 1072
2828 :     Title: Compiler bug secondary error while elaborating bad functor
2829 :     Keywords: modules, functor
2830 :     Submitter: John Reppy
2831 :     Date: 8/2/1996
2832 :     Version: 109.19
2833 :     System:
2834 :     Severity: major
2835 :     Problem: "Compiler bug: setTycSaccess ERRORtyc" elaborating functor
2836 :     Transcript:
2837 :     - functor F (
2838 :     = structure X : sig type t end
2839 :     = structure T : sig type t end
2840 :     = sharing type T.t = Y.t
2841 :     = ) = struct end;
2842 :     stdIn:15.18-15.26 Error: unbound structure: Y in path Y.t
2843 :     Error: Compiler bug: setTycSaccess ERRORtyc
2844 :     -
2845 :    
2846 :     In 109.19m the secondary error has become
2847 :    
2848 :     Error: Compiler bug: ModuleUtil: tycId
2849 :    
2850 :     Test: bug1072.sml
2851 :     Owner: dbm
2852 :     Status: fixed in 109.25.1 [Zhong?]
2853 :     ----------------------------------------------------------------------
2854 :     Number: 1073
2855 :     Title: bug in config for 109.16 on hppa
2856 :     Keywords: configuration, HPPA
2857 :     Submitter: Anthony Shipman <tusc.com.au!als>
2858 :     Date: 8/5/1996
2859 :     Version: 109.16
2860 :     System: hppa-unix
2861 :     Severity: major
2862 :     Problem: inconsistent names for header file
2863 :     Fix:
2864 :     Here is a simple patch for the problem. The runtime and the install.sh had
2865 :     different ideas about what the suffix should be.
2866 :    
2867 :     *** machine-id.h-orig Mon Aug 5 14:59:53 1996
2868 :     --- machine-id.h Mon Aug 5 15:07:24 1996
2869 :     ***************
2870 :     *** 35,40 ****
2871 :     --- 35,42 ----
2872 :     #if defined(OPSYS_UNIX)
2873 :     # if (defined(OPSYS_AIX))
2874 :     # define OPSYS_ID "aix"
2875 :     + # elif (defined(OPSYS_HPUX))
2876 :     + # define OPSYS_ID "hpux"
2877 :     # elif (defined(OPSYS_FREEBSD) || defined(OPSYS_NETBSD))
2878 :     # define OPSYS_ID "bsd"
2879 :     # elif (defined(OPSYS_IRIX4) || defined(OPSYS_IRIX5))
2880 :    
2881 :     Owner: John
2882 :     Status: fixed in 109.21
2883 :     ----------------------------------------------------------------------
2884 :     Number: 1074
2885 :     Title: Infinite loop on divide-by-0 exception
2886 :     Keywords: divide, floating point, infinite loop, rs6000
2887 :     Submitter: Zhong Shao (shao@cs.yale.edu)
2888 :     Date: August 8, 1996
2889 :     Version: 108.21 to 109.15
2890 :     System: rs6000-aix
2891 :     Severity: minor
2892 :     Problem: Infinite loop on divide-by-0 exception
2893 :     Code:
2894 :     4.0 / 0.0;
2895 :     Transcript:
2896 :    
2897 :     powered% sml
2898 :     Standard ML of New Jersey, Version 109.15, July 12, 1996 [CM&CMB 1]
2899 :     val it = () : unit
2900 :     - 4.0/3.0;
2901 :     val it = 1.33333333333 : real
2902 :    
2903 :     - 4.0/0.0;
2904 :     GC #0.0.0.1.2.50: (120 ms)
2905 :     GC #0.0.0.1.3.51: (140 ms)
2906 :     GC #0.0.0.2.4.58: (710 ms)
2907 :     GC #0.0.1.3.5.59: (830 ms)
2908 :    
2909 :     Interrupt
2910 :    
2911 :     Comments: The bug seems to only occur on the RS6000 platform.
2912 :     Exception is raised correctly on sparc-solaris.
2913 :    
2914 :     Comments: [Neil Inala, 8/13/1996]
2915 :     The following code segments all give the same perpetual GC problem
2916 :     with the divide-by-zero exception. It seems to have something to
2917 :     do with refs. I don't think the particular value of any of the
2918 :     reals gives a problem (except of course 0.0).
2919 :    
2920 :     These both compile and f(1.0) executes fine, but
2921 :     trying to get the value of v gives perpetual GC:
2922 :    
2923 :     val v = ref 4.0;
2924 :     fun f(x) = v := x / 0.0;
2925 :    
2926 :     or:
2927 :    
2928 :     val v = ref 4.0;
2929 :     fun f(x) = v := x / real(0);
2930 :    
2931 :    
2932 :     This compiles and f(1.0) and g(1.0) execute fine, but
2933 :     trying to get the value of v gives perpetual GC:
2934 :    
2935 :     val v = ref 4.0;
2936 :     fun f(x) = (v := x / 0.0; v)
2937 :     fun g(x) = (v := x / 0.0; !v)
2938 :    
2939 :     This compiles and f(1.0) executes fine, but
2940 :     trying to get the value of v or w gives perpetual GC:
2941 :     val v = ref 4.0;
2942 :     val w = ref 5.0;
2943 :     fun f(x) = w := (v := x / 0.0; !v)
2944 :    
2945 :     Comment: [jhr, 8/13/1996]
2946 :     I wonder if trapping divide by zero is disabled and the looping
2947 :     is the printer trying to print a NaN? I guess that moving to
2948 :     non-trapping arithmetic should fix this problem.
2949 :    
2950 :     Comment: [lal, 8/96]
2951 :     The bug has to do with the fact that the floating point traps are not
2952 :     correctly enabled.
2953 :    
2954 :     Test: bug1074.sml
2955 :     Owner: John
2956 :     Status: obsolete [new basis]
2957 :     ----------------------------------------------------------------------
2958 :     Number: 1075
2959 :     Title: Infinite loop during profiling
2960 :     Keywords: profile, infinite loop
2961 :     Submitter: Zhong Shao (shao@cs.yale.edu)
2962 :     Date: August 8, 1996
2963 :     Version: 109.15
2964 :     System: rs6000-aix
2965 :     Severity: minor
2966 :     Problem: Infinite loop during profiling
2967 :     Code:
2968 :     Compiler.Profile.setMode(Compiler.Profile.LATENT);
2969 :     fun f x = 3;
2970 :     Compiler.Profile.reset();
2971 :     f 3;
2972 :     Compiler.Profile.report(TextIO.stdOut);
2973 :    
2974 :     Transcript: (* The above code infinite loops *)
2975 :    
2976 :     powered% sml
2977 :     Standard ML of New Jersey, Version 109.15, July 12, 1996 [CM&CMB 1]
2978 :     GC #0.0.0.0.1.1: (10 ms)
2979 :     val it = () : unit
2980 :     - Compiler.Profile.setMode(Compiler.Profile.LATENT);
2981 :     fun f x = 3;
2982 :     Compiler.Profile.reset();
2983 :     f 3;
2984 :     Compiler.Profile.report(TextIO.stdOut);
2985 :     Creating profiled version of standard library
2986 :     GC #0.0.0.1.2.48: (40 ms)
2987 :     val it = () : unit
2988 :     - val f = fn : 'a -> int
2989 :     - val it = () : unit
2990 :     - GC #0.0.0.1.3.111: (20 ms)
2991 :     val it = 3 : int
2992 :     - %time cumsec #call name
2993 :    
2994 :    
2995 :     Comments: There are no GC messages, so the infinite loop does not
2996 :     allocate. The profiling works ok on sparc-solaris.
2997 :     Test: bug1075.sml
2998 :     Owner: John
2999 :     Status: fixed in 109.32 [jhr, 9/22/97]
3000 :     ----------------------------------------------------------------------
3001 :     Number: 1076
3002 :     Title: CM+exportFn creates too large images
3003 :     Keywords: cm, image size
3004 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
3005 :     Date: 08/12/96
3006 :     System(s) and Version: probably CM and/or runtime
3007 :     SML/NJ Version: 109.16
3008 :     Machine: sparc-solaris; maybe others?
3009 :     Severity: major
3010 :     Problem: CM+exportFn creates too large images
3011 :     Code:
3012 :     Transcript:
3013 :     Comments:
3014 :    
3015 :     I'm observing large variations in the sizes of images (from exportFn)
3016 :     when using CM. Specifically, when doing a clean build (all CM sub-directories
3017 :     removed, newly started sml-cm process) so that CM recompiles everything,
3018 :     the images are from 29% to 70% larger than normal. If I then restart
3019 :     sml-cm and CM.make() again, the exported images are back to normal sizes.
3020 :     I suspect some form of space leak, perhaps in CM (but shoudln't CM.clear()
3021 :     empty all in-core caches?).
3022 :    
3023 :     Here is a list of some of my SML applications, and the image sizes
3024 :     after a 1st (clean) build, and then after a 2nd (trivial) build.
3025 :    
3026 :     application 1st build 2nd build 1st/2nd increase
3027 :    
3028 :     rml2c: 2008828 1181332 70%
3029 :     rmli: 1130652 799940 41%
3030 :     rmli-V2: 1270468 873288 45%
3031 :     emil: 849620 659064 29%
3032 :     xdrgen: 585316 396336 48%
3033 :    
3034 :     Comment: [blume, 8/12/96]
3035 :     You said you are using exportFn. Do your projects themselves make any
3036 :     references to CM? If this is not the case (the size of the images
3037 :     seem to support this), then CM has nothing to do with it, because all
3038 :     of it should get stripped out by exportFn.
3039 :    
3040 :     [Mikael Pettersson, 3/13/97]
3041 :     08/12/96 I reported a problem I've been having with 109.16 and some
3042 :     earlier versions: exportFn created overly large images for "1st builds"
3043 :     using CM. Since then, whatever caused this seems to have been fixed,
3044 :     because now (with 109.25 and 109.25.2) the "1st build" produces images
3045 :     of normal sizes. However, for some reason the "2nd build" (which is a
3046 :     CM.make() that doesn't have to recompile anything) now results in slightly
3047 :     (a few %) _larger_ images. (Nothing else has changed. Same machine,
3048 :     same OS, same SML code.)
3049 :    
3050 :     So perhaps #1076 can be taken off the openbugs list now?
3051 :    
3052 :     Owner: Matthias
3053 :     Status: fixed in 109.26 [Matthias]
3054 :     ----------------------------------------------------------------------
3055 :     Number: 1077
3056 :     Title: lack of info in CM error message
3057 :     Keywords: CM, error message
3058 :     Submitter: Anthony Shipman <tusc.com.au!als>
3059 :     Date: 8/13/1996
3060 :     Version: 109.16
3061 :     Severity: minor
3062 :     Problem:
3063 :     The following error is not very useful. It would be an improvement
3064 :     if the names in the cycle were listed.
3065 :    
3066 :     !* CM error: ../semantics/utils.sml: cycle among definitions involving structure
3067 :     SemUtils
3068 :    
3069 :     Owner: Matthias
3070 :     Status: fixed in 109.22
3071 :     ----------------------------------------------------------------------
3072 :     Number: 1078
3073 :     Title: exception Unbound generated when applying a functor
3074 :     Keywords: modules, functor, Unbound exception
3075 :     Submitter: Stephen Weeks <research.nj.nec.com!sweeks+>
3076 :     Date: 8/14/1996
3077 :     Version: 109.15
3078 :     Severity: major
3079 :     Problem: exception Unbound generated when applying a functor
3080 :     Transcript:
3081 :     Standard ML of New Jersey, Version 109.15, July 12, 1996 [CM&CMB 1]
3082 :     val it = () : unit
3083 :     - functor Bug() =
3084 :     struct
3085 :     datatype foo = Foo
3086 :     withtype bar = int
3087 :     and baz = bar list
3088 :     end;
3089 :     functor Bug : <sig>
3090 :     - structure Bug = Bug();
3091 :    
3092 :     uncaught exception in compiler: exception Unbound
3093 :     raised at: elaborate/elabmod.sml:513.71-513.80
3094 :     util/stats.sml:168.40
3095 :     build/evalloop.sml:133.34
3096 :     build/evalloop.sml:202.62
3097 :    
3098 :     Test: bug1078.sml
3099 :     Owner: dbm
3100 :     Status: fixed in 109.19m [dbm, 11/15/96]
3101 :     ----------------------------------------------------------------------
3102 :     Number: 1079
3103 :     Title: constructor types omitted when printing structure signature
3104 :     Keywords: printing, top level, signature, datatype
3105 :     Submitter: Norman Ramsey
3106 :     Date: 8/15/96
3107 :     Version: 109.16
3108 :     Severity: major
3109 :     Transcript:
3110 :     - structure foo = struct datatype 'a group = GROUP of 'a list | SINGLE of 'a end;
3111 :     structure foo :
3112 :     sig
3113 :     datatype 'a group = GROUP | SINGLE
3114 :    
3115 :     end
3116 :    
3117 :     Test: bug1079.sml
3118 :     Owner: dbm
3119 :     Status: fixed in 109.28 [dbm, 4/29/97]
3120 :     ----------------------------------------------------------------------
3121 :     Number: 1080
3122 :     Title: "Compiler bug: SigMatch.lookStr 2a" during signature match
3123 :     Keywords: signature match, compiler bug
3124 :     Submitter: Norman Ramsey
3125 :     Date: 8/19/96
3126 :     Version: 109.16?
3127 :     Severity: major
3128 :     Transcript:
3129 :     [compiling link.sml (via: link.sml@link.nw) -> CM/x86-unix/link.sml.bin]
3130 :     link.nw:22.23-22.46 Error: unmatched structure specification: Denotable
3131 :     link.nw:22.23-22.46 Error: unmatched type specification: group
3132 :     link.nw:22.23-22.46 Error: unmatched constructor specification: GROUP
3133 :     link.nw:22.23-22.46 Error: unmatched constructor specification: SINGLE
3134 :     link.nw:22.23-22.46 Error: unmatched value specification: insistSingle
3135 :     link.nw:22.23-22.46 Error: unmatched value specification: elab
3136 :     Error: Compiler bug: SigMatch.lookStr 2a
3137 :    
3138 :     uncaught exception exception Error
3139 :     raised at: util/errormsg.sml:51.14-51.19
3140 :     modules/sigmatch.sml:285.27
3141 :     modules/sigmatch.sml:612.24
3142 :     modules/sigmatch.sml:651.26
3143 :     elaborate/elabmod.sml:513.33
3144 :     util/stats.sml:168.40
3145 :     sched/recompile.sml:196.38-196.41
3146 :    
3147 :     Owner: dbm
3148 :     Status: unreproducible (possibly obsolete)
3149 :     ----------------------------------------------------------------------
3150 :     Number: 1081
3151 :     Title: difficult type error message
3152 :     Keywords: error message, type checker
3153 :     Submitter: Norman Ramsey
3154 :     Date: 8/22/96
3155 :     Version: 109.16
3156 :     Severity: major
3157 :     Problem:
3158 :     Code:
3159 :     Transcript:
3160 :     solve.nw:40.9-59.4 Error: value type in structure doesn't match signature spec
3161 :     name: solve
3162 :     spec: {eqns:?.equation list, inputs:?.set}
3163 :     -> {answers:?.intexp ?.map, constraints:?.boolexp_set,
3164 :     unsolved:?.equation list}
3165 :     actual: {eqns:?.equation list, inputs:?.set}
3166 :     -> {answers:?.intexp ?.map, constraints:?.boolexp_set,
3167 :     unsolve:?.equation list}
3168 :    
3169 :     !* CM error: compile: elaboration failed
3170 :     -
3171 :    
3172 :     Comments:
3173 :     Obviously it's time for a rousing game of find the sharing constraint.
3174 :     The compiler could make the game easier to win by attaching unique ids
3175 :     to the ? marks, so that I know right away which of the five pairs of ?'s
3176 :     don't match.
3177 :     [later...]
3178 :     It turned out there was no missing sharing constraint --- I had
3179 :     misspelled the name of a record element ("unsolve"). That, too, would
3180 :     have been easier to find had I *known* all the ?'s matched...
3181 :    
3182 :     Owner: dbm
3183 :     Status: open
3184 :     ----------------------------------------------------------------------
3185 :     Number: 1082
3186 :     Title: inconsistent opsys string for freebsd
3187 :     Keywords: configuration
3188 :     Submitter: Robert Findler <cs.rice.edu!robby>
3189 :     Date: 8/13/96
3190 :     Version: 109.?
3191 :     System: x86-freebsd
3192 :     Severity: minor
3193 :     Problem:
3194 :     When I compile on freebsd, some parts of the system use "freebsd" as
3195 :     the arch string (e.g., .arch-n-opsys) and some parts (the binaries??) use
3196 :     "bsd" as the arch string.
3197 :     Owner: John
3198 :     Status: fixed in 109.21
3199 :     ----------------------------------------------------------------------
3200 :     Number: 1083
3201 :     Title: truncation of printing of concrete values
3202 :     Keywords: printing, datatypes, top level
3203 :     Submitter: Allen Stoughton <cis.ksu.edu!allen>
3204 :     Date: 8/23/96
3205 :     Version: 109.16
3206 :     Severity: major
3207 :     Transcript:
3208 :     Compiler.Control.Print.printDepth := 25;
3209 :     datatype foo = A | B of foo;
3210 :     - B A;
3211 :     val it = B - : foo
3212 :    
3213 :     another example from Carlos Puchol:
3214 :    
3215 :     - datatype 'a T = E | B of int * 'a T;
3216 :     datatype 'a T
3217 :     con B : int * 'a <RECtyc 0> (* note RECtyc! *)
3218 :     con E : T
3219 :     - val p = B (0, B (2, B (4, E)));
3220 :     val p = B (0,-) : 'a T
3221 :     -
3222 :    
3223 :     Test: bug1083.sml
3224 :     Owner: dbm
3225 :     Status: fixed in 109.19
3226 :     ----------------------------------------------------------------------
3227 :     Number: 1084
3228 :     Title: hole in value restriction implementation (bottom type)
3229 :     Keywords: type checking, value restriction
3230 :     Submitter: Zhong Shao, Allen Stoughton <cis.ksu.edu!allen>
3231 :     Date: 8/28/96
3232 :     Version: 109.16
3233 :     Severity: major
3234 :     Problem:
3235 :     Because of the special case in the value restriction for expressions
3236 :     with a simple type variable in their type, certain expressions that
3237 :     should not be typed are accepted.
3238 :    
3239 :     Transcript:
3240 :     - hd nil;
3241 :    
3242 :     uncaught exception exception Empty
3243 :     raised at: boot/list.sml:42.38-42.42
3244 :     - fun f x = f x;
3245 :     val f = fn : 'a -> 'b
3246 :     - f 0;
3247 :     (... infinite loop ...)
3248 :     Interrupt
3249 :    
3250 :     Comments:
3251 :     This exception to the value restriction was introduced to support
3252 :     bootstrapping, so that declarations like the following would work
3253 :    
3254 :     val x : 'a array = System.Unsafe.cast Array.array0Fix:
3255 :    
3256 :     Fix: find an alternate way of supporting such bootstrapping definitions
3257 :     Test: bug1084.sml
3258 :     Owner: dbm
3259 :     Status: open
3260 :     ----------------------------------------------------------------------
3261 :     Number: 1085
3262 :     Title: rebinding a data constructor name allowed using val rec
3263 :     Keywords: binding, data constructor
3264 :     Submitter: Sandip Biswas <saul.cis.upenn.edu!sbiswas>
3265 :     Date: 9/9/96
3266 :     Version: 0.93
3267 :     Severity: major
3268 :     Problem:
3269 :     As per the definition a data constructor can be redefined only
3270 :     as yet another data constructor of different type.
3271 :     But SML/NJ does not seem to check this when we use the val rec
3272 :     declaration.
3273 :    
3274 :     Code:
3275 :     Transcript:
3276 :     - datatype AA = A | B ;
3277 :     datatype AA
3278 :     con A : AA
3279 :     con B : AA
3280 :     - val B = fn x => 90 ;
3281 :     std_in:11.1-11.18 Error: pattern and expression in val dec don't agree
3282 :     (tycon mismatch)
3283 :     pattern: AA
3284 :     expression: 'Z -> int
3285 :     in declaration:
3286 :     B = (fn x => 90)
3287 :    
3288 :     Things are working here right as they are supposed to. But the
3289 :     following should not work.
3290 :    
3291 :     - val rec B = fn x => 90 ;
3292 :     val B = fn : 'a -> int
3293 :    
3294 :     Test: bug1085.1.sml, bug1085.2.sml
3295 :     Owner: dbm
3296 :     Status: fixed in 109.19
3297 :     ----------------------------------------------------------------------
3298 :     Number: 1086
3299 :     Title: illegal signature decl inside structure not rejected
3300 :     Keywords: modules, error message, signature, structure
3301 :     Submitter: Christian Fecht
3302 :     Date: 9/11/96
3303 :     Version: 109.17, 109.19
3304 :     Severity: major
3305 :     Code:
3306 :     structure A =
3307 :     struct
3308 :     type variable = int
3309 :     signature S =
3310 :     sig
3311 :     type t
3312 :     val f : t * variable -> t
3313 :     end
3314 :     structure B : S =
3315 :     struct
3316 :     type t = variable list
3317 :     fun f(s,_) = s
3318 :     end
3319 :     end
3320 :     Transcript:
3321 :     - use "tests/bug1086.sml";
3322 :     [opening tests/bug1086.sml]
3323 :    
3324 :     uncaught exception exception Unbound
3325 :     raised at: elaborate/elabmod.sml:513.71-513.81
3326 :     util/stats.sml:168.40
3327 :     build/evalloop.sml:145.36
3328 :     build/evalloop.sml:232.54
3329 :     build/evalloop.sml:316.38-316.41
3330 :     -
3331 :     Comments:
3332 :     Signature declarations are not allowed inside structures. This
3333 :     should be detected and a proper error message produced.
3334 :    
3335 :     In 109.19m through 109.25.2, this is accepted without an error message.
3336 :    
3337 :     Test: bug1086.sml
3338 :     Owner: dbm
3339 :     Status: open
3340 :     ----------------------------------------------------------------------
3341 :     Number: 1087
3342 :     Title: "Compiler bug: PPObj: switch: none of the datacons matched"
3343 :     Keywords: printing, datatype, top level
3344 :     Submitter: Carlos Puchol (cpg@research.bell-labs.com)
3345 :     Date: 9/19/96
3346 :     Version: 109.17
3347 :     Severity: major
3348 :     Problem: printing a value of a datatype causes
3349 :     Compiler bug: PPObj: switch: none of the datacons matched"
3350 :     Code:
3351 :     datatype d = D of t
3352 :     and s = A of int | B of int
3353 :     and t = C of s;
3354 :    
3355 :     val p = C(B 0);
3356 :     Fix: typo in print/ppobj.sml (i for index)
3357 :     Test: bug1087.sml
3358 :     Owner: dbm
3359 :     Status: fixed in 109.19
3360 :     ----------------------------------------------------------------------
3361 :     Number: 1088
3362 :     Title: overly large integers make sml hang
3363 :     Keywords: overflow, integer literals
3364 :     Submitter: mjd@plover.com (Mark-Jason Dominus)
3365 :     Date: 9/30/96
3366 :     Version: 0.93
3367 :     System: x86-linux (Linux 1.2.8)
3368 :     Severity: major
3369 :     Code:
3370 :     32768*32768;
3371 :     1103515245;
3372 :     Test: bug1088.1.sml, bug1088.2.sml
3373 :     Owner:
3374 :     Status: fixed in 109.19
3375 :     ----------------------------------------------------------------------
3376 :     Number: 1089
3377 :     Title: bogus data constructor representations
3378 :     Keywords: printing, data constructor, representations, datatype
3379 :     Submitter: Dave MacQueen
3380 :     Date: 10/3/96
3381 :     Version: 109.18
3382 :     System: SGI/IRIX 5.2
3383 :     Severity: critical
3384 :     Problem: bogus data constructor representations
3385 :     Code:
3386 :    
3387 :     (* 1. causes memory fault *)
3388 :    
3389 :     datatype d = D of t
3390 :     and s = A | B of string
3391 :     and t = C of s;
3392 :    
3393 :     val p = C(B "a");
3394 :    
3395 :    
3396 :     (* 2. Change order of type definitions ==> no problem *)
3397 :    
3398 :     datatype s = A | B of string
3399 :     and t = C of s
3400 :     and d = D of t;
3401 :    
3402 :     val p = C(B "b");
3403 :    
3404 :    
3405 :     (* 3. Change argument of B to int ==> when printing p get
3406 :     Compiler bug: PPObj: switch: none of the datacons matched *)
3407 :    
3408 :     datatype d = D of t
3409 :     and s = A | B of int
3410 :     and t = C of s;
3411 :    
3412 :     val p = C(B 0);
3413 :    
3414 :    
3415 :     (* 4. Or add an argument for A ==>
3416 :     Compiler bug: PPObj: switch: none of the datacons matched *)
3417 :    
3418 :     datatype d = D of t
3419 :     and s = A of int | B of string
3420 :     and t = C of s;
3421 :    
3422 :     val p = C(B "a");
3423 :    
3424 :    
3425 :     (* 5. Now change argument of B to int ==>
3426 :     Compiler bug: PPObj: switch: none of the datacons matched *)
3427 :    
3428 :     datatype d = D of t
3429 :     and s = A of int | B of int
3430 :     and t = C of s;
3431 :    
3432 :     val p = C(B 0);
3433 :    
3434 :    
3435 :     (* 6. Eliminate datatype d ==> no problem, prints p ok *)
3436 :    
3437 :     datatype s = A of int | B of int
3438 :     and t = C of s;
3439 :    
3440 :     val p = C(B 0);
3441 :    
3442 :     Owner: dbm
3443 :     Status: fixed in 109.19
3444 :     ----------------------------------------------------------------------
3445 :     Number: 1090
3446 :     Title: rs6000-aix chokes on real literals
3447 :     Keywords: real literals, rs6000
3448 :     Submitter: Robert Findler <cs.rice.edu!robby>
3449 :     Date: 10/5/96
3450 :     Version: 109.19
3451 :     System: rs6000-aix ( RS6000 N40 laptop running aix 3.2)
3452 :     Severity: major
3453 :     Transcript:
3454 :     Standard ML of New Jersey, Version 109.19, October 5, 1996 [CM; autoload enabled]
3455 :     GC #0.0.0.0.1.1: (30 ms)
3456 :     - 1.1;
3457 :     GC #0.0.0.1.2.37: (110 ms)
3458 :    
3459 :     uncaught exception in compiler: overflow
3460 :     raised at: util/pp.sml:554.6
3461 :     build/evalloop.sml:232.54
3462 :     Comments:
3463 :     That expression works fine on solaris, sunos and freebsd.
3464 :    
3465 :     Comments: [Lal, 10/5/96]
3466 :     Hmm. On an older RS6000 running AIX 3.2, this seems to work fine
3467 :    
3468 :     zion$ bin/sml
3469 :     Standard ML of New Jersey, Version 109.19, October 5, 1996 [CM&CMB 1]
3470 :     GC #0.0.0.0.1.5: (50 ms)
3471 :     val it = () : unit
3472 :     - 1.1;
3473 :     val it = 1.1 : real
3474 :    
3475 :     Comments: [Findler]
3476 :     Just in case, I did reboot and it's not the problem. I did narrow it down a
3477 :     little more:
3478 :    
3479 :     - Real.toString 1.1;
3480 :    
3481 :     uncaught exception overflow
3482 :    
3483 :     - Real64.toString 1.1;
3484 :    
3485 :     uncaught exception overflow
3486 :    
3487 :     and
3488 :    
3489 :     - fun f x = f x;
3490 :     GC #0.0.0.1.4.158: (30 ms)
3491 :     val f = fn : 'a -> 'b
3492 :     - f 1.1;
3493 :    
3494 :     runs for a while just fine.
3495 :    
3496 :     So, I looked at real-format.sml in the boot directory and saw that it was
3497 :     calling realGFormat (1.1,12) and that the exception was being raised in
3498 :     decompose when it is called with (12,0,fn _=>12). So, htat is calling a
3499 :     local function mkdigits with argument (1.1,12), which overflows.
3500 :    
3501 :     Well, to make a long story short, (well, just to end up my long story, I
3502 :     guess :-)
3503 :    
3504 :     - floor 1.1;
3505 :    
3506 :     uncaught exception overflow
3507 :    
3508 :     That's as far as I can go, since:
3509 :    
3510 :     real64.sml: val floor = Assembly.A.floor
3511 :    
3512 :     and I wouldn't have the foggiest if I looked at that code.
3513 :    
3514 :     Test: bug1090.sml
3515 :     Owner: Lal
3516 :     Status: fixed in 109.25 [Lal]
3517 :     ----------------------------------------------------------------------
3518 :     Number: 1091
3519 :     Title: word conversion causes "Compiler bug: 3312 in CPSgen"
3520 :     Keywords: word, conversion
3521 :     Submitter: Chris Paris <cap@cmu.edu>
3522 :     Date: 10/7/96
3523 :     Version: 109.18
3524 :     System: ?
3525 :     Severity: major
3526 :     Transcript:
3527 :     % sml
3528 :     Standard ML of New Jersey, Version 109.18, September 16, 1996
3529 :     - Word.toInt (Word.fromInt 0);
3530 :     copy_31_192((I)0) -> 193[I]
3531 :     {193} -> 194
3532 :     201(201,202,203,204,194)
3533 :    
3534 :     Error: Compiler bug: 3312 in CPSgen
3535 :     -
3536 :    
3537 :     Comments:
3538 :     The SML system dies with an illegal instruction if you try to do
3539 :     anything beyond that point. Below is a fix.
3540 :    
3541 :     Fix:
3542 :     *** sml-nj/cps/contract.sml.orig Mon Sep 16 09:10:28 1996
3543 :     --- sml-nj/cps/contract.sml Fri Oct 4 17:28:28 1996
3544 :     ***************
3545 :     *** 827,833 ****
3546 :     if m >= p then checkClicked("C5", n2, m, PURE, P.copy)
3547 :     else checkClicked("C6", n2, m, ARITH, P.test)
3548 :     | P.testu(n2,m) =>
3549 :     ! if m >= p then checkClicked("C7", n2, x, PURE, P.copy)
3550 :     else checkClicked("C8", n2, m, ARITH, P.testu)
3551 :     | _ => skip()
3552 :     end
3553 :     --- 827,833 ----
3554 :     if m >= p then checkClicked("C5", n2, m, PURE, P.copy)
3555 :     else checkClicked("C6", n2, m, ARITH, P.test)
3556 :     | P.testu(n2,m) =>
3557 :     ! if m >= p then checkClicked("C7", n2, m, PURE, P.copy)
3558 :     else checkClicked("C8", n2, m, ARITH, P.testu)
3559 :     | _ => skip()
3560 :     end
3561 :    
3562 :     Test: bug1091.sml
3563 :     Owner: Lal
3564 :     Status: fixed in 109.25 [Lal]
3565 :     ----------------------------------------------------------------------
3566 :     Number: 1092
3567 :     Title: subscript out of bounds while printing data structure
3568 :     Keywords: printing
3569 :     Submitter: Carlos Puchol (cpg@cs.utexas.edu)
3570 :     Date: 10/7/96
3571 :     Version: 109.19
3572 :     System: ?
3573 :     Severity: major
3574 :     Problem:
3575 :     Top level prettyprinting of large structure fails with subscript out
3576 :     of bounds exception.
3577 :     Code:
3578 :     datatype m = M of ifc option
3579 :     and ifc = IFC;
3580 :    
3581 :     val x = SOME IFC; (* must be SOME *) (* x prints ok *)
3582 :     val y = M x; (* printing y fails with subscript out of bounds *)
3583 :     Transcript:
3584 :     uncaught exception in compiler: subscript out of bounds
3585 :     raised at: boot/list.sml:50.35-50.44
3586 :     util/pp.sml:554.6
3587 :     build/evalloop.sml:232.54
3588 :    
3589 :     [dbm] Here is another related anomaly:
3590 :     Code:
3591 :     datatype 'a s1 = S1 of 'a
3592 :     and s2 = S2;
3593 :    
3594 :     datatype m = M of n s1
3595 :     and n = N;
3596 :    
3597 :     M(S1 N);
3598 :     Transcript:
3599 :     - use "bug1092.1.sml";
3600 :     [opening g.sml]
3601 :     datatype 'a s1 = S1 of 'a
3602 :     datatype s2 = S2
3603 :     datatype m = M of n s1
3604 :     datatype n = N
3605 :     val it = M (S1 S2) : m (* not right! - should be "M (S1 N)" *)
3606 :     val it = () : unit
3607 :     -
3608 :     Test: bug1092.sml, bug1092.1.sml, bug1092.2.sml
3609 :     Owner: dbm
3610 :     Status: fixed in 109.23 [dbm]
3611 :     ----------------------------------------------------------------------
3612 :     Number: 1093
3613 :     Title: abstype causes "Compiler bug: tycEntVar DEFtyc u"
3614 :     Keywords: abstype
3615 :     Submitter: Lars Birkedal <cs.cmu.edu!birkedal>
3616 :     Date: 10/8/96
3617 :     Version: 109.16
3618 :     Severity: major
3619 :     Transcript:
3620 :     structure S = struct
3621 :     abstype t = A with type u = t end
3622 :     end;
3623 :    
3624 :     - structure S = struct
3625 :     = abstype t = A with type u = t end
3626 :     = end;
3627 :     []
3628 :     Error: Compiler bug: tycEntVar DEFtyc u
3629 :     -
3630 :     Comment: [dbm, 11/5/96]
3631 :     In 109.19 (mipseb-unix) caused core dump, but then generated above
3632 :     error message in a fresh sml.
3633 :     Test: bug1093.sml
3634 :     Owner: dbm
3635 :     Status: fixed in 109.19m
3636 :     ----------------------------------------------------------------------
3637 :     Number: 1094
3638 :     Title: CM_ROOT environment variable not seen by cm
3639 :     Keywords: cm
3640 :     Submitter: Anthony Shipman <tusc.com.au!als>
3641 :     Date: 10/9/96
3642 :     Version: 109.18
3643 :     Severity: major
3644 :     Problem:
3645 :     If I do
3646 :    
3647 :     $ CM_ROOT=some.cm sml
3648 :     - CM.make();
3649 :    
3650 :     then it ignores the CM_ROOT and uses sources.sml. If I set the root
3651 :     manually it works.
3652 :    
3653 :     $ sml
3654 :     - CM.set_root "some.cm";
3655 :     - CM.make();
3656 :     Fix:
3657 :     The bug is on config/install.sh.
3658 :    
3659 :     CM uses its own ``export'' routine (in place of SMLofNJ.exportML),
3660 :     which makes sure that environment variables are re-read when the
3661 :     system comes back up. The install script doesn't use CM's ``export''
3662 :     function, so changes in environment variables are not honored anymore.
3663 :    
3664 :     Please, replace the line that says
3665 :    
3666 :     SMLofNJ.exportML "sml-cm";
3667 :    
3668 :     with
3669 :    
3670 :     CM.export ("sml-cm", NONE);
3671 :    
3672 :     in config/install.sh.
3673 :    
3674 :     Comments: [jhr, 10/9/96]
3675 :     Wouldn't it be better to just call OS.Process.getEnv when you need the value
3676 :     of CM_PATH. Also, there is a mechanism in the compiler for doing this kind
3677 :     of initialization (sml-nj/boot/cleanup-sig.sml, sml-nj/boot/cleanup.sml).
3678 :     The advantage of using the builtin mechanism is that when some unsuspecting
3679 :     user does an exportML, it will behave correctly.
3680 :    
3681 :     Comments: [Anthony Shipman, 10/11/96]
3682 :     That works. But I now get two banners.
3683 :    
3684 :     Standard ML of New Jersey, Version 109.18, September 16, 1996 [CM&CMB 1]
3685 :     Standard ML of New Jersey, Version 109.18, September 16, 1996 [CM; autoload ena
3686 :    
3687 :     Owner: blume
3688 :     Status: fixed in 109.21 [jhr]
3689 :     ----------------------------------------------------------------------
3690 :     Number: 1095
3691 :     Title: inadaquate type error message
3692 :     Keywords: error message, type checking
3693 :     Submitter: Anthony Shipman <tusc.com.au!als>
3694 :     Date: 10/13/96
3695 :     Version: 109.18
3696 :     System: x86-linux
3697 :     Severity: major
3698 :     Problem:
3699 :     I have some type checking code that has the following relevant lines.
3700 :    
3701 :     fun check_val_decls(...) =
3702 :     let
3703 :     ......
3704 :     val init_result = ... (* something of known type UnifyResult *)
3705 :     val final_result = do_val_decls(struct_tag, inherits, init_result)
3706 :     val final_subst = finish_subst(#subst final_result)
3707 :     ....
3708 :     in ... end
3709 :     ....
3710 :    
3711 :     and get_let_type(...) =
3712 :     let
3713 :     ...
3714 :     val decl_rslt = do_val_decls(let_tag, inherits, rslt_in)
3715 :     ...
3716 :     in ... end
3717 :    
3718 :     and do_val_decls(
3719 :     let_tag: Tag,
3720 :     inherits: Inherits,
3721 :     rslt_in: UnifyResult
3722 :     ): UnifyResult =
3723 :     let ... end
3724 :    
3725 :    
3726 :     I got the following error message where line 1296 is the second use of
3727 :     do_val_decls()
3728 :    
3729 :     ../semantics/type_check.sml:1296.2-1296.58 Error: unresolved flex record
3730 :     (can't tell what fields there are besides #subst)
3731 :    
3732 :    
3733 :     It appears that because the first encounter of do_val_decls() was in
3734 :     check_val_decls() it decided that the result type of do_val_decls() was
3735 :     unknown but at least was a record with a field 'subst'.
3736 :    
3737 :     When it got to line 1296 it decided to report its confusion. A solution
3738 :     was to add a constraint
3739 :    
3740 :     val decl_rslt: UnifyResult = do_val_decls(let_tag, inherits, rslt_in)
3741 :    
3742 :     I think the type error reporting needs some more smarts.
3743 :    
3744 :     Owner: dbm
3745 :     Status: open
3746 :     ----------------------------------------------------------------------
3747 :     Number: 1096
3748 :     Title: abstype name not printed properly
3749 :     Keywords: printing, type name
3750 :     Submitter: George Luger
3751 :     Date: 10/13/96
3752 :     Version: 109.21
3753 :     Severity: major
3754 :     Problem:
3755 :     At top level, a datatype name is printed properly, but if the datatype
3756 :     is changed to an abstype, a "?." is added to the name.
3757 :     Code:
3758 :     Transcript:
3759 :     Standard ML of New Jersey, Version 109.21, October 28, 1996 [CM; autoload enabled]
3760 :     - datatype 'a q = Q of 'a list;
3761 :     datatype 'a q = Q of 'a list
3762 :     - val empty = Q [];
3763 :     val empty = Q [] : 'a q
3764 :     - abstype 'a q = Q of 'a list
3765 :     = with
3766 :     = val empty = Q []
3767 :     = end;
3768 :     type 'a q
3769 :     val empty = - : 'a ?.q
3770 :     -
3771 :     Comment: [dbm]
3772 :     The problem is that the type of empty *in the absyn* contains a local
3773 :     stamp for q that has been replaced by a pid in the static environment
3774 :     that is used for printing. Thus the version of q in the absyn for
3775 :     the empty declaration is not equal (equalTycon) to q in the static
3776 :     environment that is passed to the prettyprinting function.
3777 :     Fix: fetch the types for the body values from the static environment
3778 :     Test: bug1096.sml
3779 :     Owner: dbm
3780 :     Status: fixed in 109.19m
3781 :     ----------------------------------------------------------------------
3782 :     Number: 1097
3783 :     Title: implimentation of floor_a primitive on Alpha
3784 :     Keywords: Alpha, floor
3785 :     Submitter: Kenneth Cline <Kenneth_Cline@silver.fox.cs.cmu.edu>
3786 :     Date: 10/14/96
3787 :     Version: 19.18?
3788 :     System: alpha32-unix
3789 :     Severity: major
3790 :     Problem:
3791 :     There is a cvttqvm instruction in floor_a (ALPHA32.prim.asm) that is
3792 :     not implemented by the alpha processors (at least not the ones we
3793 :     have). Worse, yet, we have an alpha/OSF1 system here that refuses to
3794 :     emulate this instruction, resulting in an illegal instruction signal.
3795 :    
3796 :     Fix:
3797 :     Here's my fix to floor_a. It appears to work, but I haven't tested it
3798 :     thoroughly.
3799 :    
3800 :     ML_CODE_HDR(floor_a)
3801 :     ldt $f0,0(STDARG) /* get argument */
3802 :     fblt $f0, 2f /* jump if argument is negative */
3803 :     cvttqvc $f0,$f0 /* round to quadword */
3804 :     cvtqlv $f0,$f0 /* convert quad to long */
3805 :     sts $f0,-4($30) /* store temporarily into C stack */
3806 :     ldl ATMP1,-4($30) /* load from C stack */
3807 :     addlv ATMP1,ATMP1,ATMP2 /* make room for tag bit */
3808 :     1: bis ATMP2,1,STDARG /* add the tag bit */
3809 :     CONTINUE
3810 :     2: /* negative argument */
3811 :     /* cvttqm (x) = cvttq (2*x - 0.5) / 2 */
3812 :     /* cvttq (x-0.5) loses for odd integers which IEEE round to evens */
3813 :     lda $0,0xC1E0000000000000 /* t-floating -2147483648.0 ... */
3814 :     stq $0,8($sp) /* ... (minimum 31 bit signed int) */
3815 :     ldt $f1, 8($sp) /* load min into $f1 */
3816 :     subt $f0, $f1, $f1 /* is arg too small? */
3817 :     fblt $f1, 3f /* jump if yes (underflow) */
3818 :     lda $0,0x3FE0000000000000 /* t-floating -0.5 */
3819 :     stq $0,8($sp) /* move via stack ... */
3820 :     ldt $f1, 8($sp)
3821 :     addt $f0, $f0, $f0 /* compute ... */
3822 :     subt $f0, $f1, $f0 /* ... 2*x + 0.5 */
3823 :     cvttq $f0, $f0 /* round to int */
3824 :     stt $f0, -8($30) /* move via stack ...
3825 :     ldq STDARG, -8($30)
3826 :     sra STDARG, 1 /* halve */
3827 :     br 1b
3828 :     3: eqv STDARG, STDARG, STDARG /* generate overflow */
3829 :     sll STDARG, 63, STDARG
3830 :     addqv STDARG, STDARG, STDARG
3831 :     trapb
3832 :     CONTINUE
3833 :    
3834 :     Owner: Lal
3835 :     Status: fixed in 109.25.1
3836 :     ----------------------------------------------------------------------
3837 :     Number: 1098
3838 :     Title: Compiler bug: type conflicts happened in transtypes unWRAPOp
3839 :     Keywords: representation
3840 :     Submitter: Ed Osinski - osinski@cs.nyu.edu
3841 :     Date: Oct. 15, 1996
3842 :     System(s) and Version: sml-cm
3843 :     SML/NJ Version: 109.15, 109.19, 109.21
3844 :     System: sun4, SunOS 4.1.4
3845 :     Severity: minor
3846 :     Problem: Compiler bug - type conflicts
3847 :    
3848 :     Code: (bug1098.sml)
3849 :     structure T : sig end =
3850 :     struct
3851 :     datatype B = U
3852 :    
3853 :     fun FVu' depth (_, acc) = acc
3854 :     and FVus' depth (xs, acc) = foldl (FVu' depth) acc xs
3855 :    
3856 :     fun FVb depth U = FVu' depth ((), [])
3857 :    
3858 :     fun wrap_FV FV' (d : int) = FV' d
3859 :    
3860 :     fun FVus d = wrap_FV FVus' d
3861 :     end
3862 :    
3863 :     Transcript:
3864 :    
3865 :     Standard ML of New Jersey, Version 109.19, October 5, 1996 [CM; autoload enabled]
3866 :     - use "bug1098.sml";
3867 :     [opening bug1098.sml]
3868 :     **** warning: type conflicts *****
3869 :     *** T1 is ***
3870 :     I
3871 :     *** T2 is ***
3872 :     P
3873 :     **** the source types are *****
3874 :     *** TT1 is ***
3875 :     (I->({I,R}->R))
3876 :     *** TT2 is ***
3877 :     (P->({I,R}->R))
3878 :     Error: Compiler bug: type conflicts happened in transtypes unWRAPOp
3879 :     The lvar 129448 is not in the current hashtable!
3880 :     Error: Compiler bug: TypeInfo hash table in convert.sml
3881 :    
3882 :     uncaught exception exception Error
3883 :     raised at: util/errormsg.sml:51.14-51.19
3884 :     cps/convert.sml:751.3
3885 :     cps/convert.sml:751.3
3886 :     util/stats.sml:168.40
3887 :     util/stats.sml:168.40
3888 :     build/evalloop.sml:232.54
3889 :     build/evalloop.sml:316.38-316.41
3890 :     -
3891 :    
3892 :     Comments:
3893 :    
3894 :     The code above is the smallest that would exhibit the bug. For example,
3895 :     any of the following changes will make the bug disappear:
3896 :    
3897 :     * Removal of the empty signature constraint
3898 :     * Removal of function FVb
3899 :     * Removal of function FVus
3900 :     * Changing the "and" to "fun", making the definitions of FVu' and FVus'
3901 :     non-recursive
3902 :     * Removal of the int constraint on d in the definition of wrap_FV
3903 :    
3904 :     Test: bug1098.sml
3905 :     Status: fixed in 109.23 [109.19m]
3906 :     ----------------------------------------------------------------------
3907 :     Number: 1099
3908 :     Title: real equality broken
3909 :     Keywords: real, equality
3910 :     Submitter: Takashina Tomomi (tomo@sw.cas.uec.ac.jp)
3911 :     Date: 10/14/96
3912 :     Version: 109.19
3913 :     System: ?
3914 :     Severity: major
3915 :     Problem:
3916 :     Code:
3917 :     fun uniq0(nil, _) = nil
3918 :     | uniq0(a1::nil, pv) = if a1<>pv then a1::nil else nil
3919 :     | uniq0(a1::a2::al, pv) = if a1=pv then uniq0(a2::al, pv)
3920 :     else if a1=a2 then a1::uniq0(al, a2)
3921 :     else a1::uniq0(a2::al, a1)
3922 :     and
3923 :     uniq(nil) = nil
3924 :     | uniq(a1::nil) = a1::nil
3925 :     | uniq(a1::a2::al) = if a1=a2 then a1::uniq0(al, a2)
3926 :     else a1::uniq0(a2::al, a1);
3927 :    
3928 :     uniq [3.0,3.0,4.0,4.0,5.0,9.0,9.0,9.0];
3929 :     Transcript:
3930 :     Standard ML of New Jersey, Version 109.19, October 5, 1996 [CM; autoload enabled]
3931 :     - use "tests/bug1099.sml";
3932 :     [opening tests/bug1099.sml]
3933 :     val uniq0 = fn : ''a list * ''a -> ''a list
3934 :     val uniq = fn : ''a list -> ''a list
3935 :     GC #0.0.0.1.2.43: (32 ms)
3936 :     val it = [3.0,3.0,4.0,4.0,5.0,9.0,9.0,9.0] : real list
3937 :     val it = () : unit
3938 :     -
3939 :    
3940 :     Test: bug1099.sml
3941 :     Owner: Lal
3942 :     Status: fixed in 109.21
3943 :     ----------------------------------------------------------------------
3944 :     Number: 1100
3945 :     Title: Compiler bug secondary error elaborating bad functor (SML96)
3946 :     Keywords: modules, functor, signature, sharing, type abbreviations, error recovery
3947 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
3948 :     Date: 10/17/96
3949 :     System(s) and Version: compiler
3950 :     SML/NJ Version: 109.19
3951 :     Machine: all
3952 :     Severity: ?
3953 :     Problem: type sharing may be broken
3954 :     Code:
3955 :    
3956 :     signature SET =
3957 :     sig
3958 :     structure Key : sig type key end
3959 :     type item = Key.key
3960 :     end;
3961 :    
3962 :     signature FOO =
3963 :     sig
3964 :     structure StringSet : SET
3965 :     sharing type string = StringSet.item
3966 :     end;
3967 :    
3968 :     functor FooFun(structure StringSet : SET
3969 :     sharing type string = StringSet.item (*XXX*)
3970 :     ) : FOO =
3971 :     struct
3972 :     structure StringSet = StringSet
3973 :     end;
3974 :    
3975 :     Transcript:
3976 :    
3977 :     bug.sml:12.9-17.6 Error: Inconsistent type sharing (PRIMITIVE/?) string, item
3978 :     Error: Compiler bug: SigMatch.lookTyc 1a
3979 :    
3980 :     uncaught exception exception Error
3981 :     raised at: util/errormsg.sml:51.14-51.19
3982 :     modules/sigmatch.sml:298.27
3983 :     modules/sigmatch.sml:307.27
3984 :     modules/sigmatch.sml:612.24
3985 :     modules/sigmatch.sml:651.26
3986 :     util/stats.sml:168.40
3987 :     build/evalloop.sml:145.36
3988 :     build/evalloop.sml:232.54
3989 :     build/evalloop.sml:316.38-316.41
3990 :    
3991 :     Comments:
3992 :    
3993 :     This involves an SML'96 feature (type abbreviations in signatures),
3994 :     so it may be that the compiler actually does what SML'96 requires.
3995 :     Until the new Definition is generally available, I cannot really
3996 :     determine what the correct behaviour is supposed to be...
3997 :    
3998 :     If I change the sharing constraint (*XXX*) to read: .. = StringSet.Key.key
3999 :     instead, then things work fine. But why accept the FOO signature at the
4000 :     top-level while rejecting an identical copy used as a functor argument?
4001 :    
4002 :     In the excerpt of the new Definition (version 7.3.4) distributed with MLWorks,
4003 :     it says that every longtycon involved in a type sharing constraint must
4004 :     denote a flexible type name. However, I found no mention of whether a
4005 :     type abbreviation of the kind found in the SET signature denotes a flexible
4006 :     or rigid type name.
4007 :    
4008 :     This example is condensed from a real application where I used the
4009 :     smlnj-lib ORD_SET signature and BinarySetFn functor to build different
4010 :     set-of-FOO structures.
4011 :    
4012 :     Comment [dbm]: In 109.19m, the secondary error has become
4013 :    
4014 :     Error: Compiler bug: TypesUtil: tycStamp ERRORtyc
4015 :    
4016 :     Test: bug1100.sml
4017 :     Owner: dbm
4018 :     Status: fixed in 109.28 [dbm, 5/21/97]
4019 :     ----------------------------------------------------------------------
4020 :     Number: 1101
4021 :     Title: puzzling type error message
4022 :     Keywords: error message, type checking
4023 :     Submitter: Dave MacQueen
4024 :     Date: 10/28/96
4025 :     Version: 109.19
4026 :     Severity: minor
4027 :     Problem:
4028 :     Shouldn't the last line of the transcript below be
4029 :    
4030 :     f : int -> 'Y
4031 :    
4032 :     Transcript:
4033 :     - fun k x y = x;
4034 :     val k = fn : 'a -> 'b -> 'a
4035 :     - val f = k 3;
4036 :     stdIn:17.1-17.12 Error: nongeneralizable type variable
4037 :     f : 'Z -> 'Y
4038 :     -
4039 :     Comment: The last line should be "f : 'Z -> int". It is now.
4040 :     Test: bug1101.sml
4041 :     Owner: dbm
4042 :     Status: fixed in 109.26
4043 :     ----------------------------------------------------------------------
4044 :     Number: 1102
4045 :     Title: bogus type sharing not rejected
4046 :     Keywords: modules, signatures, sharing
4047 :     Submitter: Dave MacQueen
4048 :     Date: 10/29/96
4049 :     Version: 109.19
4050 :     Severity: major
4051 :     Problem:
4052 :     The following signature is accepted even though the type sharing
4053 :     equates types with different equality properties.
4054 :     Code:
4055 :     signature S =
4056 :     sig
4057 :     eqtype s
4058 :     datatype t = C of int -> int
4059 :     sharing type s = t
4060 :     end;
4061 :     Comments:
4062 :     This declaration is accepted, but if we then use the signature
4063 :     as a parameter signature in a functor declaration like
4064 :    
4065 :     functor F(X: S) = struct end;
4066 :    
4067 :     we get the error message
4068 :    
4069 :     tests/bug1102.sml:10.9-10.31 Error: inconsistent equality properties
4070 :    
4071 :     uncaught exception exception Error
4072 :     raised at: build/evalloop.sml:123.59-123.67
4073 :     build/evalloop.sml:232.54
4074 :     build/evalloop.sml:316.38-316.41
4075 :    
4076 :     This is because instantiation is not performed on signatures when they
4077 :     are declared, and instantiation is where inconsistent sharing is
4078 :     detected.
4079 :    
4080 :     Test: bug1102.sml
4081 :     Owner: dbm
4082 :     Status: not a bug (in SML 96)
4083 :     ----------------------------------------------------------------------
4084 :     Number: 1103
4085 :     Title: OS_IO signature is not bound at top level
4086 :     Keywords: OS_IO, top level
4087 :     Submitter: Lorenz Huelsbergen
4088 :     Date: 11/1/96
4089 :     Version: 109.21
4090 :     Severity: minor
4091 :     Problem:
4092 :     The signature name OS_IO is not bound in the top level environment.
4093 :     This leads to the question mark being printed after it in the
4094 :     following transcript.
4095 :    
4096 :     Transcript:
4097 :     Standard ML of New Jersey, Version 109.21, October 28, 1996 [CM; autoload enabled]
4098 :     - open OS;
4099 :     open OS
4100 :     structure FileSys : OS_FILE_SYS
4101 :     structure Path : OS_PATH
4102 :     structure Process : OS_PROCESS
4103 :    
4104 :     structure IO : OS_IO?
4105 :     ^
4106 :     |------------ ???
4107 :    
4108 :     Fix: bind OS_IO in the top level
4109 :     Owner: jhr
4110 :     Status: fixed in 109.26 [jhr, Lal, 3/19/97]
4111 :     ----------------------------------------------------------------------
4112 :     Number: 1104
4113 :     Title: CM path mechanism broken
4114 :     Keywords: CM, CM_PATH
4115 :     Submitter: Tomas Uribe <Theory.Stanford.EDU!uribe>
4116 :     Date: 11/1/96
4117 :     Version: 109.21
4118 :     Severity: major
4119 :     Problem:
4120 :     There seems to be a problem with CM's path mechanism; the CM_PATH is
4121 :     not working properly.
4122 :    
4123 :     In particular, CM seems to be looking for everything relative to the
4124 :     directory where the .cm file is located. A simple example:
4125 :    
4126 :     Running sml-cm from directory X, which is the same as CM_PATH:
4127 :     sources.cm is Alias foo/main.cm;
4128 :     where X/foo/main.cm has a reference to "test.sml", which resides in X/test.sml.
4129 :     Then CM will look for test.sml in the directory X/foo, not in the
4130 :     directory X, even though the CM_PATH is X.
4131 :    
4132 :     Also, the type of the CM.set_path function is not the one in the CM
4133 :     manual, instead of
4134 :     string list -> unit
4135 :     it is now
4136 :     string list option -> string list
4137 :    
4138 :     Comment: [dbm] Is this the same as bug 1094?
4139 :    
4140 :     Comment: [blume, 11/27/96]
4141 :     Indeed, this might be the same problem as 1094, but I doubt it.
4142 :     Instead, the logger seems to have misunderstood the PATH mechanism:
4143 :     CM only uses the path if the file can not be found in its
4144 :     default location. The person writing the error report seems to
4145 :     assume that with CM_PATH set CM will _only_ look into the path.
4146 :     In other words, if sources.cm lists a.sml, and there is a file
4147 :     a.sml in the same directory that contains sources.cm, then this
4148 :     a.sml will be used -- regardless whether or not there is a CM_PATH,
4149 :     and regardless of whether or not the path contains another a.sml.
4150 :    
4151 :     Owner: blume
4152 :     Status: not a bug
4153 :     ----------------------------------------------------------------------
4154 :     Number: 1105
4155 :     Title: message for uncaught exceptions has duplicated "exception"
4156 :     Keywords: message
4157 :     Submitter: Dave MacQueen
4158 :     Date: 11/7/96
4159 :     Version: 109.21
4160 :     Severity: minor
4161 :     Transcript:
4162 :     - exception Foo;
4163 :     exception Foo
4164 :     - raise Foo;
4165 :    
4166 :     uncaught exception exception Foo
4167 :     raised at: stdIn:18.7-18.10
4168 :     -
4169 :     Comments:
4170 :     Also, should eliminate the extra newline.
4171 :     Test: bug1105.sml
4172 :     Owner: Lal
4173 :     Status: fixed in 109.26 [Lal, jhr, 3/19/97]
4174 :     ----------------------------------------------------------------------
4175 :     Number: 1106
4176 :     Title: cutoff recompilation broken
4177 :     Keywords: CM, cutoff recompilation
4178 :     Submitter: Dave MacQueen
4179 :     Date: 11/12/96
4180 :     Version: 109.21
4181 :     Severity: major
4182 :     Problem: adding some print statements to a file (build/boot.sml),
4183 :     caused unnecessary cascading recompilation of files like cps/shareglue.sml.
4184 :     Transcript:
4185 :     - CMB.make();
4186 :     [starting dependency analysis]
4187 :     [parsing build/boot.sml]
4188 :     GC #2.10.11.13.82.1702: (44 ms)
4189 :     [dependency analysis completed]
4190 :     Compiling...
4191 :     GC #3.11.12.14.83.1847: (1094 ms)
4192 :     [compiling build/boot.sml -> bin.mipseb-unix/boot.sml.bin]
4193 :     GC #3.11.12.14.84.1884: (37 ms)
4194 :     build/boot.sml:220.3-332.6 Warning: binding not exhaustive
4195 :     (nil,env) = ...
4196 :     build/boot.sml:220.3-332.6 Warning: binding not exhaustive
4197 :     STRbind (STRvar {binding=binding,daccess=daccess,name=name,
4198 :     saccess=saccess}) = ...
4199 :     GC #3.11.12.14.85.1911: (24 ms)
4200 :     GC #3.11.12.14.86.1918: (34 ms)
4201 :     GC #3.11.12.14.87.1927: (16 ms)
4202 :     GC #3.11.12.14.88.1943: (23 ms)
4203 :     [wrote bin.mipseb-unix/boot.sml.bin]
4204 :     [recovering bin.mipseb-unix/shareglue.sml.bin... failed]
4205 :     [compiling cps/shareglue.sml -> bin.mipseb-unix/shareglue.sml.bin]
4206 :     GC #3.11.12.14.89.1972: (14 ms)
4207 :     [wrote bin.mipseb-unix/shareglue.sml.bin]
4208 :     ...
4209 :     Comment:
4210 :     [Matthias, 11/25/96]
4211 :     (This one is not owned by anyone, but it seems like it is at
4212 :     least CM-related.)
4213 :     I noticed the same problem. My guess is that under certain
4214 :     circumstances a change in the implementation can introduce subtle
4215 :     changes to the resulting static environment. (Ordering
4216 :     problems, optional redundant information (e.g. lambda-types)
4217 :     present or absent, ...). A while back I traced a similar (but
4218 :     much more pronounced) effect to optional lambda-type
4219 :     annotations. I fixed this bug by calculating the CRC without
4220 :     taking those lambda-types into account. This is a rather nasty
4221 :     hack... I'd rather see such optional information disappear from
4222 :     static environments altogether.
4223 :    
4224 :     [Matthias, 2/19/97]
4225 :     I have the sneaking suspicion that bugs 1106, 1135, and 1154 are
4226 :     really all the same bug or at least very closely related.
4227 :    
4228 :     [Matthias, 3/31/97]
4229 :     I haven't seen a case of 1106 recently. Has anyone else experienced
4230 :     spurious recompilations after adding print statements to other modules
4231 :     etc.?
4232 :    
4233 :     [Matthias, 4/16/97]
4234 :     Here is a small example that exhibits the problem. If I remove the
4235 :     comments around "local", "in", and "end" below, then CM thinks it
4236 :     needs to recompile b.sml. I believe this should never happen, because
4237 :     whether the definition of x is local or not isn't exposed in the
4238 :     functor's interface (which is given by the signature constraint).
4239 :     BTW, I get the same behavior for transparent and opaque signature
4240 :     matching.
4241 :    
4242 :     Likewise, adding any definition to the functor body thot is not
4243 :     mentioned in the signature will also cause b.sml to be recompiled.
4244 :    
4245 :     -Matthias
4246 :    
4247 :     The code is here:
4248 :    
4249 :     sources.cm::
4250 :     ---------------------------
4251 :     Group is
4252 :     a.sml
4253 :     b.sml
4254 :     ---------------------------
4255 :    
4256 :     a.sml::
4257 :     ---------------------------
4258 :     signature AS = sig
4259 :    
4260 :     val a: int -> int
4261 :    
4262 :     end
4263 :    
4264 :     functor AF ():> AS = struct
4265 :     (* local *)
4266 :     val x = 1
4267 :     (* in *)
4268 :     fun a n = n + x
4269 :     (* end *)
4270 :     end
4271 :     ----------------------------
4272 :    
4273 :     b.sml::
4274 :     ----------------------------
4275 :     structure B = struct
4276 :    
4277 :     structure A = AF ()
4278 :    
4279 :     val b = A.a 10
4280 :    
4281 :     end
4282 :     ----------------------------
4283 :    
4284 :     [Blume, 4/21/97: cutoff compilation still broken]
4285 :     The following example breaks cutoff recompilation. Un-commenting the
4286 :     type definition within functor AF causes b.sml to be recompiled:
4287 :    
4288 :     sources.cm::
4289 :     ----------------------------
4290 :     Group is a.sml b.sml
4291 :     ----------------------------
4292 :    
4293 :     a.sml::
4294 :     ----------------------------
4295 :     signature AS = sig
4296 :    
4297 :     val a: int -> int
4298 :    
4299 :     end
4300 :    
4301 :     functor AF ():> AS = struct
4302 :    
4303 :     (* type ttt = unit *)
4304 :    
4305 :     fun a (x: int) = x
4306 :    
4307 :     end
4308 :     ----------------------------
4309 :    
4310 :     b.sml::
4311 :     ----------------------------
4312 :     structure B = struct
4313 :    
4314 :     structure A = AF ()
4315 :    
4316 :     val b = A.a 10
4317 :    
4318 :     end
4319 :     ----------------------------
4320 :     [Zhong, 4/21/97]
4321 :     This really depends on whether ttt is used (or referred) by function
4322 :     a or not [rather, appears in a's interface type-dbm]. The current compiler
4323 :     considers all types can potentially be used, so it can definitely be optimized.
4324 :    
4325 :     [Matthias Blume, 4/21/97]
4326 :     I don't understand this. Whether ttt is used in a or not shouldn't
4327 :     matter. I can see that there might be problems if it becomes part of
4328 :     a's type. But even then, suppose a depends on tttt, but a certain
4329 :     change to tttt does not change the type of a. In this case cutoff
4330 :     compilation should also work (imo).
4331 :    
4332 :     Example:
4333 :    
4334 :     functor ...: sig val a: unit -> int end = struct
4335 :    
4336 :     type foo = unit (* changes to foo do not change the type of a *)
4337 :     type ttt = int * foo
4338 :    
4339 :     fun a () = let val x: ttt = (3, ()) in #1 x end
4340 :    
4341 :     end
4342 :    
4343 :     [Zhong, 4/21/97]
4344 :     You are right. Unfortunately, the current static representations of the
4345 :     functor body is too coarse-grain to identify these differences. We'll
4346 :     see how to improve on this in the future.
4347 :    
4348 :     [Matthias, 4/30/97]
4349 :     Bug 1106 has been fixed, although I am personally not quite satisfied
4350 :     with the current status. The example that I submitted is now
4351 :     processed correctly. But adding, deleting, or changing any type
4352 :     declarations in a functor's body (even when they are masked away by a
4353 :     signature contraint) will cause changes in the static environment,
4354 :     therefore in the pickle, and will therefore cause unnecessary
4355 :     recompilation.
4356 :    
4357 :     Zhong said that that's an artifact of the current implementation
4358 :     strategy.
4359 :    
4360 :     [dbm, 5/1/97]
4361 :     We'll have to work on this, and I hope we can eliminate any
4362 :     sensitivity to internal types. Is the current effect caused by
4363 :     changes in the lambda types, Zhong?
4364 :    
4365 :     [Zhong, 5/1/97]
4366 :     No, it has nothing todo with lambda types. The functor body entity
4367 :     declaration currently faithfully record every type declaration it
4368 :     encounters --- so if any internal type declaration changes, the
4369 :     functor body entity expressions will change, thus the functor signature.
4370 :    
4371 :     If we want to get fancy, we can minimize the body entity expressions
4372 :     by throwing away all the unreachable type declarations, but this can
4373 :     be tricky to implement though.
4374 :    
4375 :     Owner: Andrew, dbm, Zhong
4376 :     Status: open
4377 :     ----------------------------------------------------------------------
4378 :     Number: 1107
4379 :     Title: Io exception in compiler
4380 :     Keywords: Io, <stdIn> Interrupted system call.
4381 :     Submitter: nikolaj@cs.stanford.edu
4382 :     Date: 11.11.96
4383 :     Version: 109.21.1
4384 :     System: Solaris
4385 :     Severity:
4386 :     Problem:
4387 :     The compiler raises the following exception:
4388 :    
4389 :     uncaught exception in compiler: Io: input failed on "<stdIn>",
4390 :     Interrupted system call
4391 :     raised at: boot/NewIO/text-io-fn.sml:132.14-132.56
4392 :     elaborate/frontend.sml:119.24
4393 :     util/stats.sml:168.40
4394 :     build/evalloop.sml:232.54
4395 :    
4396 :     It is repeated until selecting CTRL-C
4397 :    
4398 :     Code: bug1107.sml
4399 :     I am not sure where this happens, but functions that
4400 :     are used include: OS.FileSys.openDir, closeCir, readDir, isDir, isLink
4401 :    
4402 :     Comments:
4403 :     The bug is hard to reproduce which points to os specific problems.
4404 :     We have a file browser that reads directories and sorts files from
4405 :     directories, then lists them in separate boxes.
4406 :    
4407 :     Note also that OS.FileSys.isDir raises a SysErr exception when the
4408 :     path is not a directory (instead of returning false). Try for instance:
4409 :    
4410 :     OS.FileSys.isDir "/c/is/my/favorite/language/because/I/love/to/add/pointers/";
4411 :    
4412 :     assuming you do not have such strange directories.
4413 :    
4414 :     [jhr]
4415 :     I think this was because they were mixing CML and SML/NJ's I/O.
4416 :     Test: bug1107.sml
4417 :     Owner: John
4418 :     Status: not a bug
4419 :     ----------------------------------------------------------------------
4420 :     Number: 1108
4421 :     Title: String.maxSize missnamed as String.maxLen
4422 :     Keywords: basis
4423 :     Submitter: Lorenz Huelsbergen
4424 :     Date: 11/8/96
4425 :     Version: 109.21.1
4426 :     Severity: minor
4427 :     Fix: change the name
4428 :     Owner: John
4429 :     Status: fixed in 109.26 [Lal, jhr, 3/29/97]
4430 :     ----------------------------------------------------------------------
4431 :     Number: 1109
4432 :     Title: boxity exception
4433 :     Keywords: datatypes, representation, printing
4434 :     Submitter: Chris Paris <cmu.edu!cap>
4435 :     Date: 11/19/96
4436 :     Version: 109.21.1
4437 :     System: sparc/solaris (SunOS 5.5), mipseb/irix
4438 :     Severity: major
4439 :     Problem: values of a datatype cause Boxity exception or core dump.
4440 :     Transcript:
4441 :     Standard ML of New Jersey, Version 109.21.1, November 4, 1996
4442 :     - datatype 'a lyst = NIL | CONS of ('a * 'a lyst) ref;
4443 :     datatype 'a lyst = CONS of ('a * 'a lyst) ref | NIL
4444 :     - val a = CONS (ref ("foo", NIL));
4445 :    
4446 :     uncaught exception in compiler: exception Boxity
4447 :     raised at: boot/system.sml:133.34-133.40
4448 :     util/pp.sml:554.6
4449 :     build/evalloop.sml:232.54
4450 :    
4451 :     and again --
4452 :    
4453 :     Standard ML of New Jersey, Version 109.21.1, November 4, 1996
4454 :     - datatype 'a lyst = NIL of string | CONS of ('a * 'a lyst) ref;
4455 :     datatype 'a lyst = CONS of ('a * 'a lyst) ref | NIL of string
4456 :     - val a = CONS (ref ("foo", NIL "nil"));
4457 :    
4458 :     Process sml bus error
4459 :    
4460 :     Test: bug1109.1.sml, bug1109.2.sml
4461 :     Owner: dbm
4462 :     Status: fixed in 109.23 [109.19m]
4463 :     ----------------------------------------------------------------------
4464 :     Number: 1110
4465 :     Title: problem printing datatype
4466 :     Keywords: datatypes, printing
4467 :     Submitter: Chris Paris <cmu.edu!cap
4468 :     Date: 11/19/96
4469 :     Version: 109.21.1
4470 :     System: sparc/solaris (SunOS 5.5), mipseb/irix
4471 :     Severity: major
4472 :     Problem: datatype value prints incorrectly
4473 :     Transcript:
4474 :     Standard ML of New Jersey, Version 109.21.1, November 4, 1996
4475 :     - datatype lyst = NIL of string | CONS of (string * lyst) ref;
4476 :     datatype lyst = CONS of (string * lyst) ref | NIL of string
4477 :     - val a = CONS (ref ("foo", NIL "nil"));
4478 :     val a = CONS (ref ("foo",ref -)) : lyst
4479 :     - Compiler.Control.Print.printDepth := 100;
4480 :     val it = () : unit
4481 :     - Compiler.Control.Print.printLength := 100;
4482 :     val it = () : unit
4483 :     - val a = CONS (ref ("foo", NIL "nil"));
4484 :     val a = CONS (ref ("foo",ref -)) : lyst
4485 :     - (* Why does the second ref print as -? More problems in the printer? *)
4486 :     Test: bug1110.sml
4487 :     Owner: dbm
4488 :     Status: fixed in 109.23
4489 :     ----------------------------------------------------------------------
4490 :     Number: 1111
4491 :     Title: failure to generalize type variable
4492 :     Keywords: type checking, polymorphism, value restriction
4493 :     Submitter: John Reppy
4494 :     Date: 12/4/96
4495 :     Version: 109.21.1, 109.19m,
4496 :     Severity: major
4497 :     Problem: a type variable that should generalize does not.
4498 :     Transcript:
4499 :     - let val [f] = [] in f 1; f true end;
4500 :     stdIn:8.1-8.36 Error: nongeneralizable type variable
4501 :     it : 'Z
4502 :    
4503 :     Comment: the type of the let expression is a type variable, which
4504 :     can't be generalized because the expression is not a value.
4505 :     Test: bug1111.sml
4506 :     Owner: dbm
4507 :     Status: not a bug
4508 :     ----------------------------------------------------------------------
4509 :     Number: 1112
4510 :     Title: missing region info in match nonexhaustive message
4511 :     Keywords: error messages
4512 :     Submitter: Zhong Shao (shao-zhong@cs.yale.edu)
4513 :     Date: 1/3/97
4514 :     Version: 109.22
4515 :     Severity: minor
4516 :     Problem: region is not defined for a "match nonexhaustive"
4517 :     warning message for a top-level function definition. Also
4518 :     null if the definition appears in either part of a top-level
4519 :     local declaration.
4520 :     Transcript:
4521 :     (1)
4522 :     - fun f [] = 1;
4523 :     stdIn:<nullRegion> Warning: match nonexhaustive
4524 :     nil => ...
4525 :    
4526 :     val f = fn : 'a list -> int
4527 :     (2)
4528 :     - local fun f [] = 1 in val x = 3 end;
4529 :     stdIn:<nullRegion> Warning: match nonexhaustive
4530 :     nil => ...
4531 :    
4532 :     val x = 3 : int
4533 :     - local val x = 3 in fun f [] = x end;
4534 :     stdIn:<nullRegion> Warning: match nonexhaustive
4535 :     nil => ...
4536 :    
4537 :     val f = fn : 'a list -> int
4538 :    
4539 :     Comments:
4540 :     It seems to be defined (modulo accuracy of line numbers) for
4541 :     local definitions in a top-level let expression or in a top
4542 :     level function declaration.
4543 :     Test: bug1112.1.sml, bug1112.2.sml, bug1112.3.sml
4544 :     Owner: dbm
4545 :     Status: open
4546 :     ----------------------------------------------------------------------
4547 :     Number: 1113
4548 :     Title: inappropriate error message for missing @SMLload arg
4549 :     Keywords: error message, heap image
4550 :     Submitter: John Reppy (Kent Lee <leekent@luther.edu>)
4551 :     Date: 1/7/96
4552 :     Version: 109.22
4553 :     Severity: major
4554 :     Problem: User used the wrong syntax for the @SMLload command line option
4555 :     and got an inappropriate error message.
4556 :     Transcript:
4557 :     sml @SMLload "genesis" filename
4558 :     /usr/local/sml109.22/bin/.run/run.mipseb-irix5: Fatal error -- incorrect
4559 :     byte order in heap image
4560 :    
4561 :     Comments:
4562 :     The image file genesis was created by exportFn. The command line should
4563 :     have been
4564 :    
4565 :     sml @SMLload=genesis filename
4566 :    
4567 :     This error should have been detected and a more appropriate error
4568 :     message should be given.
4569 :     Owner: jhr
4570 :     Status: fixed in 109.28 [jhr]
4571 :     ----------------------------------------------------------------------
4572 :     Number: 1114
4573 :     Title: installing prettyprinter for type created by a functor
4574 :     Submitter: Elsa L. Gunter
4575 :     Date: 7 January 1997
4576 :     Version: 109.22
4577 :     System: linux, version 2.0
4578 :     Severity: major
4579 :     Problem: When a type is first defined in a functor, and then you
4580 :     apply the functor to get a structure, and then install a
4581 :     pretty-printer for the type, the installed pretty-printer
4582 :     is ignored.
4583 :     Code:
4584 :     (* File: pp_bug.sml *)
4585 :    
4586 :     functor TYPE () =
4587 :     struct
4588 :     datatype ty = Tyc of string
4589 :     end;
4590 :    
4591 :     structure Type = TYPE();
4592 :    
4593 :     (*
4594 :     structure Type =
4595 :     struct
4596 :     datatype ty = Tyc of string
4597 :     end;
4598 :     *)
4599 :    
4600 :     structure P =
4601 :     struct
4602 :    
4603 :     fun pp_type ppstrm (Type.Tyc tyname) =
4604 :     (Compiler.PrettyPrint.begin_block ppstrm Compiler.PrettyPrint.CONSISTENT 0;
4605 :     Compiler.PrettyPrint.add_string ppstrm tyname;
4606 :     Compiler.PrettyPrint.end_block ppstrm)
4607 :    
4608 :     end;
4609 :    
4610 :     val _ = Compiler.PPTable.install_pp ["Type","ty"] P.pp_type;
4611 :    
4612 :     val test_type = Type.Tyc "bool";
4613 :    
4614 :     Transcript:
4615 :    
4616 :     sml
4617 :     Standard ML of New Jersey, Version 109.22, December 7, 1996 [CM; autoload enabled]
4618 :     - use "pp_bug.sml";
4619 :     use "pp_bug.sml";
4620 :     [opening pp_bug.sml]
4621 :     functor TYPE : <sig>
4622 :     structure Type :
4623 :     sig
4624 :     datatype ty ... (hidden constructors)
4625 :     end
4626 :     structure P : sig val pp_type : ?.ppstream -> ?.ty -> unit end
4627 :     val test_type = Tyc "bool" : ?.ty
4628 :     val it = () : unit
4629 :     -
4630 :    
4631 :     Comments:
4632 :     The problem goes away (ie. the installed pretty-printer is used) if you
4633 :     just define the type in a structure from the begining.
4634 :    
4635 :     Fix:
4636 :     Test: bug1114.1.sml, bug1114.2.sml
4637 :     Owner: dbm
4638 :     Status: fixed in 109.25
4639 :     ----------------------------------------------------------------------
4640 :     Number: 1115
4641 :     Title: vector pattern matching bug
4642 :     Keywords: vectors, pattern matching
4643 :     Submitter: Greg Morrisett (jgm@cs.cornell.edu)
4644 :     Date: Jan. 30, 1996
4645 :     Version: 109.24
4646 :     System: Win-NT
4647 :     Severity: severe
4648 :     Problem: Compiling the following file causes a Compiler bug: LambdaType: wrong
4649 :     TC_TUPLE in tc_select.
4650 :     Code:
4651 :     fun f #[1] = 0 | f _ = 1;
4652 :     Transcript:
4653 :     - use "test.sml";
4654 :     [opening test.sml]
4655 :     Error: Compiler bug: LambdaType: wrong TC_TUPLE in tc_select
4656 :     Fix: change to translate/matchcomp.sml in 109.25
4657 :