[GHC] #8124: Possible leaks when using foreign export.

GHC ghc-devs at haskell.org
Thu Jan 30 15:23:56 UTC 2014


#8124: Possible leaks when using foreign export.
--------------------------------------------+------------------------------
        Reporter:  augustss                 |            Owner:
            Type:  bug                      |           Status:  new
        Priority:  normal                   |        Milestone:
       Component:  Runtime System           |          Version:  7.6.3
      Resolution:                           |         Keywords:
Operating System:  Unknown/Multiple         |     Architecture:
 Type of failure:  Runtime performance bug  |  Unknown/Multiple
       Test Case:                           |       Difficulty:  Unknown
        Blocking:                           |       Blocked By:
                                            |  Related Tickets:
--------------------------------------------+------------------------------

Comment (by NeilMitchell):

 Having to call in to dealloc has some issues:

 1. When destroying a thread, you need to know if it was ever used for GHC
 or incurr some overhead. As long as the dealloc is cheap and doesn't
 require you to have done the alloc, that's OK.
 2. You need to know when the thread goes away. If you are using a thread
 pool library, that's often very tricky. In our particular case it's
 feasible.
 3. If a thread dies unexpectedly the memory will be leaked. That's
 hopefully not a big issue in practice.

 So an explicit dealloc is OK for us, with the caveat that is must work
 successfully on a thread that was never used by GHC.

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


More information about the ghc-tickets mailing list