MPS issue job003922

TitleFailed arena creation is not correctly unwound
Statusclosed
Priorityoptional
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIn ArenaCreate, the initialization procedure goes like this:

1. class->init
2. ArenaFreeLandInsert
3. ControlInit
4. GlobalsCompleteCreate

but if it fails, the unwind sequence goes:

3. ControlFinish
1. class->finish

That is, there is no unwinding of step 2. This results in the following assertion:

sa.c:41: MPS ASSERTION FAILED: BTIsResRange(sa->mapped, 0, sa->length)
AnalysisCompare with ArenaDestroy, which goes:

3. ControlFinish
2. LandFinish + MFSFinishTracts
1. class->finish

The bug was introduced in change 184783 [1]. It was not caught by review -- it looks as if we need a review checklist. It was not caught by test case because there is no test case for a failed ArenaCreate, and that is because it is very hard to write one (there is nothing that we can pass to mps_arena_create_k that will cause ControlInit to fail). Note that this is a specific instance of job003482.
How foundmanual_test
Evidence[1] https://info.ravenbrook.com/infosys/cgi/perfbrowse.cgi?%40describe+184783
Created byGareth Rees
Created on2015-08-06 18:47:46
Last modified byGareth Rees
Last modified on2016-03-13 00:29:05
History2015-08-06 GDR Created.

Fixes

Change Effect Date User Description
188144 closed 2015-08-14 10:57:06 Gareth Rees Merge branch/2015-08-10/arena-create into the master sources.