Bug 65807 - [5/6 Regression] ICE () on powerpc64le-linux-gnu
Summary: [5/6 Regression] ICE () on powerpc64le-linux-gnu
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: 5.0
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2015-04-19 16:43 UTC by Matthias Klose
Modified: 2015-04-20 13:37 UTC (History)
5 users (show)

See Also:
Host:
Target: powerpc64le-linux-gnu
Build:
Known to work: 4.9.2
Known to fail: 5.0
Last reconfirmed: 2015-04-19 00:00:00


Attachments
preprocessed source (34.94 KB, application/x-xz)
2015-04-19 16:43 UTC, Matthias Klose
Details
gcc5-pr65807.patch (307 bytes, patch)
2015-04-20 09:51 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2015-04-19 16:43:06 UTC
Created attachment 35358 [details]
preprocessed source

seen with r222064 on powerpc64le-linux-gnu. trying to reduce using creduce 2.2.1, creduce expands the file to 230% instead of reducing.

$ gcc -g -O -Wformat -Werror=format-security -Wall -Wextra -c stress-cpu.i
stress-cpu.c: In function 'stress_cpu_int8':
stress-cpu.c:772:1: internal compiler error: Segmentation fault
 stress_cpu_int(uint8_t, 8, \
 ^
0x10816cb3 crash_signal
        ../../src/gcc/toplev.c:383
0x102a9fb4 lookup_page_table_entry
        ../../src/gcc/ggc-page.c:659
0x102a9fb4 ggc_set_mark(void const*)
        ../../src/gcc/ggc-page.c:1540
0x103cae37 gt_ggc_mx_addr_table_entry_struct(void*)
        ./gt-dwarf2out.h:515
0x103cb13b gt_ggc_mx(dw_attr_struct&)
        ./gt-dwarf2out.h:296
0x103ca537 void gt_ggc_mx<dw_attr_struct>(vec<dw_attr_struct, va_gc, vl_embed>*)
        ../../src/gcc/vec.h:1098
0x103ca537 gt_ggc_mx_vec_dw_attr_node_va_gc_(void*)
        ./gt-dwarf2out.h:288
0x103ca5f7 gt_ggc_mx_die_struct(void*)
        ./gt-dwarf2out.h:594
0x103ca617 gt_ggc_mx_die_struct(void*)
        ./gt-dwarf2out.h:596
0x103ca537 void gt_ggc_mx<dw_attr_struct>(vec<dw_attr_struct, va_gc, vl_embed>*)
        ../../src/gcc/vec.h:1098
0x103ca537 gt_ggc_mx_vec_dw_attr_node_va_gc_(void*)
        ./gt-dwarf2out.h:288
0x103ca5f7 gt_ggc_mx_die_struct(void*)
        ./gt-dwarf2out.h:594
0x103beae7 ggc_hasher<die_struct*>::ggc_mx(die_struct*)
        ../../src/gcc/hash-table.h:321
0x103beae7 gt_ggc_mx<block_die_hasher>
        ../../src/gcc/hash-table.h:1712
0x103beae7 gt_ggc_mx_hash_table_decl_die_hasher_(void*)
        ./gt-dwarf2out.h:244
0x104da947 ggc_mark_root_tab
        ../../src/gcc/ggc-common.c:81
0x104dac83 ggc_mark_roots()
        ../../src/gcc/ggc-common.c:98
0x102aa9a7 ggc_collect()
        ../../src/gcc/ggc-page.c:2199
Please submit a full bug report,
with preprocessed source if appropriate.

$ gcc -v 
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/powerpc64le-linux-gnu/5/lto-wrapper
Target: powerpc64le-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.1~rc1-0ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=c++98 --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-ppc64el/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-ppc64el --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-ppc64el --with-arch-directory=ppc64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-secureplt --with-cpu=power7 --with-tune=power8 --disable-multilib --enable-multiarch --disable-werror --with-long-double-128 --enable-checking=yes --build=powerpc64le-linux-gnu --host=powerpc64le-linux-gnu --target=powerpc64le-linux-gnu
Thread model: posix
gcc version 5.0.1 20150419 (prerelease) [gcc-5-branch revision 222064] (Ubuntu 5.1~rc1-0ubuntu12)
Comment 1 Markus Trippelsdorf 2015-04-19 16:50:42 UTC
Confirmed.

==22109== Invalid read of size 8
==22109==    at 0x1026F524: lookup_page_table_entry (ggc-page.c:659)
==22109==    by 0x1026F524: ggc_set_mark(void const*) (ggc-page.c:1540)
==22109==    by 0x10390DB7: gt_ggc_mx_addr_table_entry_struct(void*) (gt-dwarf2out.h:515)
==22109==    by 0x103904C7: gt_ggc_mx<dw_attr_struct> (vec.h:1098)
==22109==    by 0x103904C7: gt_ggc_mx_vec_dw_attr_node_va_gc_(void*) (gt-dwarf2out.h:288)
==22109==    by 0x103905A7: gt_ggc_mx_die_struct(void*) (gt-dwarf2out.h:594)
==22109==    by 0x103905C7: gt_ggc_mx_die_struct(void*) (gt-dwarf2out.h:596)
==22109==    by 0x1015F84B: gt_ggc_mx_lang_tree_node(void*) (gt-c-c-decl.h:466)
==22109==    by 0x1015E94F: gt_ggc_mx_lang_tree_node(void*) (gt-c-c-decl.h:540)
==22109==    by 0x1015F45F: gt_ggc_mx_lang_tree_node(void*) (gt-c-c-decl.h:454)
==22109==    by 0x1015E94F: gt_ggc_mx_lang_tree_node(void*) (gt-c-c-decl.h:540)
==22109==    by 0x1015F44F: gt_ggc_mx_lang_tree_node(void*) (gt-c-c-decl.h:453)
==22109==    by 0x1015F42F: gt_ggc_mx_lang_tree_node(void*) (gt-c-c-decl.h:451)
==22109==    by 0x1015EA5F: gt_ggc_mx_lang_tree_node(void*) (gt-c-c-decl.h:275)
==22109==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
Comment 2 Richard Biener 2015-04-20 08:21:12 UTC
Looks like debug related (we GC walk DIEs).
Comment 3 Jakub Jelinek 2015-04-20 09:51:25 UTC
Created attachment 35363 [details]
gcc5-pr65807.patch

Untested obvious fix.  I'd say this is safe even for 5.1 at this point.  Keeping uninitialized garbage in val_entry pointer is undesirable for GC.
Comment 4 Jakub Jelinek 2015-04-20 13:30:33 UTC
Author: jakub
Date: Mon Apr 20 13:30:01 2015
New Revision: 222232

URL: https://gcc.gnu.org/viewcvs?rev=222232&root=gcc&view=rev
Log:
	PR debug/65807
	* dwarf2out.c (add_AT_wide): Clear attr.dw_attr_val.val_entry.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
Comment 5 Jakub Jelinek 2015-04-20 13:31:33 UTC
Author: jakub
Date: Mon Apr 20 13:31:02 2015
New Revision: 222233

URL: https://gcc.gnu.org/viewcvs?rev=222233&root=gcc&view=rev
Log:
	PR debug/65807
	* dwarf2out.c (add_AT_wide): Clear attr.dw_attr_val.val_entry.

Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/dwarf2out.c
Comment 6 Jakub Jelinek 2015-04-20 13:37:37 UTC
Fixed for 5.1+.