femtolisp
femtolisp copied to clipboard
fatal error: (make: *** [Makefile:23: test] Segmentation fault
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c ios.c -o ios.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c dirpath.c -o dirpath.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c htable.c -o htable.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c bitvector-ops.c -o bitvector-ops.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c int2str.c -o int2str.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c dump.c -o dump.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c random.c -o random.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c lltinit.c -o lltinit.o
rm -rf libllt.a
ar rs libllt.a bitvector.o hashing.o socket.o timefuncs.o ptrhash.o utf8.o ios.o dirpath.o htable.o bitvector-ops.o int2str.o dump.o random.o lltinit.o
ar: creating libllt.a
make[1]: Leaving directory '/sources/femtolisp/llt'
rm -rf libflisp.a
ar rs libflisp.a flisp.o builtins.o string.o equalhash.o table.o iostream.o
ar: creating libflisp.a
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO -c flmain.c -o flmain.o
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO flisp.o builtins.o string.o equalhash.o table.o iostream.o flmain.o -o flisp llt/libllt.a -lm libflisp.a
cd tests && ../flisp unittest.lsp
fatal error:
(make: *** [Makefile:23: test] Segmentation fault
<DEV> root [ /sources/femtolisp ]# ls
aliases.scm builtins.o equalhash.o flisp.h lib mkboot0.lsp read.c table.o
ascii-mona-lisa compiler.lsp examples flisp.o libflisp.a mkboot1.lsp README.md tests
ascii-mona-lisa-2 cvalues.c flisp flmain.c LICENSE opaque_type_template.c string.c tiny
attic equal.c flisp.boot flmain.o llt opcodes.h string.o todo
bootstrap.sh equalhash.c flisp.boot.bak iostream.c Makefile operators.c system.lsp todo-scrap
builtins.c equalhash.h flisp.c iostream.o Makefile.macosx print.c table.c types.c
<DEV> root [ /sources/femtolisp ]# ./flisp
fatal error:
(Segmentation fault
I have the same problem on Ubuntu 16.04 (gcc 7.2.0):
> make
<snip>
cd tests && ../flisp unittest.lsp
fatal error:
(type-error apply functionSegmentation fault (core dumped)
Makefile:23: recipe for target 'test' failed
make: *** [test] Error 139
Same as above
git checkout flisp.boot && make
Works for me
I think I can reliably reproduce this. After checkout, if you run ./bootstrap.sh, it should cause "flisp.boot" become an empty file. if you then run make, it would cause the crash during test.
𝝺 ./bootstrap.sh
Creating stage 0 boot file...
./bootstrap.sh: 7: ./flisp: not found
Creating stage 1 boot file...
./bootstrap.sh: 11: ./flisp: not found
Testing...
cd tests && ../flisp unittest.lsp
/bin/sh: 1: ../flisp: not found
make: *** [Makefile:23: test] Error 127
~/repo/femtolisp master*
𝝺 make
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO -c flisp.c -o flisp.o
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO -c builtins.c -o builtins.o
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO -c string.c -o string.o
string.c: In function 'fl_string_width':
string.c:56:21: warning: implicit declaration of function 'wcwidth' [-Wimplicit-function-declaration]
int w = wcwidth(*(uint32_t*)cp_data(cp));
^
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO -c equalhash.c -o equalhash.o
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO -c table.c -o table.o
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO -c iostream.c -o iostream.o
cd llt && make
make[1]: Entering directory '/home/kwang/repo/femtolisp/llt'
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c bitvector.c -o bitvector.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c hashing.c -o hashing.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c socket.c -o socket.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c timefuncs.c -o timefuncs.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c ptrhash.c -o ptrhash.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c utf8.c -o utf8.o
utf8.c: In function 'u8_unescape':
utf8.c:191:22: warning: 'ch' may be used uninitialized in this function [-Wmaybe-uninitialized]
dest[0] = (ch>>18) | 0xF0;
^
utf8.c:401:15: note: 'ch' was declared here
u_int32_t ch;
^
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c ios.c -o ios.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c dirpath.c -o dirpath.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c htable.c -o htable.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c bitvector-ops.c -o bitvector-ops.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c int2str.c -o int2str.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c dump.c -o dump.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c random.c -o random.o
gcc -O3 -DNDEBUG -Wall -Wno-strict-aliasing -c lltinit.c -o lltinit.o
rm -rf libllt.a
ar rs libllt.a bitvector.o hashing.o socket.o timefuncs.o ptrhash.o utf8.o ios.o dirpath.o htable.o bitvector-ops.o int2str.o dump.o random.o lltinit.o
ar: creating libllt.a
make[1]: Leaving directory '/home/kwang/repo/femtolisp/llt'
rm -rf libflisp.a
ar rs libflisp.a flisp.o builtins.o string.o equalhash.o table.o iostream.o
ar: creating libflisp.a
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO -c flmain.c -o flmain.o
gcc -O2 -DNDEBUG -falign-functions -Wall -Wno-strict-aliasing -Illt -DUSE_COMPUTED_GOTO flisp.o builtins.o string.o equalhash.o table.o iostream.o flmain.o -o flisp llt/libllt.a -lm libflisp.a
cd tests && ../flisp unittest.lsp
fatal error:
(type-error apply functionSegmentation fault (core dumped)
make: *** [Makefile:23: test] Error 139
I concur,
git clone https://github.com/JeffBezanson/femtolisp
cd femtolisp && ./bootstrap.sh
make
=> segfault
but
git clone https://github.com/JeffBezanson/femtolisp
cd femtolisp
make
=> success