Ticket #3605 (closed bug: fixed)
Dll's freeze with -threaded
| Reported by: | NeilMitchell | Owned by: | simonmar |
|---|---|---|---|
| Priority: | high | Milestone: | 7.0.1 |
| Component: | Documentation | Version: | 6.12.1 RC1 |
| Keywords: | Cc: | ndmitchell@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Attached are two source files (one .c, one .hs), which are compiled (using mk.sh) into DsoHsDemo?.dll. When this library is loaded, using the following C snippet:
int main(int argc, char* argv[])
{
printf("Started LoadLibrary\n");
LoadLibrary("DsoHsDemo.dll");
printf("Finished LoadLibrary\n");
}
The program freezes:
$ ./mk.sh && ./CSnippet The Glorious Glasgow Haskell Compilation System, version 6.12.0.20091010 Creating library file: DsoHsDemo.dll.a Started LoadLibrary pre hs_init <program freezes>
The freeze only occurs when the dll is linked with -threaded, and happens within either startupHaskell, or (if you call hs_init/hs_add_root instead) within hs_add_root. This happens with GHC 6.10.4 and 6.12rc1 on Windows XP.
This bug appears to make it impossible to successfully build a DLL for multithreaded use.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

