From mboxrd@z Thu Jan 1 00:00:00 1970 From: tim@fungible.com To: gcc-gnats@gcc.gnu.org Subject: c++/4212: g++ 3.0.1 crashes when generating dwarf2 records for wxwindows quantize.cpp Date: Mon, 03 Sep 2001 12:46:00 -0000 Message-id: <20010903193710.7590.qmail@sourceware.cygnus.com> X-SW-Source: 2001-09/msg00042.html List-Id: >Number: 4212 >Category: c++ >Synopsis: g++ 3.0.1 crashes when generating dwarf2 records for wxwindows quantize.cpp >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Sep 03 12:46:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: tim@fungible.com >Release: gcc 3.0.1 >Organization: >Environment: Linux Mandrake 6.1 or 6.5 or so. >Description: The following segfault happens on my machine. The bug seems quite sensitive; if I rename the source file from "quantize.cpp" to "x.cpp", the problem goes away. If I remove unused declarations from early in quantize.cpp, the problem goes away. Despite its name, quantize.cpp is preprocessor output. I have both debug and non-debug builds of gcc 3.0.1 on my machine, and the problem happens with both. I have used this build of the compiler to compile numerous other files successfully. If you need me to ask the debugger some specific questions at the failure point, let me know and I'll do it. [tim@fungible /tmp]$ /home/tim/gcc-3.0.1-install/bin/g++ -v -c quantize.cpp -ggdb Reading specs from /home/tim/gcc-3.0.1-install/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs Configured with: ../gcc-3.0.1/configure --prefix=/home/tim/gcc-3.0.1-install --enable-languages=c++ --enable-debug Thread model: single gcc version 3.0.1 /home/tim/gcc-3.0.1-install/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ quantize.cpp -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase quantize.cpp -ggdb -version -o /tmp/ccI7pS87.s GNU CPP version 3.0.1 (cpplib) (i386 Linux/ELF) GNU C++ version 3.0.1 (i686-pc-linux-gnu) compiled by GNU C version 3.0.1. ignoring nonexistent directory "/home/tim/gcc-3.0.1-install/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /home/tim/gcc-3.0.1-install/include/g++-v3 /home/tim/gcc-3.0.1-install/include/g++-v3/i686-pc-linux-gnu /home/tim/gcc-3.0.1-install/include/g++-v3/backward /usr/local/include /home/tim/gcc-3.0.1-install/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include /usr/include End of search list. quantize.cpp:7519: Internal error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. [tim@fungible /tmp]$ ~/gdb-5.0/gdb/gdb /home/tim/gcc-3.0.1-install/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/cc1plus GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... (gdb) run -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ quantize.cpp -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase quantize.cpp -ggdb -version -o /tmp/ccI7pS87.s Starting program: /home/tim/gcc-3.0.1-install/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ quantize.cpp -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase quantize.cpp -ggdb -version -o /tmp/ccI7pS87.s GNU CPP version 3.0.1 (cpplib) (i386 Linux/ELF) GNU C++ version 3.0.1 (i686-pc-linux-gnu) compiled by GNU C version 3.0.1. ignoring nonexistent directory "/home/tim/gcc-3.0.1-install/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /home/tim/gcc-3.0.1-install/include/g++-v3 /home/tim/gcc-3.0.1-install/include/g++-v3/i686-pc-linux-gnu /home/tim/gcc-3.0.1-install/include/g++-v3/backward /usr/local/include /home/tim/gcc-3.0.1-install/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include /usr/include End of search list. Program received signal SIGSEGV, Segmentation fault. gen_type_die (type=0x40a3a000, context_die=0x83bb690) at ../../gcc-3.0.1/gcc/dwarf2out.c:3669 3669 if (TREE_CODE (type) == ARRAY_TYPE) (gdb) where #0 gen_type_die (type=0x40a3a000, context_die=0x83bb690) at ../../gcc-3.0.1/gcc/dwarf2out.c:3669 #1 0x816e091 in retry_incomplete_types () at ../../gcc-3.0.1/gcc/dwarf2out.c:9136 #2 0x81736d2 in dwarf2out_finish () at ../../gcc-3.0.1/gcc/dwarf2out.c:11288 #3 0x80d75d5 in compile_file (name=0xbffffc79 "quantize.cpp") at ../../gcc-3.0.1/gcc/toplev.c:2446 #4 0x80db4c6 in main (argc=36, argv=0xbffff974) at ../../gcc-3.0.1/gcc/toplev.c:4990 #5 0x400364ad in __libc_start_main () from /lib/libc.so.6 #6 0x815b0000 in ?? () Cannot access memory at address 0xe853 (gdb) p type $1 = 0x40a3a000 (gdb) p *type $2 = {common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, int_cst = { common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, rtl = 0x83bf728, int_cst = {low = 6588, high = 39176}}, real_cst = { common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, rtl = 0x83bf728, real_cst = {r = {6588, 39176, 0, 0, 0}}}, string = { common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, rtl = 0x83bf728, length = 6588, pointer = 0x9908
}, complex = {common = { chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, rtl = 0x83bf728, real = 0x19bc, imag = 0x9908}, identifier = {common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, length = 138147624, pointer = 0x19bc
}, decl = {common = { chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, filename = 0x83bf728 "quantize.cpp", linenum = 6588, uid = 39176, size = 0x0, mode = VOIDmode, external_flag = 0, nonlocal_flag = 0, regdecl_flag = 0, inline_flag = 0, bit_field_flag = 0, virtual_flag = 0, ignored_flag = 0, abstract_flag = 0, in_system_header_flag = 0, common_flag = 0, defer_output = 0, transparent_union = 0, static_ctor_flag = 0, static_dtor_flag = 0, artificial_flag = 0, weak_flag = 0, non_addr_const_p = 0, no_instrument_function_entry_exit = 0, no_check_memory_usage = 0, comdat_flag = 0, malloc_flag = 0, no_limit_stack = 0, built_in_class = NOT_BUILT_IN, pure_flag = 0, pointer_depth = 0, non_addressable = 0, user_align = 0, uninlinable = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, lang_flag_7 = 0, u1 = {f = BUILT_IN_ABS, i = 1, a = {align = 1, off_align = 0}}, size_unit = 0x0, name = 0x0, context = 0x402f3d00, arguments = 0x0, result = 0x0, initial = 0x4014d450, abstract_origin = 0x0, assembler_name = 0x0, section_name = 0x0, machine_attributes = 0x0, rtl = 0x40b911c0, live_range_rtl = 0x0, u2 = { f = 0x0, r = 0x0, t = 0x0, i = 0}, vindex = 0x0, pointer_alias_set = -1, lang_specific = 0x0}, type = {common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, values = 0x83bf728, size = 0x19bc, size_unit = 0x9908, attributes = 0x0, uid = 0, precision = 0, mode = VOIDmode, string_flag = 0, no_force_blk_flag = 0, needs_constructing_flag = 0, transparent_union_flag = 0, packed_flag = 0, restrict_flag = 0, pointer_depth = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, user_align = 0, align = 1, pointer_to = 0x0, reference_to = 0x0, symtab = {address = 1076837632, pointer = 0x402f3d00 "\030Ö.@¸7/@\036@\006"}, name = 0x0, minval = 0x0, maxval = 0x4014d450, next_variant = 0x0, main_variant = 0x0, binfo = 0x0, noncopied_parts = 0x0, context = 0x40b911c0, alias_set = 0, lang_specific = 0x0}, list = {common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, purpose = 0x83bf728, value = 0x19bc}, vec = {common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, length = 138147624, a = {0x19bc}}, exp = {common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, complexity = 138147624, operands = { 0x19bc}}, block = {common = {chain = 0x0, type = 0x0, code = LABEL_DECL, side_effects_flag = 0, constant_flag = 0, addressable_flag = 1, volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0, asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0, private_flag = 0, protected_flag = 0, bounded_flag = 0, lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}, handler_block_flag = 0, abstract_flag = 0, block_num = 34536906, vars = 0x19bc, subblocks = 0x9908, supercontext = 0x0, abstract_origin = 0x0}} (gdb) >How-To-Repeat: As above. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="quantize.cpp.bz2" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="quantize.cpp.bz2"