Bug in MLton exception handling?

Anoq of the Sun anoq@HardcoreProcessing.com
Tue, 26 Mar 2002 17:56:46 +0100


This is a multi-part message in MIME format.
--------------6B514CC7740862869A9B7705
Content-Type: text/plain; charset=iso-8859-7
Content-Transfer-Encoding: 7bit

Hello!


I have now done a little testing on BinIO - and I'm quite confident that
the files I sent earlier really works. At least the test in
TestBinIO.sml
that I just made passes fine. It takes a little time to run the test -
especially with SML/NJ - but on MLton it only becomes a small delay on
my machine ;)

I also made the same test for TextIO (TestTextIO.sml) - and this passes
too on Linux,
but it would (should?) of course not work on a platform like Win32.

There are still the issues with the #defines for cygwin and it's not
tested
for Win32 yet - but apart from that I think it would be quite safe to
throw
my changes into your MLton sources (20020314). You can do a diff
afterwards
to see what I changed...


The reason that my CeX3D Converter doesn't work before - seems a little
tricky.
I'm not sure yet - but I suspect that it might be a bug in MLton's
exception handling
or something. It is on a quite sophisticated piece of combinator parser
code -
and I think I might be able to make a small example which reproduces the
problem for you... I will get back when I know more :)
The problem occurs both when using the native and the gcc backends - so
it
shouldn't be in the backend (if indeed it turns out to be a bug...).


Cheers
-- 
http://www.HardcoreProcessing.com
--------------6B514CC7740862869A9B7705
Content-Type: application/x-unknown-content-type-sml_auto_file;
 name="TestBinIO.sml"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="TestBinIO.sml"

ZnVuIHRlc3RSYW5nZSAoc3RhcnQsIGxlbmd0aCkgPQogICAgICBsZXQKICAgICAgICB2YWwg
YWxsQ2hhcnMgPSBXb3JkOFZlY3Rvci50YWJ1bGF0ZShsZW5ndGgsIGZuIGkgPT4gV29yZDgu
ZnJvbUludCAoKGkgKyBzdGFydCkgbW9kIDI1NikpCgogICAgICAgIHZhbCBvdXRTdHIgPSBC
aW5JTy5vcGVuT3V0ICJ0ZXN0QmluSU8udHh0IgogICAgICAgIHZhbCBfID0gQmluSU8ub3V0
cHV0IChvdXRTdHIsIGFsbENoYXJzKQogICAgICAgIHZhbCBfID0gQmluSU8uY2xvc2VPdXQg
b3V0U3RyCiAgICAgICAgCiAgICAgICAgdmFsIGluU3RyID0gQmluSU8ub3BlbkluICJ0ZXN0
QmluSU8udHh0IgogICAgICAgIHZhbCByZWFkQ2hhcnMgPSBCaW5JTy5pbnB1dEFsbCBpblN0
cgogICAgICAgIHZhbCBfID0gQmluSU8uY2xvc2VJbiBpblN0cgogICAgICAgIAogICAgICAg
IGZ1biB0ZXN0Q2hhckYgKGMsIGNudCkgPQogICAgICAgICAgICAgIGxldAogICAgICAgICAg
ICAgICAgdmFsIHJlYWRDID0gV29yZDhWZWN0b3Iuc3ViKHJlYWRDaGFycywgY250KQogICAg
ICAgICAgICAgICAgdmFsIF8gPSBpZiBjID0gcmVhZEMgdGhlbgogICAgICAgICAgICAgICAg
ICAgICAgICAgICgpCiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAg
ICAgICAgICAgICAgICBwcmludCAoIkVycm9yIGF0IGluZGV4OiAiIF4gKEludC50b1N0cmlu
ZyBjbnQpIF4gIjogIiBeCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXb3Jk
OC50b1N0cmluZyBjKSBeICIgPD4gIiBeIChXb3JkOC50b1N0cmluZyByZWFkQykpCiAgICAg
ICAgICAgICAgaW4KICAgICAgICAgICAgICAgIGNudCArIDEKICAgICAgICAgICAgICBlbmQK
ICAgICAgCiAgICAgICAgdmFsIF8gPSBXb3JkOFZlY3Rvci5mb2xkbCB0ZXN0Q2hhckYgMCBh
bGxDaGFycwogICAgICBpbgogICAgICAgICgpCiAgICAgIGVuZAoKdmFsIF8gPSB0ZXN0UmFu
Z2UgKDAsIDI1NikKdmFsIF8gPSBwcmludCAiYmFzaWMgdGVzdCBvZiB3cml0aW5nIGFuZCBy
ZWFkaW5nIGJhY2sgYWxsIGNoYXJhY3RlcnMgZG9uZVxuIgp2YWwgXyA9IExpc3QudGFidWxh
dGUoMjU2LCBmbiBpID0+IExpc3QudGFidWxhdGUoMjU3LCBmbiBpMiA9PiB0ZXN0UmFuZ2Ug
KGksIGkyKSkpCnZhbCBfID0gcHJpbnQgInRlc3Qgb2Ygd3JpdGluZyBmaWxlcyBvZiBhbGwg
cG9zc2libGUgY2hhcmFjdGVycyBpbiBzdHJpbmdzIG9mIGxlbmd0aHMgMC0yNTYgZmluaXNo
ZWRcbiIKdmFsIF8gPSBMaXN0LnRhYnVsYXRlKDYsIGZuIGkgPT4gTGlzdC50YWJ1bGF0ZSg1
MDAwLCBmbiBpMiA9PiB0ZXN0UmFuZ2UgKGksIGkyKSkpCgp2YWwgXyA9IHByaW50ICJ0ZXN0
IGZpbmlzaGVkXG4i
--------------6B514CC7740862869A9B7705
Content-Type: application/x-unknown-content-type-sml_auto_file;
 name="TestTextIO.sml"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="TestTextIO.sml"

KCogTm90aWNlOiBUaGlzIHRlc3Qgd2lsbCBub3QgYmUgcGFzc2VkIG9uIHBsYXRmb3JtcyBs
aWtlIFdpbjMyIQogICAgICAgICAgIEJ1dCBmb3IgTGludXggaXQgaGFwcGVucyB0byB3b3Jr
Li4uICopCgpmdW4gdGVzdFJhbmdlIChzdGFydCwgbGVuZ3RoKSA9CiAgICAgIGxldAogICAg
ICAgIHZhbCBhbGxDaGFycyA9IENoYXJWZWN0b3IudGFidWxhdGUobGVuZ3RoLCBmbiBpID0+
IGNociAoKGkgKyBzdGFydCkgbW9kIDI1NikpCgogICAgICAgIHZhbCBvdXRTdHIgPSBUZXh0
SU8ub3Blbk91dCAidGVzdEJpbklPLnR4dCIKICAgICAgICB2YWwgXyA9IFRleHRJTy5vdXRw
dXQgKG91dFN0ciwgYWxsQ2hhcnMpCiAgICAgICAgdmFsIF8gPSBUZXh0SU8uY2xvc2VPdXQg
b3V0U3RyCiAgICAgICAgCiAgICAgICAgdmFsIGluU3RyID0gVGV4dElPLm9wZW5JbiAidGVz
dEJpbklPLnR4dCIKICAgICAgICB2YWwgcmVhZENoYXJzID0gVGV4dElPLmlucHV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