Segmentation fault in cc1plus when compiling witty library

Bug #642347 reported by Dmitry Pankratov
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
Medium
Yao Qi
gcc-4.4 (Ubuntu)
Triaged
Medium
Unassigned
gcc-4.5 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: g++-4.4

Ubuntu 10.10 Beta AMD64
g++-4.4: 4.4.4-14ubuntu4

When compiling witty library (either a version from the repositories or the latest from their web site (wt-3.1.5)) gcc compiler crashes with segmentation fault.

The 4.5 version of the compiler does not crash.

Compiler output:
[ 0%] Building CXX object src/CMakeFiles/wt.dir/Wt/WAbstractArea.o
In member function ‘void Wt::WAbstractArea::setResource(Wt::WResource*)’:
cc1plus: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
make[2]: *** [src/CMakeFiles/wt.dir/Wt/WAbstractArea.o] Error 1
make[1]: *** [src/CMakeFiles/wt.dir/all] Error 2
make: *** [all] Error 2

Tags: ice

Related branches

Revision history for this message
Dmitry Pankratov (dremon) wrote :

Isolated test case (fails to compile on the assert statement):

#include <cassert>

template <typename A>
struct Base {
    template <typename T, typename V>
    void foo(T* target, void (V::*method)())
    {
        assert(dynamic_cast<T*>(target));
    }
};

struct C { void foo() {} };

int main()
{
    C c;
    Base<int>().foo(&c, &C::foo);
    return 0;
}

Revision history for this message
Dmitry Pankratov (dremon) wrote :

Further pinpointed to a __PRETTY_FUNCTION__ being a source of the problem for the above shown template construct.

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

thanks for the reduced test case, but I am unable to repruduce this, with or without optimization options.

  g++-4.4 -c -O2 -g foo.cc

succeeds.

Changed in gcc-4.4 (Ubuntu):
status: New → Incomplete
Revision history for this message
Dmitry Pankratov (dremon) wrote :

Try it without -O2 switch.

Revision history for this message
Dmitry Pankratov (dremon) wrote :

I have this under 10.10 AMD64:

g++-4.4 -c foo.cc
In member function ‘void Base<A>::foo(T*, void (V::*)()) [with T = C, V = C, A = int]’:
cc1plus: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.

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

thanks, and confirmed. works on 4.3, 4,5, current trunk and Debian 4.4, so would like to ask linaro to recheck this one.

Changed in gcc-4.4 (Ubuntu):
importance: Undecided → Medium
status: Incomplete → Triaged
Changed in gcc-4.5 (Ubuntu):
importance: Undecided → Medium
status: New → Fix Released
Revision history for this message
Michael Hope (michaelh1) wrote :

Confirmed in plain gcc-linaro-4.4-2010.09-1:

michaelh@crucis:~/+junk/bugs$ ~/toolchains/gcc-linaro-4.4-2010.09-1-x86_64-lucid-cbuild3-orion/bin/g++ -g bug1.cc
In member function ‘void Base<A>::foo(T*, void (V::*)()) [with T = C, V = C, A = int]’:
cc1plus: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

As expected, does not occur in gcc-linaro-4.5-2010.09-1

Michael Hope (michaelh1)
Changed in gcc-linaro:
status: New → Confirmed
importance: Undecided → Medium
Michael Hope (michaelh1)
tags: added: ice
Changed in gcc-linaro:
assignee: nobody → Yao Qi (yao-codesourcery)
Changed in gcc-linaro:
status: Confirmed → Fix Committed
Revision history for this message
Michael Hope (michaelh1) wrote :

Confirmed fixed in gcc-linaro-4-4-2010.10-0

Changed in gcc-linaro:
status: Fix Committed → Fix Released
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.