oliverpierson / PonziScheme

Scheme in C++
0 stars 0 forks source link

seg fault on exit #6

Closed oliverpierson closed 9 years ago

oliverpierson commented 9 years ago

On Ubuntu Trusty64, executed immediately after startup:

loading...
>> [Ctrl+d]
Segmentation fault (core dumped)

All the tests seem to pass.

oliverpierson commented 9 years ago

I think the issue is with bison and in particular expression

yychar != YYEOF

in src/repl/reader.ypp

oliverpierson commented 9 years ago

The seg fault was happening in bison. When yylex() was return 0 to indicate EOF bison wasn't updating yychar to be YYEOF. So the reader loop tried to parse again on input even after input had ended.

This was happening on a vagrant machine with Bison 3.0. Installing Bison 2.3 (as is installed on my macbook) fixed the problem.