MPS issue job003780

TitleNo test case for register scanning
Statusclosed
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.

GDR 2020-09-06: Now that job003525 is fixed, we can whether there are any test cases that rely on stack and register scanning, by removing the call to TraceScanArea() in StackScan(). If I do this on xci6ll then airtest, awlut, awluthe fail.
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 on2020-09-06 18:57:41
History2014-05-01 GDR Created.

Fixes

Change Effect Date User Description
194595 closed 2018-07-11 15:20:49 Gareth Rees Merge branch/2014-10-26/sc into the master sources.