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