Re: Scavenging SRTs in scavenge_one

2018-06-21 Thread Simon Marlow
When scavenge_one() sees a STACK, it calls scavenge_stack() which traverses the stack frames, including their SRTs. So I don't understand what's going wrong for you - how are the SRTs not being traversed? Cheers Simon On 21 June 2018 at 11:58, Ömer Sinan Ağacan wrote: > Here's an example

Re: Scavenging SRTs in scavenge_one

2018-06-21 Thread Ömer Sinan Ağacan
Here's an example where we allocate a large (4K) stack: >>> bt #0 allocateMightFail (cap=0x7f366808cfc0 , n=4096) at rts/sm/Storage.c:876 #1 0x7f3667e4a85d in allocate (cap=0x7f366808cfc0 , n=4096) at rts/sm/Storage.c:849 #2 0x7f3667e16f46 in threadStackOverflow

Re: Scavenging SRTs in scavenge_one

2018-06-21 Thread Ömer Sinan Ağacan
> Large objects can only be primitive objects, like MUT_ARR_PTRS, allocated by > the RTS, and none of these have SRTs. Is is not possible to allocate a large STACK? I'm currently observing this in gdb: >>> call *Bdescr(0x4200ec9000) $2 = { start = 0x4200ec9000, free =

Re: GHC API question: resolving dependencies for modules

2018-06-21 Thread Matthew Pickering
This doesn't answer your question directly but if you want to gather information about a module then using a source plugin would probably be easier and more robust than using the GHC API. You need to write a function of type: ``` ModSummary -> TcGblEnv -> TcM TcGblEnv ``` In `TcGblEnv` you will

GHC API question: resolving dependencies for modules

2018-06-21 Thread Dmitriy Kovanikov
Hello! I’m trying to use GHC as a library. And my goal is to be able to gather information about where each function or data type came from. I’ve started by simply calling `getNamesInScope` function and observing its result. Here is my code: * Main.hs: https://lpaste.net/9026688686753841152