Title | MMQA test function/45.c failure |
Status | closed |
Priority | nice |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | On platform xci6ll: $ qa run function/45.c % create arena: OK % chain_create: OK % 0 of 100 % ASSERTION FAILED !assert=true !asserttext=setref: to non-data object. ----------------------------------------------------------------------------- FAILED TEST function/45.c harness = 1.0 id = $Id: //info.ravenbrook.com/project/mps/master/test/function/45.c#5 $language = c link = testlib.o newfmt.o summary = arena_collect when lots of APs are in mid-cycle SPECIFIED RESULTS completed = yes MMQA OPTIONS MPS_INCLUDE_DIR = ../code MPS_LINK_OBJ = ../code/xci6ll/cool/mps.o MPS_PRODUCT = mps PLATFORM = Darwin_13.4.0_i386__unix RESULTS assert = true asserttext = setref: to non-data object. seconds = 0 CONCLUSION FAIL failed on completed: wanted = yes, was absent |
Analysis | It seems that that the object in p[i] died after it was committed, even though it should have been kept alive by the reference in ambig[i] which is on the stack. But ambig[i] was written to but never read, and so it seems that the compiler was free to optimize it away! Putting in a read to ambig[i] prevents this optimization and allows the test case to pass. Test function/45.c is based on function/12.c and there's a worse problem in the latter: there are no ambiguous references keeping alive the objects being reserved/committed. This breaks the allocation point protocol, but presumably we are getting away with it because there are no collections. |
How found | automated_test |
Evidence | None. |
Test procedure | function/45.c |
Created by | Gareth Rees |
Created on | 2014-10-10 22:09:25 |
Last modified by | Gareth Rees |
Last modified on | 2014-10-20 17:17:52 |
History | 2014-10-10 GDR Created. |
Change | Effect | Date | User | Description |
---|---|---|---|---|
187200 | closed | 2014-10-10 22:14:22 | Gareth Rees | In function/45.c, read from ambig[i] to prevent the compiler from optimizing away the array and so allowing p[i] to die. In function/12.c, add a garbage collection to check that the allocation point protocol is being followed. Ensure there's an ambiguous reference to reserved objects before committin them. |