Skip to content

segfault on Fedora 21 and Fedora 22 #8

@calid

Description

@calid

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]▶

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions