#716: Unloading a dll generated by GHC doesn't free all resources
-------------------------------------+--------------------------------------
  Reporter:  [EMAIL PROTECTED]  |          Owner:         
      Type:  bug                     |         Status:  new    
  Priority:  normal                  |      Milestone:         
 Component:  Compiler                |        Version:  6.4.1  
  Severity:  normal                  |     Resolution:         
  Keywords:                          |             Os:  Unknown
Difficulty:  Unknown                 |   Architecture:  Unknown
-------------------------------------+--------------------------------------
Comment (by [EMAIL PROTECTED]):

 After some more examination I've seen that the threads are supposed to
 exit.
 BUT, it doesn't really work because of a bad race condition.

 Take stopTicker().  It sends an event to the tick thread that tells it
 to exit.  But then it never waits for the thread to actually exit!
 This means that when the tick thread get scheduled to run the Haskell
 DLL migh have been unloaded from memory.  And it seems that that this
 really happens, albeit rarely.

 For each occurence of _beginthreadex() in the code there really needs to
 be a corresponding call that waits for the thread to shut down when
 exiting.  You can't rely on thread scheduling to run things in the right
 order.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/716>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to