Internal compiler error while building package 'witty'

Bug #647597 reported by Pau Garcia i Quiles on 2010-09-25
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
Medium
Yao Qi
Release Notes for Ubuntu
Undecided
Unassigned
gcc-4.4 (Ubuntu)
High
Canonical Foundations Team
Maverick
High
Matthias Klose

Bug Description

$ lsb_release -rd
Description: Ubuntu maverick (development branch)
Release: 10.10

$ dpkg -l | grep g++
ii g++ 4:4.4.4-1ubuntu2 The GNU C++ compiler
ii g++-4.4 4.4.4-14ubuntu4 The GNU C++ compiler

When I try to backport my package 'witty' to Maverick, I get an ICE from g++. The full buidllog is available from http://launchpadlibrarian.net/56441644/buildlog_ubuntu-maverick-i386.witty_3.1.5-1~maverick~pgquiles1_FAILEDTOBUILD.txt.gz

It happens both on i386 and amd64:
http://launchpadlibrarian.net/56463262/buildlog_ubuntu-maverick-amd64.witty_3.1.5-1~maverick~pgquiles1_FAILEDTOBUILD.txt.gz

Package builds fine on Hardy, Jaunty, Karmic, Lucid and Debian Lenny, and it should build fine on Maverick.

Source package is available from this PPA:
https://edge.launchpad.net/~pgquiles/+archive/wt

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: g++ 4:4.4.4-1ubuntu2
ProcVersionSignature: Ubuntu 2.6.35-22.33-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic i686
Architecture: i386
Date: Sat Sep 25 18:29:40 2010
InstallationMedia: Ubuntu-Server 10.10 "Maverick Meerkat" - Alpha i386 (20100831)
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gcc-defaults

Related branches

Pau Garcia i Quiles (pgquiles) wrote :
bbordwell (benbordwell) wrote :

Thank you for helping to make Ubuntu better.

I am trying to reproduce your bug but when I run 'make' I get this:

/home/ben/witty-2.2.4/src/Wt/WAbstractItemModel.C:504: error: ‘snprintf’ was not declared in this scope
make[2]: *** [src/CMakeFiles/wt.dir/Wt/WAbstractItemModel.o] Error 1
make[1]: *** [src/CMakeFiles/wt.dir/all] Error 2
make: *** [all] Error 2

Any Ideas?

