MPS issue job003780

TitleNo test case for register scanning
Statusopen
Priorityoptional
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionDL spotted [1] that I had omitted to call setjmp() in the ANSI stack scanner. Nonetheless, all the test cases passed. This indicates a problem: we don’t have any test cases that require the registers to be scannd.
AnalysisAs long as job003525 (pointers from MPS stack pin down user objects) remains unfixed, this is only a theoretical problem: the registers are scanned quite deep down the stack — at the point where they are scanned, the stack went StackScan, ThreadScan, RootScan, traceScanRootRes, traceScanRoot, rootFlip, RootsIterate, traceFlip, TraceStart, TracePoll, ArenaPoll (minus some inlining) before reaching any client code, so the registers have long since been spilled on all the processors we support (IA-32 and x86-64). This makes it impossible to write a test case.

But if job003525 is fixed, we will capture the mutator context on entry to the MPS, rather than in StackScan(). As a side-effect of this we would have a much better chance of picking up registers containing client references, and so of testing the register scanning. However, it will still be very difficult to write a test case in C. Perhaps we can write it in assembler? Or perhaps we need our own compiler.
How foundinspection
Evidence[1] <https://info.ravenbrook.com/mail/2014/04/30/14-24-51/0/>
Created byGareth Rees
Created on2014-05-01 15:32:17
Last modified byGareth Rees
Last modified on2017-02-18 13:37:23
History2014-05-01 GDR Created.