
I managed to get calling a Haskell function from an Eiffel program working with one Eiffel compiler, but when I compiled the program with a different Eiffel compiler, and ran it, I get a crash, apparently in the GHC garbage collector: (gdb) backtrace #0 0x0000000000452fc0 in evacuate () #1 0x000000000043b7f8 in scavenge_static () #2 0x0000000000439ea4 in GarbageCollect () #3 0x00000000004351df in scheduleDoGC () #4 0x00000000004353da in exitScheduler () #5 0x00000000004345a2 in hs_exit_ () #6 0x000000000041900c in T21f3 (C=0x1971f80, a1=7) at fib1.c:1200 #7 0x00000000004191a8 in T21c10 () at fib1.c:1000 #8 0x0000000000419356 in main (argc=<value optimized out>, argv=<value optimized out>) at fib1.c:11616 Can you suggest how I should go about investigating this problem further? -- Colin Adams Preston Lancashire

On Sat, Nov 15, 2008 at 05:31:12PM +0000, Colin Paul Adams wrote:
Can you suggest how I should go about investigating this problem further?
Try linking with -debug, and running with +RTS -DS. That might reveal the problem, and if not you should get more useful info from gdb. Thanks Ian

"Ian" == Ian Lynagh
writes:
Ian> On Sat, Nov 15, 2008 at 05:31:12PM +0000, Colin Paul Adams wrote: >>
Can you suggest how I should go about investigating this problem >> further?
Ian> Try linking with -debug, and running with +RTS -DS. That Ian> might reveal the problem, and if not you should get more Ian> useful info from gdb. I added the -debug link flag. Add I added +RTS and -DS as command-line arguments in the call to hs_init() (I presume that's what you meant me to do). I can't notice any difference. Where should I be looking for the information? -- Colin Adams Preston Lancashire

On Sun, Nov 16, 2008 at 06:49:20PM +0000, Colin Paul Adams wrote:
I added the -debug link flag.
Add I added +RTS and -DS as command-line arguments in the call to hs_init() (I presume that's what you meant me to do).
Yes, that sounds like it should work.
I can't notice any difference. Where should I be looking for the information?
If you were lucky it would abort with an assertion failure. Anyway, gdb should now have debugging symbols to work with. Thanks Ian

"Ian" == Ian Lynagh
writes:
Ian> If you were lucky it would abort with an assertion Ian> failure. Anyway, gdb should now have debugging symbols to Ian> work with. It already did (I passed the -g option to gcc). I guess I will need to install the GHC source to get file listings. That sounds like hard work. I think I'll wait for 6.10.1 . -- Colin Adams Preston Lancashire

Colin Paul Adams wrote:
"Ian" == Ian Lynagh
writes: Ian> If you were lucky it would abort with an assertion Ian> failure. Anyway, gdb should now have debugging symbols to Ian> work with.
It already did (I passed the -g option to gcc).
I guess I will need to install the GHC source to get file listings. That sounds like hard work. I think I'll wait for 6.10.1 .
If you're calling a Haskell library from C, the problem might be that you forgot hs_add_root(), or that your hs_add_root() isn't pointing to the right module (it should point to the module that transitively imports all the other modules in your library). You can use multiple hs_add_root() calls if necessary. Cheers, Simon

"Simon" == Simon Marlow
writes:
Simon> Colin Paul Adams wrote:
>>>>>>> "Ian" == Ian Lynagh

"Colin" == Colin Paul Adams
writes:
Simon> If you're calling a Haskell library from C, the problem Simon> might be that you forgot hs_add_root(), or that your Simon> hs_add_root() isn't pointing to the right module (it should Simon> point to the module that transitively imports all the other Simon> modules in your library). You can use multiple Simon> hs_add_root() calls if necessary. Colin> I'm sure I have that right. There is only one Colin> module. Unless somehow the __GLASGOW_HASKELL__ symbol isn't Colin> getting defined for the C compile. I'll try removing the Colin> #ifdef to see if that makes a difference. It wasn't that. And yum has just updated my version of ghc from 6.8.2 to 6.8.3 - no 6.10.1 available yet. I'll just wait for that first, in case the new GC makes a change. -- Colin Adams Preston Lancashire
participants (3)
-
Colin Paul Adams
-
Ian Lynagh
-
Simon Marlow