Open rwhitworth opened 7 years ago
Hi, I investigated a bit into this. In src/execution_functions/evaluate.c, in the eval function, the parse invocation returns a null pointer. This is due to the EXPECT_TOKEN invocation in the parse function, which at the end of an invocation expects an EOF token.
I don't know why yet, but )
fails this EOF check while 5
, (+ 3 5)
, and other well-formed inputs don't.
Checking the returned root
variable for NULL in the eval function, and returning some other value instead such as undefined
or "Syntax error"
is the easiest way to fix the segfault. Note that the above log shows the crash at tree-size, this is where the null pointer from parse is dereferenced.
Hello, I was using American Fuzzy Lop (afl-fuzz) to fuzz input to the
huo
program on Linux. Is fixing the crash from this input file something you're interested in? The input file can be found here: https://github.com/rwhitworth/huo-fuzz/tree/master/2017-06-11Its contents is:
The file can be executed as
./huo < id_filename
to cause the segmentation fault.Let me know if I can provide any more information to help narrow down this issue.