Bug #80555 Compiler crash on EL 7 with GA source RPM
Submitted: 29 Feb 2016 11:32 Modified: 3 Mar 2016 23:54
Reporter: Jörg Brühe (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S1 (Critical)
Version:5.7.11 OS:CentOS (CentOS 7.0)
Assigned to: Paul DuBois CPU Architecture:Any
Tags: compiler, crash, Enterprise Linux

[29 Feb 2016 11:32] Jörg Brühe
Description:
I cannot rebuild MySQL 5.7.11 from its source RPM on CentOS 7:
The compiler crashes (reproducibly).

This are the relevant log lines:

[ 45%] Building CXX object sql/CMakeFiles/sql.dir/item_geofunc.cc.o
cd /home/joerg/rpmbuild/BUILD/mysql-5.7.11/debug/sql && /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_REPLICATION -DMYSQL_SERVER -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -pipe -Wall   -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -fPIC -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter -Werror -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DENABLED_DEBUG_SYNC -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/debug/include -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/extra/rapidjson/include -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/debug/libbinlogevents/include -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/libbinlogevents/export -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/include -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/sql/conn_handler -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/libbinlogevents/include -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/sql -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/sql/auth -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/regex -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/zlib -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/extra/yassl/include -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/extra/yassl/taocrypt/include -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/debug/sql    -DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/include/boost_1_59_0/patches -I/home/joerg/rpmbuild/BUILD/mysql-5.7.11/boost_1_59_0 -Wno-unused-local-typedefs -o CMakeFiles/sql.dir/item_geofunc.cc.o -c /home/joerg/rpmbuild/BUILD/mysql-5.7.11/mysql-5.7.11/sql/item_geofunc.cc
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [sql/CMakeFiles/sql.dir/item_geofunc.cc.o] Error 4
make[2]: Leaving directory `/RPMBUILD/rpmbuild-70/BUILD/mysql-5.7.11/debug'

I had a similar crash with 5.7.10, in both "debug" and "release" builds.

How to repeat:
1) Take a CentOS 7 (or RedHat or Scientific Linux or Oracle Linux) VM
   with a build environment (gcc, cmake, rpmbuild, ...) installed.

2) Install the MySQL source RPM of 5.7.11 for EL 7
   and all its prerequisites.

3) Call "rpmbuild -ba rpmbuild/SPECS/mysql.spec"
   and let it run until it crashes.

Suggested fix:
Check your build environment for deviations from a stock CentOS 7
(mine is attached as a file):

- If there are any, document them in the spec file and define build requirements.

- If there are none, why did your build succeed and mine fail?
[29 Feb 2016 11:33] Jörg Brühe
"rpm -qa" and related info about my CentOS 7.0 VM

Attachment: Status-cent70 (application/octet-stream, text), 21.97 KiB.

[29 Feb 2016 14:45] Terje Røsten
Building item_geofunc.cc requires lots of memory.

Have much RAM is available in build machine?
[29 Feb 2016 14:49] Jörg Brühe
It is a VM running text mode only (no GUI) and configured with 1 GB memory.
[29 Feb 2016 16:34] Terje Røsten
Increase to at least 2GB RAM, go even higher if it still crashes.
[1 Mar 2016 16:07] MySQL Verification Team
Feedback for: [29 Feb 16:34] Terje Røsten comment
[2 Mar 2016 9:19] Jörg Brühe
The build succeeded after I had changed the VM memory size from 1 GB to 2 GB.

Sorry for the false alarm, I had not expected such a compilation requirement.

I propose to list that requirement in the manual, chapter 2.9 "Installing MySQL from Source", and will try to change this bug report accordingly.
[3 Mar 2016 23:49] Paul DuBois
Seems like it's a stupid compiler that says "internal error, please submit a bug report" when the only problem is that it's out of memory? Or maybe that's precisely the bug, that it fails to report the real issue. :-)
[3 Mar 2016 23:54] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.

Added this item to the system requirements list of the section in question:

Sufficient free memory. If you encounter problems such as "internal
compiler error" when compiling large source files, it may be that you
have too little memory. If compiling on a virtual machine, try
increasing the memory allocation.