[MLton] Bug in -show-basis: unhandled exception: Chr

Vesa Karvonen vesa.karvonen@cs.helsinki.fi
Mon, 12 Sep 2005 01:03:38 +0300


Bug seems to be in both 20041109 and latest SVN sources. I haven't
traced the exact source of the bug, but it seems rather clear that
-show-basis runs out of single character type variable names. I
wrote the test case after I understood the cause. (I'd otherwise
see if I could fix it myself and submit a patch, but it is getting
late. I can do it tomorrow, but it is probably a quick fix (a couple
of minutes) for someone who knows exactly where to look.)

-Vesa Karvonen

$ cat mlton-unhandled-chr.sml
fun foo (_,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_,
         _,_,_,_,_,_,_,_,_,_) = ()
$ mlton -verbose 2 -stop tc -show-basis .tmp mlton-unhandled-chr.sml
MLton starting
MLton MLTONVERSION (built Sun Sep 11 23:56:42 2005 on grape)
  created this file on Mon Sep 12 00:56:01 2005.
Do not edit this file.
Flag settings:
   align: 4
   atMLtons: (mlton-unhandled-chr, @MLton, --)
   chunk: chunk per function
   codegen: Native
   contifyIntoMain: false
   debug: false
   diag passes: []
   drop passes: []
   elaborate allowConstant (default): false
   elaborate allowConstant (enabled): true
   elaborate allowFFI (default): false
   elaborate allowFFI (enabled): true
   elaborate allowPrim (default): false
   elaborate allowPrim (enabled): true
   elaborate allowOverload (default): false
   elaborate allowOverload (enabled): true
   elaborate allowRebindEquals (default): false
   elaborate allowRebindEquals (enabled): true
   elaborate deadCode (default): false
   elaborate deadCode (enabled): true
   elaborate forceUsed (default): false
   elaborate forceUsed (enabled): true
   elaborate ffiStr (default):
   elaborate ffiStr (enabled): true
   elaborate nonexhaustiveExnMatch (default): default
   elaborate nonexhaustiveExnMatch (enabled): true
   elaborate nonexhaustiveMatch (default): warn
   elaborate nonexhaustiveMatch (enabled): true
   elaborate redundantMatch (default): warn
   elaborate redundantMatch (enabled): true
   elaborate sequenceNonUnit (default): ignore
   elaborate sequenceNonUnit (enabled): true
   elaborate warnUnused (default): false
   elaborate warnUnused (enabled): true
   elaborate only: false
   export header: None
   exn history: false
   gc check: Limit
   indentation: 3
   inline: NonRecursive {product = 320, small = 60}
   inlineIntoMain: true
   input file: mlton-unhandled-chr
   keep Machine: false
   keep RSSA: false
   keep SSA: false
   keep SSA2: false
   keep dot: false
   keep passes: []
   extra_: false
   lib dir: /home/vk/work/sml/mlton/mlton/install/usr/lib/mlton
   lib target dir: /home/vk/work/sml/mlton/mlton/install/usr/lib/mlton/self
   loop passes: 1
   mark cards: true
   max function size: 10000
   mlb path maps: []
   native commented: 0
   native live stack: false
   native optimize: 1
   native move hoist: true
   native copy prop: true
   native copy prop cutoff: 1000
   native cutoff: 100
   native live transfer: 8
   native shuffle: true
   native ieee fp: false
   native split: Some 20000
   optimizationPassesSet: [<ssa2PassesSet>, <ssaPassesSet>, <sxmlPassesSet>, <xmlPassesSet>]
   polyvariance: Some {rounds = 2, small = 30, product = 300}
   prof passes: []
   profile: None
   profile branch: false
   profile C: []
   profile IL: ProfileSource
   profile include/exclude: [(Seq [Star [.], Or [Seq [Seq [[<], [b], [a], [s], [i], [s], [>]]]], Star [.]], false)]
   profile raise: false
   profile stack: false
   show basis: Some .tmp
   show def-use: None
   show types: false
   ssaPassesSet: <ssaPassesSet>
   ssaPasses: [default]
   ssa2PassesSet: <ssa2PassesSet>
   ssa2Passes: [default]
   sxmlPassesSet: <sxmlPassesSet>
   sxmlPasses: [default]
   target: self
   target arch: X86
   target OS: Linux
   type check: false
   verbosity: Pass
   warn unrecognized annotation: true
   xmlPassesSet: <xmlPassesSet>
   xmlPasses: [default]
   zone cut depth: 100
   Type Check SML starting
      parseAndElaborate starting
      parseAndElaborate finished in 3.98 + 1.72 (30% GC)
   Type Check SML raised in 3.98 + 1.72 (30% GC)
MLton raised in 3.99 + 1.72 (30% GC)
unhandled exception: Chr