MPS issue job003438

Titlearena->serial is always 0
Assigned userGareth Rees
DescriptionThe Arena structure has a member "serial":

    typedef struct mps_arena_s {
      Serial serial;

which is printed in various Describe functions, for example ArenaDescribe in arena.c:

    res = WriteF(stream,
                 "} Arena $P ($U)\n", (WriteFP)arena,

but it is never assigned, so every arena has a serial of 0.
Analysisdesign.mps.arena.static.serial [1] says that "arenaSerial is a static Serial, containing the serial number of the next arena to be created. The serial of any existing arena is less than this." But in fact there's no such variable.

What's going on here? Looking back in time, it seems that arenaSerial and the initialization code for the ->serial member was removed by pekka in change 21849 [2] (when he moved some of the Arena functionality into the Globals structure) but he didn't remove the member from the Arena class.

It seems as though the removal of arenaSerial and the initialization code for arena->serial was deliberate, so the failure to remove the serial member from the arena structure (and the corresponding failure to update the design document and the Describe functions) was probably the oversight. It certainly doesn't make sense to have a serial number that's always 0.
How foundinspection
Evidence[1] <>
[2] <>
Observed in1.110.0
Created byGareth Rees
Created on2013-03-08 23:04:01
Last modified byGareth Rees
Last modified on2013-03-12 15:11:22
History2013-03-08 GDR Created.


Change Effect Date User Description
181121 closed 2013-03-12 15:11:22 Gareth Rees Restore arena serial numbers.