Ravenbrook / Projects / Memory Pool System / Issues

Memory Pool System


MPS issue job001455

Title: MPS LO pool: mps_arena_formatted_objects_walk fails with AVER(i < j)
Status: closed
Priority: critical
Assigned user: Richard Kistruck
Product: mps
Organization: Ravenbrook
Description: MPS LO pool: mps_arena_formatted_objects_walk fails with AVER(i < j)

RHSK 2006-06-28
The mps_arena_formatted_objects_walk() call enumerates objects in
all pools. If there is a pool of pool-class LO (leaf-only objects,
see mps_class_lo), the mps_arena_formatted_objects_walk() call will
fail with an assert.

In non-asserting builds (eg. VARIETY=hi), failure mode is infinite
loop in LOWalk, called from mps_arena_formatted_objects_walk.

To reproduce, do this on Mac OS X:
p4 sync /project/mps/branch/2006-05-31/feedback/...@159437
cd code
make -f xcppgc.gmk
cd ../example/hw-gc
./build
Gets:
MPS ASSERTION FAILURE: i < j
poollo.c
465
Analysis: RHSK 2006-06-28
The bug is a simple typo in the second line:
next = (*format->skip)(object);
next = AddrSub(object, format->headerSize);
(which should read "AddrSub(next,...").

It was introduced by change 28076, which was adding
format->headerSize arithmetic to poollo.c to make it support
auto_header formats.

Could a compiler warning have caught this?

Clearly the coverage test locv.c doesn't test this: it should.

RHSK 2006-06-28
Coverage test fixed: call mps_arena_formatted_objects_walk and
check we find the right number of test objects.

Would be nice to:
1. check that other pool classes' coverage tests do test this;
2. quick visual inspection of the diffs around change 28076.
How found: unknown
Evidence: see description.
Observed in: 1.106.2
Introduced in: 1.100.0
Test procedure: none
Created by: Richard Kistruck
Created on: 2006-06-28 14:47:01
Last modified by: Richard Kistruck
Last modified on: 2006-06-28 16:22:17
History: 2006-06-28 RHSK Created.

Fixes

Change Effect Date User Description
159446 closed 2006-06-28 16:22:04 Richard Kistruck MPS LO pool coverage test: in stepper, mark unused args with testlib_unused()
159442 closed 2006-06-28 15:34:07 Richard Kistruck MPS LO pool coverage test: call mps_arena_formatted_objects_walk
and check we find the right number of test objects.
159440 closed 2006-06-28 14:55:51 Richard Kistruck MPS LO pool: correct LOWalk loop increment calculation. Should fix
AVER(i < j) on line 465 when you call mps_arena_formatted_objects_walk
when you have objects in an LO pool.

Generated at 2008-07-21 01:20:27 by $Id: //info.ravenbrook.com/infosys/cgi/issue.cgi#430 $

Copyright © Ravenbrook Limited. This document is provided "as is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this document. You may not duplicate or reproduce this document in any form without the express permission of the copyright holder.

Ravenbrook / Projects / Memory Pool System / Issues