[Bug 534880] Re: ICE (segfault) in preprocessor

Bug Watch Updater 534880 at bugs.launchpad.net
Wed Mar 10 01:34:59 UTC 2021


Launchpad has imported 3 comments from the remote bug at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61474.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2014-06-11T12:39:46+00:00 Doko-v wrote:

seen on any version back to 4.4

$ cat a.c 
#include "b.h"
#include "c.h"
$ cat b.h 
# 1 "c.h" 1
$ gcc -E a.c
# 1 "a.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "a.c"
# 1 "b.h" 1
# 1 "c.h" 1
# 1 "b.h" 2
In file included from a.c:1:0:
b.h:1:0: internal compiler error: Segmentation fault
 # 1 "c.h" 1
 ^
Please submit a full bug report,
with preprocessed source if appropriate.


Program received signal SIGSEGV, Segmentation fault.
0x0000000000d990a8 in ?? ()
(gdb) bt
#0  0x0000000000d990a8 in ?? ()
#1  0x0000000000d997e8 in ?? ()
#2  0x0000000000d9a3ab in _cpp_stack_file ()
#3  0x0000000000d9a844 in _cpp_stack_include ()
#4  0x0000000000d92666 in ?? ()
#5  0x0000000000d931e8 in _cpp_handle_directive ()
#6  0x0000000000d9fa1d in _cpp_lex_token ()
#7  0x0000000000da42d0 in ?? ()
#8  0x00000000005d5af8 in preprocess_file(cpp_reader*) ()
#9  0x00000000005d4591 in c_common_init() ()
#10 0x000000000057faee in c_objc_common_init() ()
#11 0x00000000008b4fe7 in toplev_main(int, char**) ()
#12 0x00007ffff69e8ec5 in __libc_start_main (main=0x5526e0 <main>, argc=12, argv=0x7fffffffe5e8, 
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe5d8)
    at libc-start.c:287
#13 0x0000000000552915 in _start ()

Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-
defaults/+bug/534880/comments/3

------------------------------------------------------------------------
On 2014-06-12T09:21:58+00:00 Rguenth wrote:

I think we have a dup of this somewhere

Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-
defaults/+bug/534880/comments/4

------------------------------------------------------------------------
On 2021-03-09T17:04:21+00:00 Matthias Klose wrote:

seen with trunk 20210306

$ gcc-11 -E a.c
# 0 "a.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "a.c"
# 1 "b.h" 1
# 1 "c.h" 1
# 1 "b.h" 2
In file included from a.c:1:
b.h:1: internal compiler error: Segmentation fault
    1 | # 1 "c.h" 1
      | 
0xd041a0 crash_signal
        ../../src/gcc/toplev.c:327
0x11e616c open_file
        ../libcpp/../../src/libcpp/files.c:225
0x165a9ba read_file
        ../libcpp/../../src/libcpp/files.c:770
0x11e62dc _cpp_stack_file
        ../libcpp/../../src/libcpp/files.c:942
0x1684cd2 do_include_common
        ../libcpp/../../src/libcpp/directives.c:853
0x120a24f _cpp_handle_directive
        ../libcpp/../../src/libcpp/directives.c:541
0x1204fa4 _cpp_lex_token
        ../libcpp/../../src/libcpp/lex.c:2809
0x120927f cpp_get_token_1
        ../libcpp/../../src/libcpp/macro.c:2839
0x16841c3 cpp_get_token_with_location(cpp_reader*, unsigned int*)
        ../libcpp/../../src/libcpp/macro.c:3108
0x16841c3 scan_translation_unit
        ../../src/gcc/c-family/c-ppoutput.c:320
0x16841c3 preprocess_file(cpp_reader*)
        ../../src/gcc/c-family/c-ppoutput.c:102
0x167e491 c_common_init()
        ../../src/gcc/c-family/c-opts.c:1195
0x163fb1b lang_dependent_init
        ../../src/gcc/toplev.c:1889
0x163fb1b do_compile
        ../../src/gcc/toplev.c:2186
Please submit a full bug report,
with preprocessed source if appropriate.

Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-
defaults/+bug/534880/comments/5


** Changed in: gcc
       Status: Unknown => New

** Changed in: gcc
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/534880

Title:
  ICE (segfault) in preprocessor

Status in gcc:
  New
Status in gcc-defaults package in Ubuntu:
  Triaged

Bug description:
  gcc dies with segmentation violation on Intrepid and Karmic (didn't
  try others) with the following shell code; this is not an academic
  example but the maximally reduced version of my code:

  echo -e '#include "b.h"\n#include "c.h"' >a.c; echo '# 1 "c.h" 1'
  >b.h; gcc -E a.c

  ProblemType: Bug
  Architecture: i386
  DistroRelease: Ubuntu 8.10
  Package: gcc 4:4.3.1-1ubuntu2
  ProcEnviron:
   PATH=.:/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: gcc-defaults
  Uname: Linux 2.6.27-16-generic i686

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/534880/+subscriptions



More information about the foundations-bugs mailing list