gcc SIGSEGV when building Firefox and Thunderbird

Bug #841825 reported by Chris Coulson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Invalid
Medium
gcc-4.6 (Ubuntu)
Fix Released
High
Matthias Klose
Oneiric
Fix Released
High
Matthias Klose

Bug Description

Since the gcc-4.6 update which was just published (4.6.1-9ubuntu1), all Mozilla builds (Firefox and Thunderbird) are failing on i386 because GCC crashes, eg:

https://launchpadlibrarian.net/79032680/buildlog_ubuntu-oneiric-i386.firefox_7.0%7Eb4%2Bbuild2%2Bnobinonly-0ubuntu1_FAILEDTOBUILD.txt.gz.

Additional information coming once I've reproduced this outside of the buildd...

Tags: ftbfs oneiric

Related branches

Revision history for this message
Matthias Klose (doko) wrote :

gcc -c -g -O2 -std=gnu++0x WyciwygChannelChild.ii
/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp: In member function 'virtual nsresult mozilla::net::WyciwygChannelChild::CloseCacheEntry(nsresult)':
/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp:605:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

work around is to build with -O1 instead of -Os, or omitting -g

Changed in gcc-4.6 (Ubuntu Oneiric):
assignee: nobody → Matthias Klose (doko)
importance: Undecided → High
status: New → Confirmed
tags: added: ftbfs oneiric
Revision history for this message
Matthias Klose (doko) wrote :
Revision history for this message
In , Doko-v (doko-v) wrote :

Created attachment 25197
preprocessed source

seen with 4.6 20110903 on i686-linux-gnu, with -Os and -O2, works with -O1 and -O0, works with -Os and -O2 when omitting -g.

The ICE is triggered by the nsrefcnt WyciwygChannelChild::AddRef line, omitting this line doesn't show the ICE.

$ gcc -c -g -O2 -std=gnu++0x WyciwygChannelChild.ii
/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp: In member function 'virtual nsresult mozilla::net::WyciwygChannelChild::CloseCacheEntry(nsresult)':
/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp:605:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

Program received signal SIGSEGV, Segmentation fault.
0x0820cec8 in expand_debug_expr (exp=0xf28c5d50) at ../../gcc-4_6-branch/gcc/cfgexpand.c:2380
2380 enum machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
(gdb) bt
#0 0x0820cec8 in expand_debug_expr (exp=0xf28c5d50) at ../../gcc-4_6-branch/gcc/cfgexpand.c:2380
#1 0x08210208 in expand_debug_locations () at ../../gcc-4_6-branch/gcc/cfgexpand.c:3316
#2 gimple_expand_cfg () at ../../gcc-4_6-branch/gcc/cfgexpand.c:4112
#3 0x08366147 in execute_one_pass (pass=0x8aa5780) at ../../gcc-4_6-branch/gcc/passes.c:1556
#4 0x083663f5 in execute_pass_list (pass=0x8aa5780) at ../../gcc-4_6-branch/gcc/passes.c:1611
#5 0x08434ac5 in tree_rest_of_compilation (fndecl=0xf3447d80) at ../../gcc-4_6-branch/gcc/tree-optimize.c:422
#6 0x085711f9 in cgraph_expand_function (node=0xf3342000) at ../../gcc-4_6-branch/gcc/cgraphunit.c:1576
#7 0x08572f85 in cgraph_expand_all_functions () at ../../gcc-4_6-branch/gcc/cgraphunit.c:1635
#8 cgraph_optimize () at ../../gcc-4_6-branch/gcc/cgraphunit.c:1899
#9 0x08573405 in cgraph_finalize_compilation_unit () at ../../gcc-4_6-branch/gcc/cgraphunit.c:1096
#10 0x0812682b in cp_write_global_declarations () at ../../gcc-4_6-branch/gcc/cp/decl2.c:4000
#11 0x083f800d in compile_file () at ../../gcc-4_6-branch/gcc/toplev.c:591
#12 do_compile () at ../../gcc-4_6-branch/gcc/toplev.c:1900
#13 toplev_main (argc=16, argv=0xffffd6c4) at ../../gcc-4_6-branch/gcc/toplev.c:1963
#14 0x080d018b in main (argc=16, argv=0xffffd6c4) at ../../gcc-4_6-branch/gcc/main.c:36

Revision history for this message
Chris Coulson (chrisccoulson) wrote :
Download full text (4.2 KiB)

We also get a similar crash further in to the build (after adding "MODULE_OPTIMIZE_FLAGS = -O1 -freorder-blocks -fomit-frame-pointer" to netwerk/protocol/wyciwyg/Makefile.in):

