bug report: "Alias still
Hi all, I'm getting the following compile error: Converting to Grin... Found 2 CAFs to convert to constants, 0 of which are recursive. Recursive Constant theMain$10 v-1282411543 &(CControl.CoolConcurrent.Thread &(CInt# 0) &(P3_theMain$8)) theMain$11 v-1297615895 &(CControl.CoolConcurrent.TS 0 0 &(CControl.CoolConcurrent.Thread &(CInt# 0) &(P3_theMain$8)) &(CQ.Q &[] &[])) CAFS Alias still exists: ELit (Control.CoolConcurrent.TID (EVar (x51::ELit (Jhc.Prim.Int::ESort *)))::ELit (Jhc.Prim.Int::ESort *)) You can (hopefully?) reproduce this error by darcs getting my repository and compiling the demo: darcs get http://abridgegame.org/concurrency jhc demo.hs I believe this is vanilla Haskell code that ought to compile just fine. It does hide parts of the Prelude, but I don't see how that could be involved. For the curious, I started experimenting with a pure-Haskell implementation of concurrency. It looks feasible, although I haven't yet implemented any blocking IO using non-blocking primitives (which is often the whole point of concurrency). Of course, once the FFI is involved, we may want to involve the compiler, since any FFI call may block--and thus might be advisable to run in a separate thread. But that's not an issue for any of my applications. -- David Roundy
Hmm.. it looks like that for some reason not all of the TID newtype constructors are being removed properly. I'll take a look. I am thinking it might have something to do with the strictness annotation and UNPACKing of strict fields... hmm... John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
Agreed. Removing all strictness annotations from data structures
eliminates the error.
David
On Thu, Sep 3, 2009 at 11:23 PM, John Meacham
Hmm.. it looks like that for some reason not all of the TID newtype constructors are being removed properly. I'll take a look. I am thinking it might have something to do with the strictness annotation and UNPACKing of strict fields... hmm...
John
-- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/ _______________________________________________ jhc mailing list jhc@haskell.org http://www.haskell.org/mailman/listinfo/jhc
-- David Roundy
When I remove the strictness annotations and compile and run the code,
I get the following runtime error:
demo_code.c:2863: case fell off
I know how to leave the C code, so I can see where this error comes
from, but it's opaque enough that I've no idea what's going wrong. :(
David
On Fri, Sep 4, 2009 at 7:08 AM, David Roundy
Agreed. Removing all strictness annotations from data structures eliminates the error.
David
On Thu, Sep 3, 2009 at 11:23 PM, John Meacham
wrote: Hmm.. it looks like that for some reason not all of the TID newtype constructors are being removed properly. I'll take a look. I am thinking it might have something to do with the strictness annotation and UNPACKing of strict fields... hmm...
John
-- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/ _______________________________________________ jhc mailing list jhc@haskell.org http://www.haskell.org/mailman/listinfo/jhc
-- David Roundy
-- David Roundy
On Fri, Sep 04, 2009 at 07:18:53AM -0400, David Roundy wrote:
When I remove the strictness annotations and compile and run the code, I get the following runtime error:
demo_code.c:2863: case fell off
I know how to leave the C code, so I can see where this error comes from, but it's opaque enough that I've no idea what's going wrong. :(
Hmm.. this shouldn't happen. When debugging it is also a good idea to do a -dgrin-final and -dc, reading the final grin code is often easier than the c, variable numbers stay the same between the versions, so finding cooresponding places is pretty easy just by searching for the variable names. I tried to reproduce your test case but wasn't able to. do you have a version that reliably triggers this? are you compiling with -flint? that is usually a good thing to do if you suspect a bug in the compiler. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
It turned out that after a few recompiles of jhc, this "case fell off"
problem disappears. Presumably it was something that I messed up...
although I've no idea what that might have been. But as you've
gathered, I've been messing with the libraries and recompiling pretty
often... and not always remembering to do a make install.
David
On Fri, Sep 4, 2009 at 9:13 PM, John Meacham
On Fri, Sep 04, 2009 at 07:18:53AM -0400, David Roundy wrote:
When I remove the strictness annotations and compile and run the code, I get the following runtime error:
demo_code.c:2863: case fell off
I know how to leave the C code, so I can see where this error comes from, but it's opaque enough that I've no idea what's going wrong. :(
Hmm.. this shouldn't happen. When debugging it is also a good idea to do a -dgrin-final and -dc, reading the final grin code is often easier than the c, variable numbers stay the same between the versions, so finding cooresponding places is pretty easy just by searching for the variable names.
I tried to reproduce your test case but wasn't able to. do you have a version that reliably triggers this? are you compiling with -flint? that is usually a good thing to do if you suspect a bug in the compiler.
John
-- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/ _______________________________________________ jhc mailing list jhc@haskell.org http://www.haskell.org/mailman/listinfo/jhc
-- David Roundy
On Fri, Sep 04, 2009 at 10:58:30PM -0400, David Roundy wrote:
It turned out that after a few recompiles of jhc, this "case fell off" problem disappears. Presumably it was something that I messed up... although I've no idea what that might have been. But as you've gathered, I've been messing with the libraries and recompiling pretty often... and not always remembering to do a make install.
I tend to always test out of my jhc directory, you can make this easier by doing something like export JHC_OPTS="-v --noauto" export JHC_PATH="$HOME/prog/hs/jhc/jhc/lib/base:$HOME/prog/hs/jhc/jhc/lib/haskell98" or whatever is appropriate for your set up. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
participants (3)
-
David Roundy -
David Roundy -
John Meacham