zevv/zForth

crash under Asan

tankf33der opened this issue · 4 comments

$ ./src/linux/zforth forth/core.zf 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==79267==ERROR: AddressSanitizer: SEGV on unknown address 0x631d8c94ff10 (pc 0x716254052c47 bp 0x000000000000 sp 0x7ffeea78de60 T0)
==79267==The signal is caused by a READ memory access.
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer: nested bug in the same thread, aborting.
zevv commented

Can't seem to reproduce, valgrind is also very happy. What's your exact build commands?

$ git diff
diff --git a/src/linux/Makefile b/src/linux/Makefile
index 7cdbf16..1486a35 100644
--- a/src/linux/Makefile
+++ b/src/linux/Makefile
@@ -10,8 +10,8 @@ CC    := $(CROSS)gcc
 VPATH   := ../zforth
 CFLAGS += -I. -I../zforth
 CFLAGS  += -Os -g -std=c89 -ansi -pedantic -MMD
-CFLAGS  += -Wall -Wextra -Werror -Wno-unused-parameter -Wno-clobbered -Wno-unused-result
-LDFLAGS        += -g 
+CFLAGS  += -fsanitize=address -Wall -Wextra -Werror -Wno-unused-parameter -Wno-clobbered -Wno-unused-result
+LDFLAGS        += -fsanitize=address -g 
 
 LIBS   += -lm
$ make clean
$ make

It is not every time asan "issue":

$ ./src/linux/zforth forth/core.zf 
Welcome to zForth, 1035 bytes used
^C
$ ./src/linux/zforth forth/core.zf 
Welcome to zForth, 1035 bytes used
^C
$ ./src/linux/zforth forth/core.zf 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==80885==ERROR: AddressSanitizer: SEGV on unknown address 0x60ef5cd25290 (pc 0x77e7e0b42c47 bp 0x000000000000 sp 0x7fff1f154e60 T0)
==80885==The signal is caused by a READ memory access.
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer: nested bug in the same thread, aborting.
$
zevv commented

Tried this on 3 different machines, but no reproduction, sorry :(

zevv commented

Closing this as "can't reproduce"