tinycc
tinycc copied to clipboard
segfault on Fedora 21 and Fedora 22
See run4flat/Alien-TinyCC#10 for reference. At first I thought something was broken on my end, but upgrading to Fedora 22 didn't resolve the issue, so I'm thinking this may be a bug somewhere in tcc.
Out of the box make test fails with a segfault on the hello-run
test, same place as detailed in my PR above.
dcali-fedora (exsymtab=) ~/git/tinycc
[✔]▶ ./configure
Binary directory /usr/local/bin
TinyCC directory /usr/local/lib/tcc
Library directory /usr/local/lib
Include directory /usr/local/include
Manual directory /usr/local/share/man
Info directory /usr/local/share/info
Doc directory /usr/local/share/doc/tcc
Target root prefix
Source path /home/dylan.cali/git/tinycc
C compiler gcc
Target OS Linux
CPU x86-64
Big Endian no
gprof enabled no
cross compilers no
use libgcc no
Creating config.mak and config.h
dcali-fedora (exsymtab=) ~/git/tinycc
[✔]▶ make
make: Circular Makefile <- Makefile dependency dropped.
gcc -o tcc.o -c tcc.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
gcc -o libtcc.o -c libtcc.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
gcc -o tccpp.o -c tccpp.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
gcc -o tccgen.o -c tccgen.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
gcc -o tccelf.o -c tccelf.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
gcc -o tccasm.o -c tccasm.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
gcc -o tccrun.o -c tccrun.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
gcc -o tccexsymtab.o -c tccexsymtab.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
gcc -o x86_64-gen.o -c x86_64-gen.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
x86_64-gen.c: In function ‘gtst’:
x86_64-gen.c:1572:15: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!inv == (vtop->c.i != TOK_NE))
^
gcc -o i386-asm.o -c i386-asm.c -DCONFIG_LDDIR="\"lib64\"" -DTCC_TARGET_X86_64 -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
ar rcs libtcc.a libtcc.o tccpp.o tccgen.o tccelf.o tccasm.o tccrun.o tccexsymtab.o x86_64-gen.o i386-asm.o
gcc -o tcc tcc.o libtcc.a -lm -ldl -I. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
make -C lib native
make[1]: Entering directory '/home/dylan.cali/git/tinycc/lib'
mkdir -p x86_64
gcc -c libtcc1.c -o x86_64/libtcc1.o -I.. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -DTCC_TARGET_X86_64
gcc -c alloca86_64.S -o x86_64/alloca86_64.o -I.. -Wall -g -O2 -fno-strict-aliasing -O0 -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -DTCC_TARGET_X86_64
ar rcs ../libtcc1.a x86_64/libtcc1.o x86_64/alloca86_64.o
make[1]: Leaving directory '/home/dylan.cali/git/tinycc/lib'
./texi2pod.pl tcc-doc.texi tcc.pod
pod2man --section=1 --center="Tiny C Compiler" --release=`cat ./VERSION` tcc.pod > tcc.1
makeinfo --no-split --html --number-sections -o tcc-doc.html tcc-doc.texi
makeinfo tcc-doc.texi
dcali-fedora (exsymtab=) ~/git/tinycc
[✔]▶ make test
make: Circular Makefile <- Makefile dependency dropped.
make -C tests test
make[1]: Entering directory '/home/dylan.cali/git/tinycc/tests'
------------ hello-exe ------------
../tcc -B.. -I.. -I.. -I../include ../examples/ex1.c -o hello || (../tcc -vv; exit 1) && ./hello
Hello World
------------ hello-run ------------
../tcc -B.. -I.. -I.. -I../include -run ../examples/ex1.c
Makefile:73: recipe for target 'hello-run' failed
make[1]: *** [hello-run] Segmentation fault (core dumped)
make[1]: Leaving directory '/home/dylan.cali/git/tinycc/tests'
Makefile:331: recipe for target 'test' failed
make: *** [test] Error 2
dcali-fedora (exsymtab= ?) ~/git/tinycc
[2]▶
Just a note that I've (obviously) been away from development since early January. Thank you for this, I'll look into it over the next month or two. Sorry for the slow pace of my work, and thanks for reporting this!
Also, thanks for the note about Alien::TinyCC#10. That distribution does not distribute this fork of tcc, but rather the unmodified version (but, I think, dated back to 2013). The distribution that distributes this fork is called Alien::TinyCCx. :-)
I see your system is 64-bit. I believe that 64-bit systems are giving my fork of tcc some trouble right now. I develop on a 32-bit system, so I haven't seen these crop up just yet. Hopefully these issues have been resolved upstream, but it'll take quite a bit of effort to bring this fork back in line with upstream. After that's done, I'll look at this ticket more closely. Keeping it open for now.
Note I do not have this problem when I run 32-bit Fedora 23 in virtualbox.
@calid I have updated my fork of tinycc to track the latest changes in mob. The new branch is called mobx
. I have gotten this branch to pass all of its tests on 32-bit and 64-bit Ubuntu, and 32-bit Windows. Could you try running the tests on your Fedora box and let me know how it goes? (I've tried running 64-bit Fedora in virtualbox, but something causes it to consistently crash.)