[MLton] bug report: 20100608 macintel raises SysErr in basis library if run from a bundle

Bernard Berthomieu bernard at laas.fr
Tue Sep 21 02:28:08 PDT 2010


Hello,

Under some special circumstances (see below), 20100608 macintel
raises SysErr in basis library.

The problem seems to be with the value of stdIn in that context.

--

For reproducing the bug, I attached an archive containing:
     an sml file:       mlapp.sml
     a mac bundle:  nd.app

The bundle (nd.app) embeds a tcl/tk interpreter running
the tcl script:  nd.app/Contents/Resources/Scripts/AppMain.tcl

The script executes the sml application "mlapp" (in the same directory),
obtained from the sml file attached by: mlton mlapp.sml.

When double-clicked or run by "open nd.app" in a terminal, nd.app
pops a dialog with message "hello" if the call of mlapp is successfull,
or an error message otherwise. If mlapp.sml refers to TextIO.stdIn, then
the following message shows up:

    unhandled exception: SysErr
    MLton bug: unhandled exception in Basis Library
    Please send a bug report tp MLton at mlton.org.

If the line "TextIO.stdIn" is removed in mlapp.sml (and the resulting
mlapp placed in directory nd.app/Contents/Resources/Scripts), then
the call succeeds and the dialog shows hello.

If AppMain.tcl is run directly from a terminal by "wish  AppMain.tcl"
in directory nd.app/Contents/Resources/Scripts, then SysErr is not
raised.

  Bernard.

--

Bernard Berthomieu
LAAS / CNRS
7, avenue du Colonel Roche
31077 Toulouse Cedex
France

Bernard.Berthomieu at laas.fr
http://www.laas.fr/~bernard
phone  +33/(0)5 61 33 63 63
fax    +33/(0)5 61 33 64 11


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug2.tar
Type: application/x-tar
Size: 6717440 bytes
Desc: not available
Url : http://mlton.org/pipermail/mlton/attachments/20100921/cc2b32d5/bug2-0001.tar


More information about the MLton mailing list