Skip to content

Commit 6261053

Browse files
committed
ATRONIX: by Shixin Zeng - Remove free'd serieses from GC_Infants
reported by address sanitizer with manual poisonation: ================================================================= ==11513==ERROR: AddressSanitizer: use-after-poison on address 0x7efe281542c0 at pc 0x00000071038f bp 0x7ffdc9de9330 sp 0x7ffdc9de9328 READ of size 4 at 0x7efe281542c0 thread T0 0 0x71038e in Mark_Series /home/zsx/stuffs/work/r3.git/make/../src/core/m-gc.c:501:6 1 0x70ea8b in Recycle /home/zsx/stuffs/work/r3.git/make/../src/core/m-gc.c:744:4 ...
1 parent 9e2f7ad commit 6261053

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/core/m-pools.c

+6
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,12 @@ const REBPOOLSPEC Mem_Pool_Spec[MAX_POOLS] =
529529

530530
Free_Node(SERIES_POOL, (REBNOD *)series);
531531

532+
/* remove from GC_Infants */
533+
for (n = 0; n < MAX_SAFE_SERIES; n++) {
534+
if (GC_Infants[n] == series)
535+
GC_Infants[n] = NULL;
536+
}
537+
532538
/* Old torture mode:
533539
if (!SERIES_FREED(series)) { // Don't try to free twice.
534540
MUNG_CHECK(SERIES_POOL, (REBNOD *)series, Mem_Pools[SERIES_POOL].wide);

0 commit comments

Comments
 (0)