[MLton] Re: bug report: 20100608 macintel raises SysErr in basis
library if run from a bundle
Matthew Fluet
matthew.fluet at gmail.com
Tue Sep 21 07:46:56 PDT 2010
Sounds similar to the issue discussed in this thread:
http://mlton.org/pipermail/mlton-user/2008-September/001435.html
An expedient solution to your problem would seem to be to change the
tcl script to provide a null stdin:
if [catch {set msg [exec [file join [file dirname [info script]]
mlapp] < "/dev/null"] }] {
set msg $errorInfo
}
-Matthew
On Tue, Sep 21, 2010 at 5:28 AM, Bernard Berthomieu <bernard at laas.fr> wrote:
> 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
>
>
>
More information about the MLton
mailing list