<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.10">
<title>Bugs20041109</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">


<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css">
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20201002</a>
</div>
</div>
<div id="header">
<h1>Bugs20041109</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>Here are the known bugs in <a href="Release20041109">MLton 20041109</a>, listed
in reverse chronological order of date reported.</p></div>
<div class="ulist"><ul>
<li>
<p>
<a id="bug17"></a>
 <span class="monospaced">MLton.Finalizable.touch</span> doesn&#8217;t necessarily keep values alive
 long enough.  Our SVN has a patch to the compiler.  You must rebuild
 the compiler in order for the patch to take effect.
</p>
<div class="paragraph"><p>Thanks to Florian Weimer for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug16"></a>
 A bug in an optimization pass may incorrectly transform a program
 to flatten ref cells into their containing data structure, yielding a
 type-error in the transformed program.  Our CVS has a
 <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/mlton/ssa/ref-flatten.fun.diff?r1=1.35&amp;r2=1.37">patch</a>
 to the compiler.  You must rebuild the compiler in order for the
 patch to take effect.
</p>
<div class="paragraph"><p>Thanks to <a href="VesaKarvonen">VesaKarvonen</a> for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug15"></a>
 A bug in the front end mistakenly allows unary constructors to be
 used without an argument in patterns.  For example, the following
 program is accepted, and triggers a large internal error.
</p>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="k">fun</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="k">case</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="k">of</span><span class="w"> </span><span class="n">SOME</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">true</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">_</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">false</span><span class="w"></span>
</pre></div></div></div>
<div class="paragraph"><p>We have fixed the problem in our CVS.</p></div>
<div class="paragraph"><p>Thanks to William Lovas for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug14"></a>
 A bug in <span class="monospaced">Posix.IO.{getlk,setlk,setlkw}</span> causes a link-time error:
 <span class="monospaced">undefined reference to Posix_IO_FLock_typ</span>
 Our CVS has a
 <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/posix/primitive.sml.diff?r1=1.34&amp;r2=1.35">patch</a>
 to the Basis Library implementation.
</p>
<div class="paragraph"><p>Thanks to Adam Chlipala for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug13"></a>
 A bug can cause programs compiled with <span class="monospaced">-profile alloc</span> to
 segfault.  Our CVS has a
 <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/mlton/backend/ssa-to-rssa.fun.diff?r1=1.106&amp;r2=1.107">patch</a>
 to the compiler.  You must rebuild the compiler in order for the
 patch to take effect.
</p>
<div class="paragraph"><p>Thanks to John Reppy for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug12"></a>
 A bug in an optimization pass may incorrectly flatten ref cells
 into their containing data structure, breaking the sharing between
 the cells.  Our CVS has a
 <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/mlton/ssa/ref-flatten.fun.diff?r1=1.32&amp;r2=1.33">patch</a>
 to the compiler.  You must rebuild the compiler in order for the
 patch to take effect.
</p>
<div class="paragraph"><p>Thanks to Paul Govereau for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug11"></a>
 Some arrays or vectors, such as <span class="monospaced">(char * char) vector</span>, are
 incorrectly implemented, and will conflate the first and second
 components of each element.  Our CVS has a
 <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/mlton/backend/packed-representation.fun.diff?r1=1.32&amp;r2=1.33">patch</a>
 to the compiler.  You must rebuild the compiler in order for the
 patch to take effect.
</p>
<div class="paragraph"><p>Thanks to Scott Cruzen for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug10"></a>
 <span class="monospaced">Socket.Ctl.getLINGER</span> and <span class="monospaced">Socket.Ctl.setLINGER</span>
 mistakenly raise <span class="monospaced">Subscript</span>.
 Our CVS has a
 <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/net/socket.sml.diff?r1=1.14&amp;r2=1.15">patch</a>
 to the Basis Library implementation.
</p>
<div class="paragraph"><p>Thanks to Ray Racine for reporting the bug.</p></div>
</li>
<li>
<p>
<a id="bug09"></a>
 <a href="ConcurrentML"> CML</a> <span class="monospaced">Mailbox.send</span> makes a call in the wrong atomic context.
 Our CVS has a <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/lib/cml/core-cml/mailbox.sml.diff?r1=1.3&amp;r2=1.4">patch</a>
 to the CML implementation.
</p>
</li>
<li>
<p>
<a id="bug08"></a>
 <span class="monospaced">OS.Path.joinDirFile</span> and <span class="monospaced">OS.Path.toString</span> did not
 raise <span class="monospaced">InvalidArc</span> when they were supposed to.  They now do.
 Our CVS has a <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/system/path.sml.diff?r1=1.8&amp;r2=1.11">patch</a>
 to the Basis Library implementation.
