Bug #14420 Core files appear when compiling MySQL with gcc
Submitted: 28 Oct 2005 9:24 Modified: 16 Mar 2009 10:35
Reporter: Oleg Belkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.0.15 OS:Linux (RH AS 4.0, SLES 9 SP1)
Assigned to: Daniel Fischer CPU Architecture:Any

[28 Oct 2005 9:24] Oleg Belkin
Description:
I downloaded the tarball file with MySQL 5.0.15 sources from mysql.org, and tried to compile it on three different Intel (R) architectures (IA-32, EM64T, IA-64) and two Linux operating systems (Redhat AS 4.0, SLES 9 SP1), using gcc compiler(available in these OSes distros).
(6 variants altogether, as you can count: 3 plat X 2 oses X 1 compiler).

I put the sources onto an NFS share, and compiled them using these commands:
<<<
export CC=gcc
export CXX=g++
export CFLAGS=-g
export CXXFLAGS=-g
export BIN_DIR=gcc_gO3

#
# Compile MySQL
#
# (AT is a link to a certain dir on NFS share)
echo Building MySQL...
ulimit -c unlimited
LOG=mysql_cmpl.log
./configure --enable-thread-safe-client \
--enable-local-infile --prefix=/home/AT/bin/MySQL/$BIN_DIR \ 
>> $LOG 2>&1
make >> $LOG 2>&1
make install >> $LOG 2>&1
make clean
make distclean
>>>

So the PROBLEM was that during the compilation, some core files appeared in mysql-5.0.15/dbug and mysql-5.0.15/extra directories. For the case of dbug, they were produced e.g. by factorial utility

So, I would like you to reproduce the problems, and probably fix it. Or maybe I did something wrong?
Maybe I should have tried the specific tar.gz files oriented on RH AS 4.0 and SLES 9 SP1 systems (that can be downloaded from mysql.org). I haven't tried them.
I am also not sure if core files appear, in case MySQL sources are to be put and compiled locally, but not onto NFS share.

How to repeat:
You can use any variant described above, e.g. IA-32 / RH AS 4.0.
[1 Nov 2005 15:31] Valeriy Kravchuk
Thank you for a problem report. I was able to repeat it (partially) on SLES9 with NFS:

vkravchuk@sles9-ia64:~> uname -a
Linux sles9-ia64 2.6.5-7.151-default #1 SMP Fri Mar 18 11:31:21 UTC 2005 ia64 ia64 ia64 GNU/Linux

vkravchuk@sles9-ia64:~> pwd
/users/vkravchuk
vkravchuk@sles9-ia64:~> df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             20480904   6839668  13641236  34% /
tmpfs                  2074784        48   2074736   1% /dev/shm
/dev/sda1               102166      6238     95928   7% /boot/efi
/dev/sda4             40961944     32840  40929104   1% /data0
production:/usersnfs 373057344 303709056  50398048  86% /users
nfssrva:/nfstmp1     588068896   5794528 552402112   2% /nfstmp1
testy:/mirrors/suse  163845696 131791136  23731680  85% /suse

So, as you can see, I am working at the NFS-mounted directory.

After that I had performed tyhe following steps:

gunzip < mysql-5.0.15.tar.gz | tar xvf -
cd mysql-5.0.15/
export CC=gcc
export CXX=g++
export CFLAGS=-g
export CXXFLAGS=-g
ulimit -c unlimited
./configure --prefix=/users/vkravchuk/dbs/5.0-sles9 --enable-thread-safe-client --enable-local-infile
make

All that worked OK, but with numerous WARNING during compile...

vkravchuk@sles9-ia64:~/mysql-5.0.15> ls -l dbug/core
-rw-------  1 vkravchuk vkravchuk 1392640 2005-11-01 15:34 dbug/core
vkravchuk@sles9-ia64:~/mysql-5.0.15> ls -l extra/c*
-rwxr-xr-x  1 vkravchuk vkravchuk 610034 2005-11-01 15:34 extra/charset2html
-rw-r--r--  1 vkravchuk vkravchuk   4391 2005-10-17 03:27 extra/charset2html.c
-rw-r--r--  1 vkravchuk vkravchuk  20824 2005-11-01 15:34 extra/charset2html.o
-rwxr-xr-x  1 vkravchuk vkravchuk 680275 2005-11-01 15:34 extra/comp_err
-rw-r--r--  1 vkravchuk vkravchuk  26412 2005-10-17 03:27 extra/comp_err.c
-rw-r--r--  1 vkravchuk vkravchuk  50240 2005-11-01 15:34 extra/comp_err.o

So, yes, core file was produced in dbug at this platform. Personally I do not think it is a problem at all, because the following command:

make install

worked just OK for me. make clean will clean that core, and that's all. But let somebody check this build process result.

By the way, the other flags may be used (and used on RedHat really) for the official MySQL builds...
[4 Oct 2006 10:21] Sergei Golubchik
See http://lists.mysql.com/internals/33941 for the complete analysys and the solution
[8 Jan 2007 11:53] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17723

ChangeSet@1.2586, 2007-01-08 12:53:01+01:00, df@kahlann.erinye.com +22 -0
  BUG#14420 follow the spirit of Vasil Dimov's patch on internals to make dbug compilation and linking dependent on debugging being configured in
[8 Jan 2007 12:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17725

ChangeSet@1.2365, 2007-01-08 13:04:57+01:00, df@kahlann.erinye.com +22 -0
  BUG#14420 merge to 5.0
  MERGE: 1.1616.2890.1
[8 Jan 2007 12:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17727

ChangeSet@1.2366, 2007-01-08 13:59:39+01:00, df@kahlann.erinye.com +2 -0
  BUG#14420 after-merge fixes for 5.0
[8 Jan 2007 13:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17728

ChangeSet@1.2384, 2007-01-08 14:09:48+01:00, df@kahlann.erinye.com +22 -0
  BUG#14420 merge to 5.1
  MERGE: 1.1810.2362.43
[8 Jan 2007 13:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17730

ChangeSet@1.2385, 2007-01-08 14:48:51+01:00, df@kahlann.erinye.com +10 -0
  BUG#14420 after-merge fixes for 5.1
[27 Jan 2007 21:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/18906

ChangeSet@1.2413, 2007-01-27 22:07:52+01:00, df@kahlann.erinye.com +2 -0
  Build fix for sunfire100b. This can go when BUG#14420 is fixed.
[7 Sep 2007 7:19] Daniel Fischer
Bug#28661 was marked as a duplicate of this bug.
[16 Mar 2009 10:35] Daniel Fischer
Was apparently fixed in dbug at some point.