public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
@ 2013-10-27  8:25 octoploid at yandex dot com
  2013-10-27  8:30 ` [Bug c++/58893] " octoploid at yandex dot com
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: octoploid at yandex dot com @ 2013-10-27  8:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

            Bug ID: 58893
           Summary: [4.8, 4.9 Regression] <command-line>:0:0: internal
                    compiler error: Segmentation fault
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: octoploid at yandex dot com

Came across this strange segfault:

 ~ % c++ -include ./gcc_hidden.h -include xxx.h -w -march=native
-fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x
-I/usr/include/cairo -pthread -I/usr/include/pango-1.0 -I/usr/include/harfbuzz
-I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/freetype2
-I/usr/include/freetype2 -DNDEBUG -DTRIMMED -O2 -fomit-frame-pointer
minimal.cpp

<command-line>:0:0: internal compiler error: Segmentation fault

gdb shows:
0x0000000000d36791 in linemap_macro_map_lookup(line_maps*, unsigned int) ()
(gdb) bt
#0  0x0000000000d36791 in linemap_macro_map_lookup(line_maps*, unsigned int) ()
#1  0x0000000000d374f5 in linemap_resolve_location(line_maps*, unsigned int,
location_resolution_kind, line_map const**) ()
#2  0x000000000074f5b6 in diagnostic_report_current_module(diagnostic_context*,
unsigned int) ()
#3  0x00000000004d6c50 in cp_diagnostic_starter(diagnostic_context*,
diagnostic_info*) ()
#4  0x0000000000dfc97b in diagnostic_report_diagnostic(diagnostic_context*,
diagnostic_info*) ()
#5  0x0000000000867319 in c_cpp_error(cpp_reader*, int, int, unsigned int,
unsigned int, char const*, __va_list_tag (*) [1]) ()
#6  0x0000000000753a0f in cpp_diagnostic(cpp_reader*, int, int, char const*,
__va_list_tag (*) [1]) ()
#7  0x0000000000753aa3 in cpp_error(cpp_reader*, int, char const*, ...) ()
#8  0x0000000000e01280 in _cpp_find_file ()
#9  0x0000000000e01d3e in _cpp_stack_include ()
#10 0x000000000087414f in push_command_line_include() ()
#11 0x0000000000d36306 in _cpp_lex_token ()
#12 0x0000000000d3a655 in cpp_get_token_with_location(cpp_reader*, unsigned
int*) ()
#13 0x00000000008734a1 in c_lex_with_flags(tree_node**, unsigned int*, unsigned
char*, int) ()
#14 0x0000000000d4ea93 in c_parse_file() ()
#15 0x0000000000d67477 in c_common_parse_file() ()
#16 0x0000000000da7003 in compile_file() ()
#17 0x0000000000da7aba in toplev_main(int, char**) ()
#18 0x00007ffff7772a6e in __libc_start_main () from /lib/libc.so.6
#19 0x0000000000d4117a in _start ()


 ~ % cat gcc_hidden.h
#pragma GCC visibility push(hidden)
 ~ % cat minimal.cpp
int main () {}
 ~ % 

And xxx.h doesn't exist.

4.7.3 is fine. 4.8 and 4.9 segfault.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c++/58893] [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
@ 2013-10-27  8:30 ` octoploid at yandex dot com
  2013-10-29 11:05 ` [Bug preprocessor/58893] [4.8/4.9 " rguenth at gcc dot gnu.org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: octoploid at yandex dot com @ 2013-10-27  8:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

--- Comment #1 from octoploid at yandex dot com ---
gcc with debug info shows:
<command-line>:0:0: internal compiler error: Segmentation fault
0x90321f crash_signal
        ../../gcc/gcc/toplev.c:335
0xd54c15 linemap_macro_map_lookup
        ../../gcc/libcpp/line-map.c:718
0xd54c15 linemap_lookup(line_maps*, unsigned int)
        ../../gcc/libcpp/line-map.c:643
0xd54ecc linemap_macro_loc_to_def_point
        ../../gcc/libcpp/line-map.c:1134
0xd54ecc linemap_resolve_location(line_maps*, unsigned int,
location_resolution_kind, line_map const**)
        ../../gcc/libcpp/line-map.c:1263
0xd3e47d diagnostic_report_current_module(diagnostic_context*, unsigned int)
        ../../gcc/gcc/diagnostic.c:511
0x5728cd cp_diagnostic_starter
        ../../gcc/gcc/cp/error.c:3024
0xd3f0c1 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/gcc/diagnostic.c:791
0x634b14 c_cpp_error(cpp_reader*, int, int, unsigned int, unsigned int, char
const*, __va_list_tag (*) [1])
        ../../gcc/gcc/c-family/c-common.c:9607
0xd49148 cpp_diagnostic
        ../../gcc/libcpp/errors.c:63
0xd49296 cpp_error(cpp_reader*, int, char const*, ...)
        ../../gcc/libcpp/errors.c:78
0xd4e652 _cpp_find_file
        ../../gcc/libcpp/files.c:571
0xd4ebed _cpp_stack_include
        ../../gcc/libcpp/files.c:993
0x6448b5 push_command_line_include
        ../../gcc/gcc/c-family/c-opts.c:1361
0xd50e25 _cpp_get_fresh_line
        ../../gcc/libcpp/lex.c:2121
0xd52e86 _cpp_get_fresh_line
        ../../gcc/libcpp/lex.c:2091
0xd52e86 _cpp_lex_direct
        ../../gcc/libcpp/lex.c:2168
0xd53d0b _cpp_lex_token
        ../../gcc/libcpp/lex.c:2042
0xd582f7 cpp_get_token_1
        ../../gcc/libcpp/macro.c:2355
0x64250c c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
        ../../gcc/gcc/c-family/c-lex.c:300
Please submit a full bug report,

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 18268]
0x0000000000d54e5f in linemap_resolve_location (set=0x7ffff7ff8000,
loc=4294959819, lrk=lrk@entry=LRK_MACRO_DEFINITION_LOCATION,
map=map@entry=0x7fffffffd2d8)
    at ../../gcc/libcpp/line-map.c:1242
1242        loc = set->location_adhoc_data_map.data[loc &
MAX_SOURCE_LOCATION].locus;
(gdb) bt
#0  0x0000000000d54e5f in linemap_resolve_location (set=0x7ffff7ff8000,
loc=4294959819, lrk=lrk@entry=LRK_MACRO_DEFINITION_LOCATION,
map=map@entry=0x7fffffffd2d8)
    at ../../gcc/libcpp/line-map.c:1242
#1  0x0000000000d3e47e in diagnostic_report_current_module
(context=context@entry=0x132bca0 <global_diagnostic_context>, where=<optimized
out>)
    at ../../gcc/gcc/diagnostic.c:511
#2  0x00000000005728ce in cp_diagnostic_starter (context=0x132bca0
<global_diagnostic_context>, diagnostic=0x7fffffffd400) at
../../gcc/gcc/cp/error.c:3024
#3  0x0000000000d3f0c2 in diagnostic_report_diagnostic (context=0x132bca0
<global_diagnostic_context>, diagnostic=diagnostic@entry=0x7fffffffd400)
    at ../../gcc/gcc/diagnostic.c:791
#4  0x0000000000634b15 in c_cpp_error (pfile=pfile@entry=0x13783b0,
level=level@entry=6, reason=reason@entry=0, location=<optimized out>,
location@entry=4294959819, 
    column_override=column_override@entry=0, msg=<optimized out>,
ap=ap@entry=0x7fffffffd4c8) at ../../gcc/gcc/c-family/c-common.c:9607
#5  0x0000000000d49149 in cpp_diagnostic (pfile=0x13783b0, level=6,
reason=reason@entry=0, msgid=msgid@entry=0xd9f9dc "%s: %s",
ap=ap@entry=0x7fffffffd4c8)
    at ../../gcc/libcpp/errors.c:63
#6  0x0000000000d49297 in cpp_error (pfile=<optimized out>, level=<optimized
out>, msgid=msgid@entry=0xd9f9dc "%s: %s") at ../../gcc/libcpp/errors.c:78
#7  0x0000000000d4974c in cpp_errno (pfile=<optimized out>, level=<optimized
out>, msgid=<optimized out>) at ../../gcc/libcpp/errors.c:236
#8  0x0000000000d4e653 in _cpp_find_file (pfile=pfile@entry=0x13783b0,
fname=fname@entry=0x7fffffffe2e3 "xxx.h", start_dir=0x1354970,
fake=fake@entry=false, 
    angle_brackets=angle_brackets@entry=0,
implicit_preinclude=implicit_preinclude@entry=false) at
../../gcc/libcpp/files.c:571
#9  0x0000000000d4ebee in _cpp_stack_include (pfile=0x13783b0,
fname=0x7fffffffe2e3 "xxx.h", angle_brackets=angle_brackets@entry=0,
type=type@entry=IT_CMDLINE)
    at ../../gcc/libcpp/files.c:993
#10 0x0000000000d4f11c in cpp_push_include (pfile=<optimized out>,
fname=<optimized out>) at ../../gcc/libcpp/files.c:1432
#11 0x00000000006448b6 in push_command_line_include () at
../../gcc/gcc/c-family/c-opts.c:1361
#12 0x0000000000d50e26 in _cpp_get_fresh_line (pfile=pfile@entry=0x13783b0) at
../../gcc/libcpp/lex.c:2121
#13 0x0000000000d52e87 in _cpp_get_fresh_line (pfile=0x13783b0) at
../../gcc/libcpp/lex.c:2091
#14 _cpp_lex_direct (pfile=pfile@entry=0x13783b0) at
../../gcc/libcpp/lex.c:2168
#15 0x0000000000d53d0c in _cpp_lex_token (pfile=0x13783b0) at
../../gcc/libcpp/lex.c:2042
#16 0x0000000000d582f8 in cpp_get_token_1 (pfile=0x13783b0,
location=location@entry=0x7fffffffd928) at ../../gcc/libcpp/macro.c:2355
#17 0x0000000000d58615 in cpp_get_token_with_location (pfile=<optimized out>,
loc=loc@entry=0x7fffffffd928) at ../../gcc/libcpp/macro.c:2537
#18 0x000000000064250d in c_lex_with_flags (value=value@entry=0x7fffffffd930,
loc=loc@entry=0x7fffffffd928, cpp_flags=cpp_flags@entry=0x7fffffffd922 "", 
    lex_flags=lex_flags@entry=2) at ../../gcc/gcc/c-family/c-lex.c:300
#19 0x00000000005768b0 in cp_lexer_get_preprocessor_token
(lexer=lexer@entry=0x7ffff72767b0, token=token@entry=0x7fffffffd920) at
../../gcc/gcc/cp/parser.c:751
#20 0x00000000005a4075 in cp_lexer_new_main () at ../../gcc/gcc/cp/parser.c:631
#21 cp_parser_new () at ../../gcc/gcc/cp/parser.c:3378
#22 c_parse_file () at ../../gcc/gcc/cp/parser.c:30996
#23 0x00000000006470a4 in c_common_parse_file () at
../../gcc/gcc/c-family/c-opts.c:1046
#24 0x0000000000903246 in compile_file () at ../../gcc/gcc/toplev.c:546
#25 0x0000000000904dda in do_compile () at ../../gcc/gcc/toplev.c:1893
#26 toplev_main (argc=103, argv=0x7fffffffdaa8) at ../../gcc/gcc/toplev.c:1969
#27 0x00007ffff75fba6e in __libc_start_main () from /lib/libc.so.6
#28 0x00000000005079a1 in _start ()


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
  2013-10-27  8:30 ` [Bug c++/58893] " octoploid at yandex dot com
