[GHC] #5604: Thread handle leak in runtime

GHC cvs-ghc at haskell.org
Mon Nov 7 18:40:32 CET 2011


#5604: Thread handle leak in runtime
---------------------------------------------+------------------------------
    Reporter:  yurij                         |        Owner:       
        Type:  bug                           |       Status:  new  
    Priority:  normal                        |    Milestone:  7.4.1
   Component:  Runtime System                |      Version:  7.2.1
    Keywords:  _endthreadex, shutdownThread  |     Testcase:       
   Blockedby:                                |   Difficulty:       
          Os:  Windows                       |     Blocking:       
Architecture:  x86                           |      Failure:  Other
---------------------------------------------+------------------------------

Comment(by yurij):

 _endthread calls CloseHandle, so it should be the right API.


 In fact, I`m trying to workaround FFI bug with hs_init/hs_exit:
 http://www.haskell.org/ghc/docs/7.2.1/html/users_guide/bugs-and-
 infelicities.html#ffi-divergence

 I`ve found some global/thread-local variables (myTask, allocs,
 generations, mblock_allocated) which doesn`t properly set to NULL/0 on
 hs_exit and set it to NULL in appropriate finalization functions but
 obviously it is not enough to fix segfaults after repeated runtime
 initialization/deinitialization.

 So I try to use LoadLibrary/hs_init/use haskell
 functions/hs_exit/FreeLibrary call sequence to avoid this problem and
 notice this handle leak.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5604#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list