#5897: GHC runtime task workers are not released with C FFI -------------------------------+-------------------------------------------- Reporter: sanketr | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Resolution: | Keywords: worker, ffi Os: Unknown/Multiple | Architecture: x86_64 (amd64) Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: #4262 -------------------------------+-------------------------------------------- Changes (by sanketr):
* owner: simonmar => * status: closed => new * resolution: invalid => Comment: Simon, thanks for the catch. I forgot that I was getting pointer from a vector without retaining a reference to the vector (by passing it to say, long-lived timer function). How do I determine that the increasing number of threads is not an issue, and that they will be gc-ed eventually (if RTS output is just showing worker threads that are not alive anymore)? When I run the above fixed code on Linux for a few seconds, I get RTS output like below: {{{ ....... head snipped for bug report here because too long ..... Task 93100 (worker) : 0.00s ( 0.00s) 0.00s ( 0.00s) Task 93101 (worker) : 0.00s ( 0.00s) 0.00s ( 0.00s) Task 93102 (worker) : 0.00s ( 0.08s) 0.00s ( 0.00s) Task 93103 (worker) : 0.00s ( 0.00s) 0.00s ( 0.00s) Task 93104 (worker) : 0.00s ( 0.14s) 0.00s ( 0.00s) Task 93105 (worker) : 0.00s ( 0.12s) 0.00s ( 0.00s) Task 93106 (worker) : 0.00s ( 0.03s) 0.00s ( 0.00s) Task 93107 (worker) : 0.00s ( 0.20s) 0.00s ( 0.00s) Task 93108 (worker) : 0.03s ( 5.10s) 0.00s ( 0.00s) Task 93109 (bound) : 0.00s ( 0.00s) 0.03s ( 0.03s) }}} It keeps increasing without any bounds for the short time I run it. If you look at the code, sendSignal is kicked off in FFI, but then it returns, and timerevent resumes execution. So, those worker threads should be freed (eventually). What I want to make sure is that the above observation can be safely ignored, and will like to know how to determine it. I am re-opening the bug for task worker resolution. Please close it after commenting on my observation - I hope there is no bug here. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5897#comment:8> 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