</p>
<div class="paragraph"><p>Thanks to Andreas Rossberg for reporting the bug.</p></div>
</li>
<li>
<p>
<a id="bug07"></a>
 The front end incorrectly disallows sequences of expressions
 (separated by semicolons) after a topdec has already been processed.
 For example, the following is incorrectly rejected.
</p>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="k">val</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
<span class="n">ignore</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"></span>
<span class="n">ignore</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"></span>
</pre></div></div></div>
<div class="paragraph"><p>We have fixed the problem in our CVS.</p></div>
<div class="paragraph"><p>Thanks to Andreas Rossberg for reporting the bug.</p></div>
</li>
<li>
<p>
<a id="bug06"></a>
 The front end incorrectly disallows expansive <span class="monospaced">val</span>
 declarations that bind a type variable that doesn&#8217;t occur in the
 type of the value being bound.   For example, the following is
 incorrectly rejected.
</p>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="k">val</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="k">let</span><span class="w"> </span><span class="k">exception</span><span class="w"> </span><span class="n">E</span><span class="w"> </span><span class="k">of</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="k">end</span><span class="w"></span>
</pre></div></div></div>
<div class="paragraph"><p>We have fixed the problem in our CVS.</p></div>
<div class="paragraph"><p>Thanks to Andreas Rossberg for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug05"></a>
 The x86 codegen fails to account for the possibility that a 64-bit
 move could interfere with itself (as simulated by 32-bit moves).  We
 have fixed the problem in our CVS.
</p>
<div class="paragraph"><p>Thanks to Scott Cruzen for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug04"></a>
 <span class="monospaced">NetHostDB.scan</span> and <span class="monospaced">NetHostDB.fromString</span> incorrectly
 raise an exception on internet addresses whose last component is a
 zero, e.g <span class="monospaced">0.0.0.0</span>.  Our CVS has a
 <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/net/net-host-db.sml.diff?r1=1.12&amp;r2=1.13">patch</a> to the Basis Library implementation.
</p>
<div class="paragraph"><p>Thanks to Scott Cruzen for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug03"></a>
 <span class="monospaced">StreamIO.inputLine</span> has an off-by-one error causing it to drop
 the first character after a newline in some situations.  Our CVS has a
 <a href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/io/stream-io.fun.diff?r1=text&amp;tr1=1.29&amp;r2=text&amp;tr2=1.30&amp;diff_format=h">patch</a>.
 to the Basis Library implementation.
</p>
<div class="paragraph"><p>Thanks to Scott Cruzen for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug02"></a>
 <span class="monospaced">BinIO.getInstream</span> and <span class="monospaced">TextIO.getInstream</span> are
 implemented incorrectly.  This also impacts the behavior of
 <span class="monospaced">BinIO.scanStream</span> and <span class="monospaced">TextIO.scanStream</span>.  If you (directly
 or indirectly) realize a <span class="monospaced">TextIO.StreamIO.instream</span> and do not
 (directly or indirectly) call <span class="monospaced">TextIO.setInstream</span> with a derived
 stream, you may lose input data.  We have fixed the problem in our
 CVS.
</p>
<div class="paragraph"><p>Thanks to <a href="WesleyTerpstra">WesleyTerpstra</a> for reporting this bug.</p></div>
</li>
<li>
<p>
<a id="bug01"></a>
 <span class="monospaced">Posix.ProcEnv.setpgid</span> doesn&#8217;t work.  If you compile a program
 that uses it, you will get a link time error
</p>
<div class="listingblock">
<div class="content monospaced">
<pre>undefined reference to `Posix_ProcEnv_setpgid'</pre>
</div></div>
<div class="paragraph"><p>The bug is due to <span class="monospaced">Posix_ProcEnv_setpgid</span> being omitted from the
 MLton runtime.  We fixed the problem in our CVS by adding the
 following definition to <span class="monospaced">runtime/Posix/ProcEnv/ProcEnv.c</span></p></div>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="n">Int</span> <span class="nf">Posix_ProcEnv_setpgid</span> <span class="p">(</span><span class="n">Pid</span> <span class="n">p</span><span class="p">,</span> <span class="n">Gid</span> <span class="n">g</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">return</span> <span class="n">setpgid</span> <span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">g</span><span class="p">);</span>
<span class="p">}</span>
</pre></div></div></div>
<div class="paragraph"><p>Thanks to Tom Murphy for reporting this bug.</p></div>
</li>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>