@ 2013-10-29 11:05 ` rguenth at gcc dot gnu.org
  2013-11-19 10:33 ` rguenth at gcc dot gnu.org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-29 11:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |preprocessor
      Known to work|                            |4.7.3
   Target Milestone|---                         |4.8.3
            Summary|[4.8, 4.9 Regression]       |[4.8/4.9 Regression]
                   |<command-line>:0:0:         |<command-line>:0:0:
                   |internal compiler error:    |internal compiler error:
                   |Segmentation fault          |Segmentation fault


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
  2013-10-27  8:30 ` [Bug c++/58893] " octoploid at yandex dot com
  2013-10-29 11:05 ` [Bug preprocessor/58893] [4.8/4.9 " rguenth at gcc dot gnu.org
@ 2013-11-19 10:33 ` rguenth at gcc dot gnu.org
  2013-11-19 10:36 ` rguenth at gcc dot gnu.org
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-19 10:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2013-11-19
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, I get

g++-4.8 -include ./gcc_hidden.h -include xxx.h -w -march=native
-fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x
-I/usr/include/cairo -pthread -I/usr/include/pango-1.0 -I/usr/include/harfbuzz
-I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/freetype2
-I/usr/include/freetype2 -DNDEBUG -DTRIMMED -O2 -fomit-frame-pointer
minimal.cpp
cc1plus: fatal error: ./gcc_hidden.h: No such file or directory
compilation terminated.

same with trunk.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (2 preceding siblings ...)
  2013-11-19 10:33 ` rguenth at gcc dot gnu.org
@ 2013-11-19 10:36 ` rguenth at gcc dot gnu.org
  2013-11-19 10:37 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-19 10:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
             Status|WAITING                     |NEW

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Err, wrong test file created ... confirmed.  Interestingly trimming more
random target options or include options from

> ./cc1plus -quiet -v -I /usr/include/cairo -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/pixman-1 -I /usr/include/freetype2 -I /usr/include/libdrm -I /usr/include/libpng16 -I /usr/include/freetype2 -I /usr/include/freetype2 -iprefix /home/abuild/rguenther/trunk-g/gcc/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.0/ -isystem ./include -isystem ./include-fixed -D_GNU_SOURCE -D_REENTRANT -D NDEBUG -D TRIMMED -include ./gcc_hidden.h -include xxx.h minimal.cpp -march=corei7 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave   --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192  -quiet  -o /tmp/cceM0oWh.s

"fixes" the crash.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (3 preceding siblings ...)
  2013-11-19 10:36 ` rguenth at gcc dot gnu.org
@ 2013-11-19 10:37 ` rguenth at gcc dot gnu.org
  2014-03-24 16:23 ` jakub at gcc dot gnu.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-19 10:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Running in valgrind shows loads of invalid accesses before the diagnostic
about missing xxx.h.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (4 preceding siblings ...)
  2013-11-19 10:37 ` rguenth at gcc dot gnu.org
@ 2014-03-24 16:23 ` jakub at gcc dot gnu.org
  2014-03-24 19:10 ` mpolacek at gcc dot gnu.org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-24 16:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
MALLOC_PERTURB_=225 ./cc1plus -include ./pr58893.h -include xxx.h pr58893.c
-quiet -o /tmp/pr58893.s
reproduces it too.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (5 preceding siblings ...)
  2014-03-24 16:23 ` jakub at gcc dot gnu.org
@ 2014-03-24 19:10 ` mpolacek at gcc dot gnu.org
  2014-03-24 19:44 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-03-24 19:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think this started by r180081.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (6 preceding siblings ...)
  2014-03-24 19:10 ` mpolacek at gcc dot gnu.org
@ 2014-03-24 19:44 ` jakub at gcc dot gnu.org
  2014-05-22  9:02 ` [Bug preprocessor/58893] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-24 19:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
True, although it has been broken (though didn't crash) already around in
r110000:
MALLOC_PERTURB_=225 /usr/src/gcc-test/obj/gcc/cc1plus.110000 -include
./pr58893.h -include xxx.h pr58893.c  -quiet -o /tmp/pr58893.s
<command line>:3947580:58: error: xxx.h: No such file or directory

(note the completely bogus line and column info).

Perhaps open_file_failed should use cpp_error_with_line instead of cpp_errno,
at least when invoked from within _cpp_find_file/_cpp_stack_include with type
== IT_CMDLINE (or IT_DEFAULT?), because pfile->cur_token[0] as well as
pfile->cur_token[-1] points to uninitialized memory at that point.

Tom/Dodji, any thoughts on this?


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9/4.10 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (7 preceding siblings ...)
  2014-03-24 19:44 ` jakub at gcc dot gnu.org
@ 2014-05-22  9:02 ` rguenth at gcc dot gnu.org
  2014-09-24 10:12 ` [Bug preprocessor/58893] [4.8/4.9/5 " bernd.edlinger at hotmail dot de
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-05-22  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.3                       |4.8.4

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 4.8.3 is being released, adjusting target milestone.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9/5 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (8 preceding siblings ...)
  2014-05-22  9:02 ` [Bug preprocessor/58893] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
@ 2014-09-24 10:12 ` bernd.edlinger at hotmail dot de
  2014-09-26 11:24 ` trippels at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: bernd.edlinger at hotmail dot de @ 2014-09-24 10:12 UTC (permalink / raw)
  To: gcc-bugs

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

Bernd Edlinger <bernd.edlinger at hotmail dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernd.edlinger at hotmail dot de

--- Comment #10 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
Created attachment 33546
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33546&action=edit
possible fix

Hi,

I have looked at this issue, and think this is the right fix.

Regarding the hunk in cpp_diagnostic, which is not directly involved
in this bug, but still obviously wrong:

The line "src_loc = pfile->cur_run->prev->limit->src_loc"
is probably unreachable, but will crash it is ever executed.

see:

_cpp_init_tokenrun (tokenrun *run, unsigned int count)
{
  run->base = XNEWVEC (cpp_token, count);
  run->limit = run->base + count;
  run->next = NULL;
}

limit points at the end of the run, prev is uninitialized.

Comments?


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9/5 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (9 preceding siblings ...)
  2014-09-24 10:12 ` [Bug preprocessor/58893] [4.8/4.9/5 " bernd.edlinger at hotmail dot de
@ 2014-09-26 11:24 ` trippels at gcc dot gnu.org
  2014-09-30 16:09 ` edlinger at gcc dot gnu.org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-26 11:24 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trippels at gcc dot gnu.org

--- Comment #11 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Bernd Edlinger from comment #10)
> Created attachment 33546 [details]
> possible fix
> 
> Hi,
> 
> I have looked at this issue, and think this is the right fix.
> 
> Regarding the hunk in cpp_diagnostic, which is not directly involved
> in this bug, but still obviously wrong:
> 
> The line "src_loc = pfile->cur_run->prev->limit->src_loc"
> is probably unreachable, but will crash it is ever executed.
> 
> see:
> 
> _cpp_init_tokenrun (tokenrun *run, unsigned int count)
> {
>   run->base = XNEWVEC (cpp_token, count);
>   run->limit = run->base + count;
>   run->next = NULL;
> }
> 
> limit points at the end of the run, prev is uninitialized.
> 
> Comments?

Looks good to me, but please post it to the gcc-patches mailing list.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9/5 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (10 preceding siblings ...)
  2014-09-26 11:24 ` trippels at gcc dot gnu.org
@ 2014-09-30 16:09 ` edlinger at gcc dot gnu.org
  2014-10-01  7:37 ` [Bug preprocessor/58893] [4.8/4.9 " trippels at gcc dot gnu.org
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: edlinger at gcc dot gnu.org @ 2014-09-30 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from edlinger at gcc dot gnu.org ---
Author: edlinger
Date: Tue Sep 30 16:08:53 2014
New Revision: 215730

URL: https://gcc.gnu.org/viewcvs?rev=215730&root=gcc&view=rev
Log:
2014-09-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>

    PR preprocessor/58893
    * errors.c (cpp_diagnostic): Fix possible out of bounds access.
    * files.c (_cpp_stack_include): Initialize src_loc for IT_CMDLINE.

testsuite:
2014-09-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>

    PR preprocessor/58893
    * gcc.dg/pr58893.c: New test case.
    * gcc.dg/pr58893-0.h: New include.

Added:
    trunk/gcc/testsuite/gcc.dg/pr58893-0.h
    trunk/gcc/testsuite/gcc.dg/pr58893.c
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/libcpp/ChangeLog
    trunk/libcpp/errors.c
    trunk/libcpp/files.c


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (11 preceding siblings ...)
  2014-09-30 16:09 ` edlinger at gcc dot gnu.org
@ 2014-10-01  7:37 ` trippels at gcc dot gnu.org
  2014-12-19 13:24 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-10-01  7:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Backports of your fix would be appreciated.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (12 preceding siblings ...)
  2014-10-01  7:37 ` [Bug preprocessor/58893] [4.8/4.9 " trippels at gcc dot gnu.org
@ 2014-12-19 13:24 ` jakub at gcc dot gnu.org
  2015-06-23  8:13 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:24 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.4                       |4.8.5

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.4 has been released.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.8/4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (13 preceding siblings ...)
  2014-12-19 13:24 ` jakub at gcc dot gnu.org
@ 2015-06-23  8:13 ` rguenth at gcc dot gnu.org
  2015-06-26 19:53 ` [Bug preprocessor/58893] [4.9 " jakub at gcc dot gnu.org
  2015-06-26 20:26 ` jakub at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-23  8:13 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.5                       |4.9.3

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (14 preceding siblings ...)
  2015-06-23  8:13 ` rguenth at gcc dot gnu.org
@ 2015-06-26 19:53 ` jakub at gcc dot gnu.org
  2015-06-26 20:26 ` jakub at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 19:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug preprocessor/58893] [4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault
  2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
                   ` (15 preceding siblings ...)
  2015-06-26 19:53 ` [Bug preprocessor/58893] [4.9 " jakub at gcc dot gnu.org
@ 2015-06-26 20:26 ` jakub at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.3                       |4.9.4


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-06-26 20:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-27  8:25 [Bug c++/58893] New: [4.8, 4.9 Regression] <command-line>:0:0: internal compiler error: Segmentation fault octoploid at yandex dot com
2013-10-27  8:30 ` [Bug c++/58893] " octoploid at yandex dot com
2013-10-29 11:05 ` [Bug preprocessor/58893] [4.8/4.9 " rguenth at gcc dot gnu.org
2013-11-19 10:33 ` rguenth at gcc dot gnu.org
2013-11-19 10:36 ` rguenth at gcc dot gnu.org
2013-11-19 10:37 ` rguenth at gcc dot gnu.org
2014-03-24 16:23 ` jakub at gcc dot gnu.org
2014-03-24 19:10 ` mpolacek at gcc dot gnu.org
2014-03-24 19:44 ` jakub at gcc dot gnu.org
2014-05-22  9:02 ` [Bug preprocessor/58893] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-09-24 10:12 ` [Bug preprocessor/58893] [4.8/4.9/5 " bernd.edlinger at hotmail dot de
2014-09-26 11:24 ` trippels at gcc dot gnu.org
2014-09-30 16:09 ` edlinger at gcc dot gnu.org
2014-10-01  7:37 ` [Bug preprocessor/58893] [4.8/4.9 " trippels at gcc dot gnu.org
2014-12-19 13:24 ` jakub at gcc dot gnu.org
2015-06-23  8:13 ` rguenth at gcc dot gnu.org
2015-06-26 19:53 ` [Bug preprocessor/58893] [4.9 " jakub at gcc dot gnu.org
2015-06-26 20:26 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).