Ticket #926 (new bug)

Opened 7 years ago

Last modified 4 years ago

infinite loop in ShutdownIOManager()

Reported by: guest Owned by:
Priority: lowest Milestone: _|_
Component: Runtime System Version: 6.5
Keywords: Cc: mark@…
Operating System: Windows Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Hi,

I have found a way to 'hang' a DLL created using ghc-6.5.20061006 under Win32. This occurs when I dynamically load DLL built using GHC, call one of its exported functions that uses file IO and then exit my program without explicitly releasing the DLL first. I have uploaded a test application to  http://eeter.fi.tartu.ee/~mark/ghc_hang.zip that demonstrates this issue.

I am not sure if I can call this a bug, as when I unload the DLL, everything works fine. But this does not happen in GHC-6.4.2 or older versions.

Regards, Mark

Attachments

ghc_hang.zip Download (2.0 KB) - added by igloo 7 years ago.
Just attaching the submitter's testcase to the bug report

Change History

Changed 7 years ago by igloo

Just attaching the submitter's testcase to the bug report

Changed 6 years ago by igloo

  • milestone set to 6.6.1

Changed 6 years ago by simonmar

  • owner set to simonmar

I'm looking at this.

Changed 6 years ago by simonmar

  • priority changed from normal to lowest
  • milestone changed from 6.6.1 to _|_

Fixed in the threaded RTS:

Thu Feb  1 03:40:47 PST 2007  Simon Marlow <simonmar@microsoft.com>
  * Partial fix for #926
  It seems that when a program exits with open DLLs on Windows, the
  system attempts to shut down the DLLs, but it also terminates (some
  of?) the running threads.  The RTS isn't prepared for threads to die
  unexpectedly, so it sits around waiting for its workers to finish.
  This bites in two places: ShutdownIOManager() in the the unthreaded
  RTS, and shutdownCapability() in the threaded RTS.  So far I've
  modified the latter to notice when worker threads have died
  unexpectedly and continue shutting down.  It seems a bit trickier to
  fix the unthreaded RTS, so for now the workaround for #926 is to use
  the threaded RTS.

I'll leave the bug open, but at a low priority since there are good workarounds.

Changed 4 years ago by simonmar

  • owner simonmar deleted
Note: See TracTickets for help on using tickets.