This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/78970] New: GCC crashes if input file is dash


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78970

            Bug ID: 78970
           Summary: GCC crashes if input file is dash
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: guriev-ns at ya dot ru
  Target Milestone: ---

GCC with an input file as hyphen crashes when it tries to process a C/C++
header. But it perfectly works if the argument is a normal file name (even link
`/dev/stdin`).


mymedia@comp2:/tmp/tmp.kRcQNR9Tky$ ls -A
test.h
mymedia@comp2:/tmp/tmp.kRcQNR9Tky$ cat test.h 
#include <stdlib.h>
mymedia@comp2:/tmp/tmp.kRcQNR9Tky$ /usr/lib/gcc-snapshot/bin/gcc -x c-header -o
/dev/null test.h 
mymedia@comp2:/tmp/tmp.kRcQNR9Tky$ /usr/lib/gcc-snapshot/bin/gcc -x c-header -o
/dev/null /dev/stdin <test.h 
mymedia@comp2:/tmp/tmp.kRcQNR9Tky$ /usr/lib/gcc-snapshot/bin/gcc -x c-header -o
/dev/null - <test.h 
<stdin>:1:0: internal compiler error: Segmentation fault
0xb7364f crash_signal
        ../../src/gcc/toplev.c:333
0x13f275b md5_stream
        ../../src/libiberty/md5.c:158
0x13bcc9d _cpp_save_file_entries
        ../../src/libcpp/files.c:1889
0x13cb44f cpp_write_pch_state(cpp_reader*, _IO_FILE*)
        ../../src/libcpp/pch.c:383
0x6c0cce c_common_write_pch()
        ../../src/gcc/c-family/c-pch.c:186
0x6c0857 c_common_parse_file()
        ../../src/gcc/c-family/c-opts.c:1103
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions.
mymedia@comp2:/tmp/tmp.kRcQNR9Tky$ /usr/lib/gcc-snapshot/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/lib/gcc-snapshot/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
20161231-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs
--enable-languages=c,ada,c++,go,fortran,objc,obj-c++
--prefix=/usr/lib/gcc-snapshot --program-prefix= --enable-shared
--enable-linker-build-id --disable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=yes --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.0.0 20161231 (experimental) [trunk revision 243987] (Ubuntu
20161231-1ubuntu1) 
mymedia@comp2:/tmp/tmp.kRcQNR9Tky$

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]