Either way this is an upstream bug and should be handled there, since I am not able to reproduce this at this time could you please forward it upstream? (http://gcc.gnu.org/bugzilla) If you do so please post the link to the new bug report here. Thank you!

Changed in gcc-defaults (Ubuntu):
status: New → Incomplete
Pau Garcia i Quiles (pgquiles) wrote :

bbordwell:

You are trying to build Wt 2.2.4, which is very old and needs some patches to build with recent versions of gcc. Further, it's not the version I reported the bug about.

The bug I reported was when building Wt 3.1.5, which is available from my PPA:

$ dget https://launchpad.net/~pgquiles/+archive/wt/+files/witty_3.1.5-1~maverick~pgquiles1.dsc

Please download and retry.

Matthias Klose (doko) wrote :

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.

please do so

affects: gcc-defaults (Ubuntu) → gcc-4.4 (Ubuntu)
Pau Garcia i Quiles (pgquiles) wrote :
Download full text (3.2 KiB)

Matthias:

I think this is not a gcc bug, as the very same source package can be built on Debian Sid with the very same versions of gcc and Boost (gcc 4.4.4 and Boost 1.42). It might be a bug in Ubuntu-specific patches to gcc.

On Debian Sid:

$ dpkg -l | grep g++
ii g++ 4:4.4.4-2 The GNU C++ compiler
ii g++-4.4 4.4.4-17 The GNU C++ compiler

$ dpkg -l | grep libboost
ii libboost-date-time-dev 1.42.0.1 date-time libraries based on generic programming (default version)
ii libboost-date-time1.42-dev 1.42.0-4 set of date-time libraries based on generic programming concepts
ii libboost-date-time1.42.0 1.42.0-4 set of date-time libraries based on generic programming concepts
ii libboost-dev 1.42.0.1 Boost C++ Libraries development files (default version)
ii libboost-filesystem-dev 1.42.0.1 filesystem operations in C++ (default version)
ii libboost-filesystem1.42-dev 1.42.0-4 filesystem operations (portable paths, iteration over directories, etc) in C++
ii libboost-filesystem1.42.0 1.42.0-4 filesystem operations (portable paths, iteration over directories, etc) in C++
ii libboost-iostreams1.42.0 1.42.0-4 Boost.Iostreams Library
ii libboost-program-options-dev 1.42.0.1 program options library for C++ (default version)
ii libboost-program-options1.42-dev 1.42.0-4 program options library for C++
ii libboost-program-options1.42.0 1.42.0-4 program options library for C++
ii libboost-regex-dev 1.42.0.1 regular expression library for C++ (default version)
ii libboost-regex1.42-dev 1.42.0-4 regular expression library for C++
ii libboost-regex1.42.0 1.42.0-4 regular expression library for C++
ii libboost-serialization1.42-dev 1.42.0-4 serialization library for C++
ii libboost-serialization1.42.0 1.42.0-4 serialization library for C++
ii libboost-signals-dev 1.42.0.1 managed signals and slots library for C++ (default version)
ii libboost-signals1.42-dev 1.42.0-4 managed signals and slots library for C++
ii libboost-signals1.42.0 1.42.0-4 managed signals and slots library for C++
ii libboost-system1.42-dev 1.42.0-4 Operating system (e.g. diagnostics support) library
ii libboost-system1.42.0 1.42.0-4 Operating system (e.g. diagnostics support) library
ii libboost-thread-dev 1.42.0.1 portable C++ multi-threading (default version)
ii libboost-thread1.42-dev 1.42.0-4 portable C++ multi-threading
ii libboost-thread1.42.0 1.42.0-4 portable C++ multi-th...

Read more...

Matthias Klose (doko) wrote :

> I think this is not a gcc bug, as the very same source package
> can be built on Debian Sid with the very same versions of gcc
> and Boost (gcc 4.4.4 and Boost 1.42). It might be a bug in
> Ubuntu-specific patches to gcc.

that's why I was asking for the preprocessed source ...

Pau Garcia i Quiles (pgquiles) wrote :

Oh, I thought you meant I should file a bug with gcc upstream. I'm attaching the preprocessed source file.

To obtain it, in case you want to reproduce with a different gcc or anything, just run:

$ make Wt/WAbstractArea.i

from the 'witty-3.1.5/build-shared/src' directory

Matthias Klose (doko) wrote :

seen with all optimization levels, works with both 4.3 and 4.5, not seen on Debian unstable

cd /build/buildd/witty-3.1.5/build-shared/src && /usr/bin/c++ -Dwt_EXPORTS -DWT_WITH_OLD_INTERNALPATH_API -DWT_THREADED -D_REENTRANT -DBOOST_SPIRIT_THREADSAFE -DHAVE_RASTER_IMAGE -g -O2 -O2 -g -fPIC -I/build/buildd/witty-3.1.5/build-shared -I/build/buildd/witty-3.1.5/src/web -I/build/buildd/witty-3.1.5/src -I/build/buildd/witty-3.1.5/build-shared/src -I/build/buildd/witty-3.1.5/src/Wt/Dbo/backend/amalgamation -I/usr/include/GraphicsMagick -o CMakeFiles/wt.dir/Wt/WAbstractArea.o -c /build/buildd/witty-3.1.5/src/Wt/WAbstractArea.C
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.

Changed in gcc-4.4 (Ubuntu):
importance: Undecided → High
milestone: none → maverick-updates
status: Incomplete → Triaged
Matthias Klose (doko) wrote :

seen on armel too

tags: added: armel toolchain
removed: amd64 apport-bug compiler error g++ gcc i386 ice internal maverick
Matthias Klose (doko) wrote :

on armel:

$ g++ -c -O0 -c WAbstractArea.ii
In member function 'boost::signals::connection Wt::Signal<A1, A2, A3, A4, A5, A6>::connect(T*, void (V::*)()) [with T = Wt::WAbstractArea, V = Wt::WAbstractArea, A1 = Wt::NoClass, A2 = Wt::NoClass, A3 = Wt::NoClass, A4 = Wt::NoClass, A5 = Wt::NoClass, A6 = Wt::NoClass]':
cc1plus: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

Michael Hope (michaelh1) wrote :
Download full text (7.2 KiB)

Confirmed in gcc-linaro-4.4-2010.09-1 on i686. See:
 http://ex.seabright.co.nz/build/gcc-linaro-4.4-2010.09-1/gcc-linaro-4.4-2010.09-1-i686-lucid-cbuild3-scorpius.tar.xz

for a binary build. Note that name=0 in the call to get_fileinfo(). I think this ends up being passed to strcmp() via splay_tree_splay() causing the segfault. This means that the global input_filename is null.

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00688198 in ?? () from /lib/tls/i686/cmov/libc.so.6
(gdb) back
#0 0x00688198 in ?? () from /lib/tls/i686/cmov/libc.so.6
#1 0x086c3387 in splay_tree_splay (sp=0x89208e8, key=144478368) at ../../gcc-linaro-4.4-2010.09-1/libiberty/splay-tree.c:148
#2 0x086c380b in splay_tree_lookup (sp=0x89208e8, key=0) at ../../gcc-linaro-4.4-2010.09-1/libiberty/splay-tree.c:389
#3 0x081204f4 in get_fileinfo (name=0x0) at ../../gcc-linaro-4.4-2010.09-1/gcc/c-lex.c:114
#4 0x0809c3a8 in cxx_make_type (code=RECORD_TYPE) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/lex.c:659
#5 0x0809c401 in make_class_type (code=RECORD_TYPE) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/lex.c:670
#6 0x0805dcb6 in build_ptrmemfunc_type (type=0xb37170d0) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/decl.c:7087
#7 0x0807ad23 in tsubst (t=0xb48a88f0, args=<value optimized out>, complain=tf_error, in_decl=0x0) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/pt.c:9585
#8 0x0807a3f1 in tsubst (t=0xb48a89c0, args=0xb3702c60, complain=tf_error, in_decl=0x0) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/pt.c:9248
#9 0x0807e7c3 in tsubst_arg_types (arg_types=<value optimized out>, args=<value optimized out>, complain=<value optimized out>, in_decl=0x0) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/pt.c:8957
#10 0x0807e704 in tsubst_arg_types (arg_types=<value optimized out>, args=<value optimized out>, complain=<value optimized out>, in_decl=0x0) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/pt.c:8926
#11 0x0807e704 in tsubst_arg_types (arg_types=<value optimized out>, args=<value optimized out>, complain=<value optimized out>, in_decl=0x0) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/pt.c:8926
#12 0x0807e957 in tsubst_function_type (t=0xb4780a90, args=<value optimized out>, complain=tf_error, in_decl=0x0) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/pt.c:9052
#13 0x0807a1ba in tsubst (t=0xb4780a90, args=0xb3702c60, complain=tf_error, in_decl=0x0) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/pt.c:9660
#14 0x08081536 in get_mostly_instantiated_function_type (decl=0xb3e96680) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/pt.c:16102
#15 0x080e7db0 in write_encoding (decl=0xb3e96680) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/mangle.c:703
#16 0x080e7aef in write_local_name (decl=0xb3da2058, ignore_local_scope=<value optimized out>) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/mangle.c:1498
#17 write_name (decl=0xb3da2058, ignore_local_scope=<value optimized out>) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/mangle.c:799
#18 0x080e7d24 in write_encoding (decl=0xb3da2058) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/mangle.c:695
#19 0x080e7e3f in write_mangled_name (decl=0xb3da2058, top_level=<value optimized out>) at ../../gcc-linaro-4.4-2010.09-1/gcc/cp/mangle.c:665
#20 0x080e8ed4 in mangle_decl_string (de...

Read more...

Changed in gcc-linaro:
status: New → Confirmed
importance: Undecided → Medium
bbordwell (benbordwell) wrote :

Pau Garcia i Quiles: ah, yes I added the ppa, but an apt-get source still grabs the old source. O well it looks like someone more experienced with GCC bugs has picked this up anyway.

Changed in gcc-linaro:
assignee: nobody → Yao Qi (yao-codesourcery)
Changed in gcc-4.4 (Ubuntu Maverick):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Michael Hope (michaelh1) on 2010-09-28
tags: added: ice
Yao Qi (yao-codesourcery) wrote :

I get a reduced test case for this bug. Attached here.

segv fault is cause by following code snip in cp/mangle.c

static tree
mangle_decl_string (const tree decl)
{
...
   input_location = DECL_SOURCE_LOCATION (decl); // input_location is ZERO
...
   write_mangled_name (decl, true); // Segv fault is triggers in child
calls.
}

This piece of code is backported from gcc 4.5 to fix GCC PR42748,
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42748

The decl is __PRETTY_FUNCTION__, and input_location on FSF 4.5 is NOT
zero. DECL_SOURCE_LOCATION should return non-zero value for
__PRETTY_FUNCTION__, so that it could be mangled.

Still investigating it.

Yao Qi (yao-codesourcery) wrote :

Patch is in branch lp:~yao-codesourcery/gcc-linaro/4.4-fix-647597. Proposed to merge, and being reviewed.

Changed in gcc-linaro:
status: Confirmed → Fix Committed
Michael Hope (michaelh1) on 2010-10-12
Changed in gcc-linaro:
milestone: none → 4.5-2010.10
Michael Hope (michaelh1) on 2010-10-15
Changed in gcc-linaro:
status: Fix Committed → Fix Released
Steve Langasek (vorlon) on 2011-02-15
Changed in gcc-4.4 (Ubuntu):
status: Triaged → Fix Released
Colin Watson (cjwatson) wrote :

This bug does not need a release note.

Changed in ubuntu-release-notes:
status: New → Invalid
Matthias Klose (doko) wrote :

won't fix in maverick. updated gcc-4.4 packages can be found in the ubuntu-toolchain-r PPA.

Changed in gcc-4.4 (Ubuntu Maverick):
assignee: Canonical Foundations Team (canonical-foundations) → Matthias Klose (doko)
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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