|Title||Pointers from MPS stack pin down user objects|
|Assigned user||Richard Brooksby|
|Description||When the MPS scans the stack of the mutator thread that calls the MPS (the only thread in single-threaded uses) it starts at the current stack pointer and register contents. This means that it scans its own stack as well as the mutator's. We know that the MPS stack is not part of the mutator's graph of objects, but it is very likely to contain pointers to base addresses of pages and segments, causing them to be pinned down. This causes zone pollution. We know this really happens, as it has been observed in a commercial customisation of the MPS.|
|Analysis||The MPS should scan the mutator's registers and stack only. That is, the stack above the entry point to the MPS, and the register contents that the mutator had on call. We can get at these in a semi-portable manner by calling setjmp at any entry point to the MPS that might scan the stack, and scanning the jmp_buf and the stack it refers to.|
Adapt sc.h (stack context) for the open source MPS (needs platform-specific research). Apply it on those entry points at least. Possibly on every ArenaEnter.
See orginal e-mail thread        and review thread            .
GDR 2014-05-01: Note that if we implement this then we will be in a position to fix job003780.
Here's some analysis of which entry points might call StackScan (and so need the stack context to have been recorded at ArenaEnter). StackScan is called by ThreadScan ← mps_stack_scan_ambig ← RootScan ← traceScanRootRes ← traceScanRoot ← rootFlip ← traceFlip ← TraceStart ← TracePoll, and then:
so only these nine entry points might flip, and so need the stack context. This kind of analysis is delicate, though -- it will be a good idea to assert in StackScan that we have the stack context, but if we don't, then get it anyway.
|Created by||Richard Brooksby|
|Created on||2013-06-20 17:05:19|
|Last modified by||Gareth Rees|
|Last modified on||2018-07-11 15:21:33|
|History||2013-06-20 RB Created.|
|194595||closed||2018-07-11 15:20:49||Gareth Rees||Merge branch/2014-10-26/sc into the master sources.|
|187412||open||2014-10-26 22:18:57||Gareth Rees||Save mutator context on entry to the MPS.|