c++ -o OfflineCacheUpdateParent.o -c -I../../dist/stl_wrappers -I../../dist/system_wrappers -include /home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/config/gcc_hidden.h -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DSTATIC_EXPORTABLE_JS_API -DOSTYPE=\"Linux2.6\" -DOSARCH=Linux -DEXCLUDE_SKIA_DEPENDENCIES -DCHROMIUM_MOZILLA_BUILD -DOS_LINUX=1 -DOS_POSIX=1 -I/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/content/base/src -I/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/content/events/src -I/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/ipc/chromium/src -I/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/ipc/glue -I../../ipc/ipdl/_ipdlheaders -I/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/uriloader/prefetch -I. -I../../dist/include -I../../dist/include/nsprpub -I/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/obj-i686-linux-gnu/dist/include/nspr -I/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/obj-i686-linux-gnu/dist/include/nss -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -Wno-long-long -g -ffunction-sections -fdata-sections -fno-strict-aliasing -std=gnu++0x -pthread -pipe -DNDEBUG -DTRIMMED -g -Os -freorder-blocks -fomit-frame-pointer -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MF .deps/OfflineCacheUpdateParent.pp /home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/uriloader/prefetch/OfflineCacheUpdateParent.cpp
/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/uriloader/prefetch/OfflineCacheUpdateParent.cpp:55:0: warning: "LOG" redefined [enabled by default]
/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/ipc/chromium/src/base/logging.h:92:0: note: this is the location of the previous definition
/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/uriloader/prefetch/OfflineCacheUpdateParent.cpp: In member function 'virtual nsresult mozilla::docshell::OfflineCacheUpdateParent::ApplicationCacheAvailable(nsIApplicationCache*)':
/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/uriloader/prefetch/OfflineCacheUpdateParent.cpp:175:56: warning: ignoring return value of 'bool mozilla::docshell::POfflineCacheUpdateParent::SendAssociateDocuments(const nsCString&, const nsCString&)', declared with attribute warn_unused_result [-Wunused-result]
/home/chrisccoulson/src/firefox/firefox-7.0~b4+build2+nobinonly/build-tree/mozilla/uriloader/prefetch/OfflineCacheUpd...

Read more...

Revision history for this message
In , Doko-v (doko-v) wrote :

caused by

r178482 | jamborm | 2011-09-02 16:30:34 +0200 (Fri, 02 Sep 2011) | 10 lines

2011-09-02 Martin Jambor <email address hidden>

        PR middle-end/49886
        * ipa-split.c (split_function): Do not skip any arguments if
        can_change_signature is set or there are function type attributes.

        * testsuite/gcc.c-torture/execute/pr49886.c: New testcase.
        * testsuite/gfortran.fortran-torture/compile/pr50260.f90: Likewise.

Changed in gcc:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.6 - 4.6.1-9ubuntu2

---------------
gcc-4.6 (4.6.1-9ubuntu2) oneiric; urgency=low

  * Revert fix for PR middle-end/49886, causing PR middle-end/50295.
    LP: #841825.
 -- Matthias Klose <email address hidden> Mon, 05 Sep 2011 18:08:32 +0200

Changed in gcc-4.6 (Ubuntu Oneiric):
status: Confirmed → Fix Released
Revision history for this message
In , Rguenth (rguenth) wrote :

Confirmed. Reducing (I think it's a dup).

Revision history for this message
In , Jakub-gcc (jakub-gcc) wrote :

We have:
<bb 4>:
# DEBUG this => this_2(D)
reason_15 = reason_10(D);
reason_17 = reason_15;
# DEBUG reason => reason_17
D.137092_16 = &this_2(D)->D.122214;
mozilla::net::PWyciwygChannelChild::Send__delete__ (D.137092_16);
D.132395_6 = 0;

and ccp (substitute_and_fold called from ccp_finalize) decides (because has_zero_uses is true for reason_17) to remove reason_17 = reason_15; stmt first, which during gsi_remove adds a # DEBUG D#xxx => reason_15 stmt.
Then reason_15 = reason_10(D); is being removed, but for some reason the newly added debug stmt isn't found during FOR_EACH_IMM_USE_FAST for reason_15.

Revision history for this message
In , Rguenth (rguenth) wrote :

That would be the case if we're missing an update_stmt on the debug stmt.

Revision history for this message
In , Rguenth (rguenth) wrote :

Because gimple_build_debug_bind_stat does not set the stmt to modified? So
it's not automatically updated on gsi_insert_before ().

Revision history for this message
In , Jakub-gcc (jakub-gcc) wrote :

It is gimple_modified_p and gsi_insert_before does call build_stmt_operands on it. Still debugging...

Revision history for this message
In , Rguenth (rguenth) wrote :

Created attachment 25201
reduced testcase

Revision history for this message
In , Jamborm (jamborm) wrote :

I have reverted the patch causing this on the 4.6 branch. As far as trunk is concerned, I'll track it in a duplicate of this bug, PR 50287.

*** This bug has been marked as a duplicate of bug 50287 ***

Changed in gcc:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.