Created attachment 38746 [details] preprocessed file
Created attachment 38747 [details] gcc output from the build crash
* gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) * Ubuntu 16.04 LTS (Xenial) * gcc from the Ubuntu repositories * qt cloned from http://codereview.qt-project.org/qt/qt5 [dev] branch * qt configured with: ./configure -openssl -R . -opensource -confirm-license -nomake tests -verbose -prefix . -nomake examples -no-widgets -force-debug-info * and build with: make module-qtbase Note there's no crash if configured with: ./configure -openssl -R . -opensource -confirm-license -nomake tests -verbose -prefix . -developer-build -qtnamespace TestNamespace -qtlibinfix TestInfix -nomake examples
This happens with OpenSUSE's GCC 5.3.1 too. It does not happen with 6.1.1, so whatever the problem was, it's been solved. I can also confirm that the problem goes away when PCH support is disabled in Qt. Maybe that can help the maintainers a find if there's a patch to backport to the gcc_5_branch.
you need to build and submit the report without precompiled headers. In this form it is not reproducible.
(In reply to Matthias Klose from comment #5) > you need to build and submit the report without precompiled headers. In this > form it is not reproducible. Well, if the segfault only happens if PCH are used, this is impossible.
Might be related to PR63319. Can you please run gcc under gdb to get a backtrace?
cc1plus doesn't stop in gdb, for some reason. Instead, it prints: painting/qdrawhelper.cpp: In function ‘void qt_bitmapblit_quint16(QRasterBuffer*, int, int, const QRgba64&, const uchar*, int, int, int)’: painting/qdrawhelper.cpp:5753:20: internal compiler error: in tree_node_structure_for_code, at tree.c:508 inline static void qt_bitmapblit_quint16(QRasterBuffer *rasterBuffer, ^ Outside of gdb, it prints "Segmentation fault", but doesn't generate a core file nor does systemd-coredump catch this crash, so no postmortem debugging. Any tricks to do that?
(In reply to Thiago Macieira from comment #8) > cc1plus doesn't stop in gdb, for some reason. Instead, it prints: > > painting/qdrawhelper.cpp: In function ‘void > qt_bitmapblit_quint16(QRasterBuffer*, int, int, const QRgba64&, const > uchar*, int, int, int)’: > painting/qdrawhelper.cpp:5753:20: internal compiler error: in > tree_node_structure_for_code, at tree.c:508 > inline static void qt_bitmapblit_quint16(QRasterBuffer *rasterBuffer, > ^ > > Outside of gdb, it prints "Segmentation fault", but doesn't generate a core > file nor does systemd-coredump catch this crash, so no postmortem debugging. > > Any tricks to do that? Yes. Just invoke cc1plus directly. (Add -v to the gcc invocation and then copy & paste the cc1plus command line, that is printed out.
valgrind --track-origins=yes --trace-children=yes g++... will probably also print a backtrace.
(In reply to Markus Trippelsdorf from comment #9) > Yes. Just invoke cc1plus directly. > (Add -v to the gcc invocation and then copy & paste the cc1plus command > line, that is printed out. That's what I've done. cc1plus seems not to crash when run inside gdb.
(In reply to Thiago Macieira from comment #11) > (In reply to Markus Trippelsdorf from comment #9) > > Yes. Just invoke cc1plus directly. > > (Add -v to the gcc invocation and then copy & paste the cc1plus command > > line, that is printed out. > > That's what I've done. cc1plus seems not to crash when run inside gdb. Ah, sorry. It looks like a dup of 63319. *** This bug has been marked as a duplicate of bug 63319 ***
(In reply to Markus Trippelsdorf from comment #10) > valgrind --track-origins=yes --trace-children=yes g++... > will probably also print a backtrace. First error: ==32645== Conditional jump or move depends on uninitialised value(s) ==32645== at 0x7EE1B2: sparseset_bit_p (sparseset.h:147) ==32645== by 0x7EE1B2: mark_pseudo_regno_live(int) (ira-lives.c:301) ==32645== by 0x7EEE40: process_bb_node_lives(ira_loop_tree_node*) (ira-lives.c:1281) ==32645== by 0x7D6276: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1845) ==32645== by 0x7EFB21: ira_create_allocno_live_ranges() (ira-lives.c:1582) ==32645== by 0x7D7BF3: ira_build() (ira-build.c:3461) ==32645== by 0x7D114A: ira (ira.c:5278) ==32645== by 0x7D114A: (anonymous namespace)::pass_ira::execute(function*) (ira.c:5570) ==32645== by 0x879215: execute_one_pass(opt_pass*) (passes.c:2330) ==32645== by 0x879645: execute_pass_list_1(opt_pass*) [clone .constprop.64] (passes.c:2383) ==32645== by 0x879657: execute_pass_list_1(opt_pass*) [clone .constprop.64] (passes.c:2384) ==32645== by 0x879698: execute_pass_list(function*, opt_pass*) (passes.c:2394) ==32645== by 0x62DC8A: cgraph_node::expand() (cgraphunit.c:1896) ==32645== by 0x62EF73: expand_all_functions (cgraphunit.c:2032) ==32645== by 0x62EF73: symbol_table::compile() [clone .part.43] (cgraphunit.c:2385) ==32645== Uninitialised value was created by a heap allocation ==32645== at 0x4C2D12F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==32645== by 0xF33B97: xmalloc (xmalloc.c:147) ==32645== by 0x90E544: sparseset_alloc(unsigned long) (sparseset.c:33) ==32645== by 0x7EFAAF: ira_create_allocno_live_ranges() (ira-lives.c:1574) ==32645== by 0x7D7BF3: ira_build() (ira-build.c:3461) ==32645== by 0x7D114A: ira (ira.c:5278) ==32645== by 0x7D114A: (anonymous namespace)::pass_ira::execute(function*) (ira.c:5570) ==32645== by 0x879215: execute_one_pass(opt_pass*) (passes.c:2330) ==32645== by 0x879645: execute_pass_list_1(opt_pass*) [clone .constprop.64] (passes.c:2383) ==32645== by 0x879657: execute_pass_list_1(opt_pass*) [clone .constprop.64] (passes.c:2384) ==32645== by 0x879698: execute_pass_list(function*, opt_pass*) (passes.c:2394) ==32645== by 0x62DC8A: cgraph_node::expand() (cgraphunit.c:1896) ==32645== by 0x62EF73: expand_all_functions (cgraphunit.c:2032) ==32645== by 0x62EF73: symbol_table::compile() [clone .part.43] (cgraphunit.c:2385) Followed by a lot of similar errors, then ==32645== Use of uninitialised value of size 8 ==32645== at 0x7EE1B7: sparseset_bit_p (sparseset.h:147) ==32645== by 0x7EE1B7: mark_pseudo_regno_live(int) (ira-lives.c:301) ==32645== by 0x7EEBA6: process_bb_node_lives(ira_loop_tree_node*) (ira-lives.c:1106) ==32645== by 0x7D6295: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1845) ==32645== by 0x7EFB21: ira_create_allocno_live_ranges() (ira-lives.c:1582) ==32645== by 0x7D7BF3: ira_build() (ira-build.c:3461) ==32645== by 0x7D114A: ira (ira.c:5278) ==32645== by 0x7D114A: (anonymous namespace)::pass_ira::execute(function*) (ira.c:5570) ==32645== by 0x879215: execute_one_pass(opt_pass*) (passes.c:2330) ==32645== by 0x879645: execute_pass_list_1(opt_pass*) [clone .constprop.64] (passes.c:2383) ==32645== by 0x879657: execute_pass_list_1(opt_pass*) [clone .constprop.64] (passes.c:2384) ==32645== by 0x879698: execute_pass_list(function*, opt_pass*) (passes.c:2394) ==32645== by 0x62DC8A: cgraph_node::expand() (cgraphunit.c:1896) ==32645== by 0x62EF73: expand_all_functions (cgraphunit.c:2032) ==32645== by 0x62EF73: symbol_table::compile() [clone .part.43] (cgraphunit.c:2385) ==32645== Uninitialised value was created by a heap allocation ==32645== at 0x4C2D12F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==32645== by 0xF33B97: xmalloc (xmalloc.c:147) ==32645== by 0x90E544: sparseset_alloc(unsigned long) (sparseset.c:33) ==32645== by 0x7EFAAF: ira_create_allocno_live_ranges() (ira-lives.c:1574) ==32645== by 0x7D7BF3: ira_build() (ira-build.c:3461) ==32645== by 0x7D114A: ira (ira.c:5278) ==32645== by 0x7D114A: (anonymous namespace)::pass_ira::execute(function*) (ira.c:5570) ==32645== by 0x879215: execute_one_pass(opt_pass*) (passes.c:2330) ==32645== by 0x879645: execute_pass_list_1(opt_pass*) [clone .constprop.64] (passes.c:2383) ==32645== by 0x879657: execute_pass_list_1(opt_pass*) [clone .constprop.64] (passes.c:2384) ==32645== by 0x879698: execute_pass_list(function*, opt_pass*) (passes.c:2394) ==32645== by 0x62DC8A: cgraph_node::expand() (cgraphunit.c:1896) ==32645== by 0x62EF73: expand_all_functions (cgraphunit.c:2032) ==32645== by 0x62EF73: symbol_table::compile() [clone .part.43] (cgraphunit.c:2385) Later: ==32645== More than 100 errors detected. Subsequent errors ==32645== will still be recorded, but in less detail than before. Unlike in PR63319, valgrind showed no "Invalid read" or write.
(In reply to Markus Trippelsdorf from comment #12) > (In reply to Thiago Macieira from comment #11) > > (In reply to Markus Trippelsdorf from comment #9) > > > Yes. Just invoke cc1plus directly. > > > (Add -v to the gcc invocation and then copy & paste the cc1plus command > > > line, that is printed out. > > > > That's what I've done. cc1plus seems not to crash when run inside gdb. > > Ah, sorry. It looks like a dup of 63319. > > *** This bug has been marked as a duplicate of bug 63319 *** That might be, but bug 63319 is closed as WORKSFORME. Any recourse possible?
All these bogus valgrind warnings can be suppressed if you configure gcc with --enable-valgrind-annotations.
(In reply to Markus Trippelsdorf from comment #15) > All these bogus valgrind warnings can be suppressed if you configure gcc > with --enable-valgrind-annotations. That's good to know, but Valgrind didn't report a single erroneous access. And since there's no actual crash when run inside gdb, I don't think valgrind will help further. If I put a breakpoint on tree.c:508 (the line reported in the output), I get: #0 tree_node_structure_for_code (code=30240) at ../../gcc/tree.c:508 #1 tree_node_structure (t=t@entry=0x7ffff3e27438) at ../../gcc/tree.c:3370 #2 0x0000000000545080 in gt_ggc_mx_lang_tree_node (x_p=<optimized out>) at ./gt-cp-tree.h:243 #3 0x00000000007188c6 in ggc_mark_root_tab (rt=0x10b9d08 <gt_ggc_r_gt_i386_h+40>) at ../../gcc/ggc-common.c:81 #4 0x0000000000718b91 in ggc_mark_roots () at ../../gcc/ggc-common.c:98 #5 0x00000000005d1280 in ggc_collect () at ../../gcc/ggc-page.c:2199 #6 0x000000000087931f in execute_one_pass (pass=pass@entry=0x19920e0) at ../../gcc/passes.c:2371 #7 0x0000000000879646 in execute_pass_list_1 (pass=0x19920e0) at ../../gcc/passes.c:2383 #8 0x0000000000879658 in execute_pass_list_1 (pass=0x1991d20, pass@entry=0x1991c60) at ../../gcc/passes.c:2384 #9 0x0000000000879699 in execute_pass_list (fn=0x7ffff2f479d8, pass=0x1991c60) at ../../gcc/passes.c:2394 #10 0x000000000062dc8b in cgraph_node::expand (this=this@entry=0x7ffff2f45498) at ../../gcc/cgraphunit.c:1896 #11 0x000000000062ef74 in expand_all_functions () at ../../gcc/cgraphunit.c:2032 #12 symbol_table::compile (this=this@entry=0x100478d300) at ../../gcc/cgraphunit.c:2385 #13 0x0000000000630410 in symbol_table::compile (this=0x100478d300) at ../../gcc/timevar.h:110 #14 symbol_table::finalize_compilation_unit (this=0x100478d300) at ../../gcc/cgraphunit.c:2462 #15 0x00000000004ce4d3 in cp_write_global_declarations () at ../../gcc/cp/decl2.c:4849 #16 0x000000000091d763 in compile_file () at ../../gcc/toplev.c:613 #17 0x000000000045f095 in do_compile () at ../../gcc/toplev.c:2067 #18 toplev::main (this=this@entry=0x7fffffffd040, argc=argc@entry=84, argv=argv@entry=0x7fffffffd148) at ../../gcc/toplev.c:2165 #19 0x000000000045fd8a in main (argc=84, argv=0x7fffffffd148) at ../../gcc/main.c:39 It crashes after this.