Change History (4)

comment:1 Changed 4 years ago by igloo

  • Milestone set to 7.0.2

Thanks for the report.

comment:2 Changed 4 years ago by mitar

OK. Later on I found more. In FFI code (when compiled with GHC) you should really not use atexit (if you do not use some mutex or something). I was getting segment faults because I used atexit to cleanup. But at the same time I called cleanup from Haskell when program was exiting. The result was (because I didn't have any special mutex around cleanup code) that cleanup was getting called twice (and it seems even at the same time). Probably because I called cleanup from one Haskell thread and atexit was called from main program thread. So there is some interaction going on. Hm, now that I think I see that the problem was probably because I didn't wait for all threads to finish (one of them was doing FFI cleanup) before main thread exited. So this is probably why it happened that that cleanup function was called twice.

comment:3 Changed 4 years ago by igloo

  • Milestone changed from 7.0.2 to 7.2.1

comment:4 Changed 4 years ago by simonmar

  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from 6.12.3 to 6.13

I added it to the linker's symbol table. I think atexit resides in a static C library and so can't be resolved by dlsym() at runtime.

Tue Mar 29 08:56:28 PDT 2011  Simon Marlow <[email protected]>
  * add atexit (#4456)
Note: See TracTickets for help on using tickets.