MPS issue job001455

TitleMPS LO pool: mps_arena_formatted_objects_walk fails with AVER(i < j)
Statusclosed
Priorityessential
Assigned userRichard Kistruck
OrganizationRavenbrook
DescriptionMPS 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
AnalysisRHSK 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 foundunknown
Evidencesee description.
Observed in1.106.2
Introduced in1.100.0
Created byRichard Kistruck
Created on2006-06-28 14:47:01
Last modified byGareth Rees
Last modified on2014-04-12 22:04:44
History2006-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.