[Aptitude-devel] Bug#794406: g++: Non-deterministic "/usr/include/c++/5/bits/basic_string.h:121:53: internal compiler error: Segmentation fault" when compiling aptitude 0.7-1

Axel Beckert abe at debian.org
Sun Aug 2 18:08:42 UTC 2015

Package: g++
Version: 4:5.2.1-3
Severity: minor
Control: affects -1 src:aptitude

Hi Matthias,

I've just tried to build the upcoming aptitude 0.7-1 inside a pbuilder

I've first recompiled the following source packages with gcc-5/5.2.1-14
respectively g++-5/5.2.1-14 and against libstdc++6/5.2.1-14 and
installed the (necessary) packages built that way:


I then tried to build aptitude_0.7-1.dsc (as currently in aptitude's
debian-sid branch):

nice -n15 dpkg-buildpackage -b -j5
g++ -DHAVE_CONFIG_H -I. -I../../tests -I..  -I.. -I../.. -I../../src -I../../tests -DBOOST_TEST_DYN_LINK -DSRCDIR=\"../../tests\" -D_FORTIFY_SOURCE=2 -I/usr/include -DHELPDIR=\"/usr/share/aptitude\" -DPKGDATADIR=\"/usr/share/aptitude\"  -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -std=c++11 -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include  -I/usr/lib/x86_64-linux-gnu/cwidget -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include     -D_REENTRANT -fno-strict-aliasing -Wall  -c -o test_resolver_costs.o ../../tests/test_resolver_costs.cc
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/stdexcept:39,
                 from /usr/include/c++/5/array:38,
                 from /usr/include/c++/5/tuple:39,
                 from /usr/include/c++/5/functional:55,
                 from /usr/include/c++/5/memory:79,
                 from /usr/include/boost/config/no_tr1/memory.hpp:21,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:27,
                 from /usr/include/boost/smart_ptr/make_shared_object.hpp:16,
                 from /usr/include/boost/smart_ptr/make_shared.hpp:15,
                 from /usr/include/boost/make_shared.hpp:15,
                 from ../../src/generic/apt/aptitude_resolver_cost_types.h:24,
                 from ../../src/generic/apt/aptitude_resolver_cost_settings.h:24,
                 from ../../tests/test_resolver_costs.cc:20:
/usr/include/c++/5/bits/basic_string.h:121:53: internal compiler error: Segmentation fault
  _CharT           _M_local_buf[_S_local_capacity + 1];
0xaa7c1f crash_signal
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
Makefile:825: recipe for target 'test_resolver_costs.o' failed
make[3]: *** [test_resolver_costs.o] Error 1
make[3]: Leaving directory '/tmp/buildd/aptitude-0.7/build-arch/tests'
Makefile:1123: recipe for target 'check-am' failed
make[2]: *** [check-am] Error 2
make[2]: Leaving directory '/tmp/buildd/aptitude-0.7/build-arch/tests'
/bin/sh: 1: ./cppunit_test: not found
debian/rules:38: recipe for target 'override_dh_auto_test' failed
make[1]: *** [override_dh_auto_test] Error 127
make[1]: Leaving directory '/tmp/buildd/aptitude-0.7'
debian/rules:28: recipe for target 'build-arch' failed
make: *** [build-arch] Error 2
dpkg-buildpackage: error: debian/rules build-arch gave error exit status 2

I can confirm that "the bug is not reproducible": If I rerun the same
command again, it builds fine again. And running "g++ -DHAVE_CONFIG_H
-I. -I../../tests -I..  -I.. -I../.. -I../../src -I../../tests
-I/usr/include -DHELPDIR=\"/usr/share/aptitude\"
-DPKGDATADIR=\"/usr/share/aptitude\" -g -O2 -fPIE
-fstack-protector-strong -Wformat -Werror=format-security -std=c++11
-I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include
-I/usr/lib/x86_64-linux-gnu/cwidget -I/usr/include/sigc++-2.0
-I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -D_REENTRANT
-fno-strict-aliasing -Wall -c -o test_resolver_costs.o
../../tests/test_resolver_costs.cc" manually immediately after the
segfault worked fine as well.

Reporting it as only minor hence. I can also try to gather more of the
stuff requested in /usr/share/doc/gcc-5/README.Bugs, but only if you
consider this really as a bug and want to try digging into it. (I'm
perfectly fine if you want to postpone investigation of this bug until
after the libstdc++6 transition.)

Hardware on which this was experienced is a Lenovo Thinkpad X250 running
Debian Sid amd64 with kernel "4.1.0-trunk-amd64 #1 SMP Debian
4.1.2-1~exp1 (2015-07-11)" with an Intel(R) Core(TM) i5-5300U CPU @
2.30GHz CPU.

[reportbug-gathered stuff missing due to some recent reportbug
incompatibilities with debian-el. But I'm not writing this report inside
the chroot where this happened anyways.]

More information about the Aptitude-devel mailing list