Bug #864 gen_lex_hash segfaults when built with GCC 3.3
Submitted: 17 Jul 2003 9:12 Modified: 22 Jul 2003 0:49
Reporter: Sebastian Bergmann Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.1 OS:Linux (GENTOO Linux)
Assigned to: CPU Architecture:Any

[17 Jul 2003 9:12] Sebastian Bergmann
I'm trying to build MySQL 4.1 from the current BitKeeper tree with GCC 3.3. This worked fine last time I tried (last week), but now it fails because the sql/gen_lex_hash utility segfaults. It does not segfault when built with GCC 3.2.3.

Backtrace from GDB is below:

sb@wopr-mobile:/usr/src/mysql-4.1/sql/ > gdb ./gen_lex_hash
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) r
Starting program: /usr/src/mysql-4.1/sql/gen_lex_hash
[New Thread 16384 (LWP 797)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 797)]
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x0805036e in init_variables (options=0x8065710) at my_getopt.c:696
#2  0x0804f418 in handle_options (argc=0xbffff7c0, argv=0xbffff7c4,
    longopts=0x8065680, get_one_option=0x804cbf6 <get_one_option>)
    at my_getopt.c:97
#3  0x0804cc66 in get_options (argc=0, argv=0xbffff838) at gen_lex_hash.cc:364
#4  0x0804cdec in main (argc=-1073743936, argv=0xbffff834)
    at gen_lex_hash.cc:428
#5  0x401c2b47 in __libc_start_main () from /lib/libc.so.6

How to repeat:
$ bk pull
$ ./BUILD/compile-pentium-debug
[17 Jul 2003 10:36] Indrek Siitan
Many of our developers use SuSE 8.2 on their machines, which ships with gcc 3.3, and have no 
problems compiling the source tree - they do it several times every day.

"Linux" is a very wide term, when it comes to issues like this - every distribution has its own 
quirks. What distro (name and version) exactly are you using?
[17 Jul 2003 11:00] Sebastian Bergmann
wopr-mobile root # emerge info
Portage 2.0.48-r1 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)
System uname: 2.4.20-gentoo-r5 i686 Pentium III (Coppermine)
GENTOO_MIRRORS="ftp://trumpetti.atm.tut.fi/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://ftp.fhh.opensource-mirror.de/pub/gentoo.org/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
USE="x86 oss 3dnow apm avi crypt cups encode foomaticdb gif jpeg libg++ mad mikmod mmx mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms zlib gdbm berkdb slang readline arts tetex svga tcltk java guile postgres sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis gtk motif opengl X xv gtk2 gnome kde qt alsa acpi dga directfb apache2"
CFLAGS="-march=pentium3 -O2 -pipe"
CXXFLAGS="-march=pentium3 -O2 -pipe"
FEATURES="sandbox ccache fixpackages"
[18 Jul 2003 14:27] Lenz Grimmer
Thanks for the info - we have received one more report about that from one of our developers and 
are investigating it.
[22 Jul 2003 0:12] Lenz Grimmer
Serg pushed a fix into the 4.1 tree yesterday:

  1.1575 03/07/21 21:13:52 serg@serg.mylan +1 -0
  gen_lex_hash sigsegv fixed

Can you please retry it with a fresh pull?
[22 Jul 2003 0:18] Sebastian Bergmann
Works fine now, thanks.