Yes, I can do that.  However, I&#39;m hoping to narrow it down a lot more so that I can file a more useful bug report.<div><br></div><div>Since sending my last email, I have learned a bit more:</div><div><br></div><div>I was using &#39;fail&#39; (the Monad being ReaderT . StateT . ST) to report errors.  If I replace &#39;fail msg&#39; with &#39;error msg&#39; or &#39;return (error msg)&#39;, then the aforementioned internal error does not occur.</div>

<div><br></div><div>In some cases, the program dies with the aforementioned error.  In other cases, it segfaults.</div><div><br></div><div>- Philip</div><div><br><div class="gmail_quote">On Mon, Apr 5, 2010 at 11:59 AM, Don Stewart <span dir="ltr">&lt;<a href="mailto:dons@galois.com">dons@galois.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Any &#39;internal error&#39; is almost certainly an RTS or compiler bug. Can you<br>
make a bug report?<br>
<br>
<br>
philip.weaver:<br>
<div><div></div><div class="h5">&gt; Hi all,<br>
&gt;<br>
&gt; A program that I built with GHC is crashing at runtime with the following<br>
&gt; error:<br>
&gt;<br>
&gt;     internal error: eval_thunk_selector: strange selectee 12<br>
&gt;<br>
&gt; I have not found much via Google, just an old post regarding ghc 6.0 that<br>
&gt; recommends cleaning and rebuilding.  I have cleaned the build directory and<br>
&gt; re-built the executable, and I still get the error.<br>
&gt;<br>
&gt; The program is a compiler, and this error began showing up after I added<br>
&gt; support for memoization of results using the ST Monad and STRefs.  For example,<br>
&gt; the following function creates a reference to a thunk:<br>
&gt;<br>
&gt; newMutableRef m<br>
&gt;   = do ref &lt;- newSTRef $ error &quot;access ref too soon!&quot;<br>
&gt;        let m&#39; = do r &lt;- m<br>
&gt;                    writeSTRef ref (return r)<br>
&gt;                    return r<br>
&gt;        writeSTRef ref m&#39;<br>
&gt;        return $ ref<br>
&gt;<br>
&gt; Here&#39;s some information about my system:<br>
&gt;<br>
&gt;   • GHC 6.12.1<br>
&gt;   • Mac OS X 10.6.3 (Snow Leopard)<br>
&gt;<br>
&gt; So, what could cause this error?  Any suggestions that can help me narrow down<br>
&gt; the problem would be greatly appreciated.  If this is in fact a GHC bug, I&#39;d<br>
&gt; like to find a workaround for now and also reproduce it in a small example so I<br>
&gt; can file a bug report.<br>
&gt;<br>
&gt; - Philip<br>
&gt;<br>
<br>
</div></div>&gt; _______________________________________________<br>
&gt; Glasgow-haskell-users mailing list<br>
&gt; <a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
<br>
</blockquote></div><br></div>