MPS issue job003302

Titlemps_arena_create fails with deep consistency checks
Statusclosed
Priorityoptional
Assigned userRichard Brooksby
OrganizationRavenbrook
Descriptionmps_arena_create fails when CHECKLEVEL is set to CheckLevelDEEP. CheckLevelDEEP isn't currently built in any variety, or documented, but it's a useful tool that we ought to maintain.
AnalysisDeep recursive consistency checking does not allow the MPS to start. The MPS fails to bootstrap because some functions check the Arena is initialized before it is.
How foundunknown
Evidence<http://info.ravenbrook.com/mail/2012/09/03/13-08-10/0/>

rb@silverbird$ cd version/1.110/code
rb@silverbird$ cc -DCONFIG_VAR_COOL -DCHECKLEVEL=CheckLevelDEEP amcss.c testlib.c fmtdy.c fmtdytst.c fmtno.c mps.c
rb@silverbird$ gdb a.out
GNU gdb 6.3.50-20050815 (Apple version gdb-1820) (Sat Jun 16 02:40:11 UTC 2012)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done

(gdb) run
Starting program: /Volumes/Silverbird HD/Local/Users/rb/p4/ravenbrook/mps/version/1.110/code/a.out
Reading symbols for shared libraries +............................. done
randomize(): choosing initial state (v3): 1145388922.

MPS ASSERTION FAILURE: ((Size)1 << arena->zoneShift) >= arena->alignment
./arena.c
129

RECENT EVENTS:
000000000000A2FB0000A2FBFB620E2E VMCreate 00000001000FE000 0000000100200000 00000001003F4000
000000000000A2FB0000A2FBFB603FCE VMCreate 00000001000FC000 00000001000FD000 00000001000FE000
000000000000A2FB0000A2FBFB61CDE4 PoolInit 00000001000FD328 00000001000FD000 00000001000AF6D0
000000000000A2FB0000A2FBFB624ED8 VMMap 00000001000FE000 0000000100200000 0000000100201000
000000000000A2FB0000A2FBFB607373 VMMap 00000001000FC000 00000001000FD000 00000001000FE000
000000000000A2FB0000A2FBFB619B35 Label 00000001000AF6D0 0000000000000002
000000000000A2FB0000A2FBFB619922 Intern 0000000000000002 Reservoir
000000000000A2FB0000A2FBFB5F24B1 Intern 0000000000000001 @(#)Ravenbrook MPS, product.mps, release/1.110.0, platform.xci6ll, variety.assertastic.logtastic.stats, compiled on Sep 22 2012 11:02:08

Program received signal SIGABRT, Aborted.
0x00007fff8ed6bd46 in __kill ()
(gdb) bt
#0 0x00007fff8ed6bd46 in __kill ()
#1 0x00007fff90301df0 in abort ()
#2 0x0000000100005796 in mps_lib_assert_fail ()
#3 0x00000001000072a3 in ArenaCheck ()
#4 0x0000000100013291 in VMArenaCheck ()
#5 0x0000000100073e53 in VMArenaInit ()
#6 0x0000000100006de3 in ArenaCreateV ()
#7 0x0000000100006d15 in mps_arena_create_v ()
#8 0x0000000100006c6c in mps_arena_create ()
#9 0x0000000100000f4f in main ()
(gdb)
Observed in1.110.0
Created byRichard Brooksby
Created on2012-09-22 11:05:25
Last modified byGareth Rees
Last modified on2014-03-24 09:17:19
History2012-09-22 RB Created

Fixes

Change Effect Date User Description
184924 closed 2014-03-20 23:37:02 Gareth Rees Fix some CheckLevelDEEP assertions:
1. In GlobalsPrepareToDestroy, set arenaGlobals->defaultChain to NULL before calling ChainDestroy, to avoid a failed ChainCheck inside ControlFree.
2. In GlobalsPrepareToDestroy, set arenaGlobals->lock to NULL after destroying it, to avoid a failed LockCheck inside ControlFree.
3. In TraceIdMessagesCreate, set tsMessage[ti] and tMessage[ti] together to avoid a failed TraceIdMessagesCheck inside traceMessageInit.
4. In TracePostStartMessage, set tsMessage[ti] to NULL before calling MessagePost, to avoid a failed TraceStartMessageCheck inside ControlFree.
5. Ditto for TracePostMessage and tMessage[ti].