MPS issue job003414

TitleNo test case for multi-threaded stack scanning
Statusclosed
Priorityessential
Assigned userGareth Rees
OrganizationRavenbrook
Descriptionjob003412 revealed a critical defect in the scanning of stacks on Linux. This wasn't caught by the automated tests that were run prior to the release of 1.110.0.
AnalysisThe amcssth test case is not currently runnable. [UPDATE: fixed in changes 180963 and 181072: now runnable on lii3gc and lii6gc.]

Also, it doesn't register its threads' stacks as roots. [UPDATE: fixed in change 181076: this immediately reproduced job003412.]

The bug was in MutatorFaultContextSP in primci3li.c (the function that gets the stack pointer from the mutator fault context). However it would be useful to cover more of the functions in this module.

RB suggested that it might be possible to reuse some of the code from zcoll.c, but in fact this was unnecessary: simply registering the threads' stacks as roots causes this assertion to go off:

    MPS ASSERTION FAILURE: base != NULL
    trace.c
    1532
How foundinspection
EvidenceSee job003412.
Observed in1.110.0
Created byGareth Rees
Created on2013-02-25 15:15:05
Last modified byGareth Rees
Last modified on2013-03-08 11:42:44
History2013-02-25 GDR Created.
2013-03-07 GDR More analysis and description of fix.

Fixes

Change Effect Date User Description
181076 closed 2013-03-07 14:53:31 Gareth Rees The amcssth test case now registers its threads' stacks as roots with the MPS.
181074 open 2013-03-07 14:33:32 Gareth Rees Build amcssth test case on OS X (xci6ll).
181073 open 2013-03-07 14:32:40 Gareth Rees Add testlib_unused(argc) where necessary, so that test cases build on xci6ll.
181072 open 2013-03-07 14:03:00 Gareth Rees Make amcssth test case runnable on platforms that use gnumake.
180963 open 2013-02-20 13:35:23 Richard Brooksby Minor tweaks to allow amcssth test to build under lii3gc at least.