Bug #10777 ERROR File = sql_lex.cc, Line = 93 The identifier "symbols" is undefined.
Submitted: 20 May 2005 20:55 Modified: 8 Mar 2007 20:39
Reporter: Joerg Behrens Email Updates:
Status: Closed
Category:Server: Compiling Severity:S3 (Non-critical)
Version:Mysql 4.1.12 OS:Other (IRIX 6.5.27)
Assigned to: Magnus Blaudd Target Version:

[20 May 2005 20:55] Joerg Behrens
Description:
Trying to compile on IRIX 6.5.27 with the latest Mips CC Compiler (7.4.3) causes the
following error.

./configure --prefix=/usr/nekoware-build/mysql4 --with-extra-charsets=complex
--enable-thread-safe-client
--with-unix-socket-path=/usr/nekoware-build/var/run/mysql4/mysql.sock 
--disable-dependency-tracking --without-debug
gmake
..
cc-1020 CC: ERROR File = sql_lex.cc, Line = 93
The identifier "symbols" is undefined.
for (i=0 ; i < array_elements(symbols) ; i++)
                                           ^

A previous version of Mysql 4.1.11 compiles fine.

How to repeat:
Compile 4.1.12
[25 May 2005 19:01] [ name withheld ]
I get the following on SCO 5.0.4:

sql_lex.cc: In function `void lex_init()':
sql_lex.cc:93: `symbols' undeclared (first use this function)
sql_lex.cc:93: (Each undeclared identifier is reported only once
sql_lex.cc:93: for each function it appears in.)
sql_lex.cc:95: `sql_functions' undeclared (first use this function)
sql_lex.cc: In function `int find_keyword(LEX *, unsigned int, bool)':
sql_lex.cc:180: implicit declaration of function `int get_hash_symbol(...)'
sql_lex.cc:180: initialization to `SYMBOL *' from `int' lacks a cast

I have compiled other version withour problems.
[4 Jun 2005 16:25] Matthew Lord
Hi Joerg,

Thank you for your bug report!

I could not repeat the problem using the upcoming 4.1.13.  Could you let me know
if you run into the same problem with 4.1.13?

Best Regards
[20 Jun 2005 10:55] Shaun O'Shea
I'm seeing the same compiling 4.1.12 with gcc v3.2.3 on solaris.

<SNIP>
Making all in share
g++ -DMYSQL_SERVER  -DDEFAULT_MYSQL_HOME="\"/usr/local\""  -DDATADIR="\"/usr/local/var\""
 -DSHAREDIR="\"/usr/local/share/mysql\""  -DHAVE_CONFIG_H -I. -I. -I..
-I../innobase/include   -I../include -I../regex  -I.      -O3 -DDBUG_OFF   
-fno-implicit-templates -fno-exceptions -fno-rtti -D_FILE_OFFSET_BITS=64 -DHAVE_CURSES_H
-I/tmp/TEA/mysql-4.1.12/include -DHAVE_RWLOCK_T -c -I../innobase/include   -I../include
-I../regex  -I.  -DTZINFO2SQL mysql_tzinfo_to_sql.cc
/bin/bash ../libtool --preserve-dup-deps --mode=link g++  -O3 -DDBUG_OFF   
-fno-implicit-templates -fno-exceptions -fno-rtti -D_FILE_OFFSET_BITS=64 -DHAVE_CURSES_H
-I/tmp/TEA/mysql-4.1.12/include -DHAVE_RWLOCK_T    -o mysql_tzinfo_to_sql 
mysql_tzinfo_to_sql.o ../myisam/libmyisam.a  ../myisammrg/libmyisammrg.a 
../heap/libheap.a  ../vio/libvio.a  ../mysys/libmysys.a  ../dbug/libdbug.a 
../regex/libregex.a  ../strings/libmystrings.a -lz  -lpthread -lthread -lposix4 -lcrypt
-lgen -lsocket -lnsl -lm  -lpthread -lthread
mkdir .libs
g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti
-D_FILE_OFFSET_BITS=64 -DHAVE_CURSES_H -I/tmp/TEA/mysql-4.1.12/include -DHAVE_RWLOCK_T -o
mysql_tzinfo_to_sql mysql_tzinfo_to_sql.o  ../myisam/libmyisam.a
../myisammrg/libmyisammrg.a ../heap/libheap.a ../vio/libvio.a ../mysys/libmysys.a
../dbug/libdbug.a ../regex/libregex.a ../strings/libmystrings.a -lz -lpthread -lthread
-lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lpthread -lthread
if g++ -DMYSQL_SERVER  -DDEFAULT_MYSQL_HOME="\"/usr/local\"" 
-DDATADIR="\"/usr/local/var\""  -DSHAREDIR="\"/usr/local/share/mysql\""  -DHAVE_CONFIG_H
-I. -I. -I.. -I../innobase/include   -I../include -I../regex  -I.      -O3 -DDBUG_OFF   
-fno-implicit-templates -fno-exceptions -fno-rtti -D_FILE_OFFSET_BITS=64 -DHAVE_CURSES_H
-I/tmp/TEA/mysql-4.1.12/include -DHAVE_RWLOCK_T -MT sql_lex.o -MD -MP -MF
".deps/sql_lex.Tpo" -c -o sql_lex.o sql_lex.cc; \
then mv -f ".deps/sql_lex.Tpo" ".deps/sql_lex.Po"; else rm -f ".deps/sql_lex.Tpo"; exit
1; fi
sql_lex.cc: In function `void lex_init()':
sql_lex.cc:93: `symbols' undeclared (first use this function)
sql_lex.cc:93: (Each undeclared identifier is reported only once for each 
   function it appears in.)
sql_lex.cc:95: `sql_functions' undeclared (first use this function)
sql_lex.cc: In function `int find_keyword(LEX*, unsigned int, bool)':
sql_lex.cc:180: `get_hash_symbol' undeclared (first use this function)
*** Error code 1
make: Fatal error: Command failed for target `sql_lex.o'
Current working directory /tmp/TEA/mysql-4.1.12/sql
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /tmp/TEA/mysql-4.1.12/sql
*** Error code 1
make: Fatal error: Command failed for target `all'
Current working directory /tmp/TEA/mysql-4.1.12/sql
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /tmp/TEA/mysql-4.1.12
*** Error code 1
make: Fatal error: Command failed for target `all'
</SNIP>
[1 Jul 2005 8:23] Alferd Kapka
$ configure && make
[this error occurs]
$ cd sql
$ ./gen_lex_hash > lex_hash.h
$ cd ..
$ make & enjoy:)
[4 Jul 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[5 Jul 2005 10:08] Aleksey Kishkin
reopened
[7 Jul 2005 11:54] Will Givens
I'm receiving the EXACT same error with Mysql-4.1.12 using Compaq C/CXX. My box:
AlphaPC 164 SX
Kernel-2.6.11.6
Compaq C 6.5.9
Make 3.80
Binutils 2.19

Configure Script:
CC="ccache ccc" CXX="ccache cxx" \
        CFLAGS="-O5 -fast -inline speed -migrate -unroll 0 \
         -mtune=ev56 -w -pipe -std -D_BSD_SOURCE" \
        CXXFLAGS="-O5 -fast -inline speed  -mtune=ev56 -w -pipe \
        -std ansi -nousing_std -D__USE_STD_IOSTREAM" \
        ./configure \
        --prefix=/usr \
        --sysconfdir=/etc \
        --build=alphapca56-alpha-linux-gnu \
        --disable-dependency-tracking \
        --without-bench \
        --without-debug \
        --without-lib-ccflags

sed -e '/s/wl=""/wl="-Wl,"/g' libtool > 321.tmp
mv -f 321.tmp libtool
chmod 755 libtool 

make

Error Msg:
ccache cxx -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr\"" -DDATADIR="\"/usr/var\""
-DSHAREDIR="\"/usr/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../innobase/include
-I../include -I../regex -I.     -O3 -DDBUG_OFF -O5 -fast -inline speed  -mtune=ev56 -w
-pipe    -std ansi -nousing_std -D__USE_STD_IOSTREAM   -c -o sql_lex.o sql_lex.cc
cxx: Error: sql_lex.cc, line 93: identifier "symbols" is undefined
  for (i=0 ; i < array_elements(symbols) ; i++)
-----------------^
cxx: Error: sql_lex.cc, line 95: identifier "sql_functions" is undefined
  for (i=0 ; i < array_elements(sql_functions) ; i++)
-----------------^
cxx: Error: sql_lex.cc, line 180: identifier "get_hash_symbol" is undefined
  SYMBOL *symbol = get_hash_symbol((const char *)tok,len,function);
-------------------^
cxx: Error: sql_lex.cc, line 227: identifier "get_hash_symbol" is undefined
  return get_hash_symbol(name,len,0)!=0;
---------^
cxx: Info: 4 errors detected in the compilation of "sql_lex.cc".
make[4]: *** [sql_lex.o] Error 1
[7 Jul 2005 14:38] Will Givens
Well I ran "./gen_lex_hash > lex_hash.h" but first I had to copy the file, gen_lex_hash,
from a Mysql-4.0.x build since it was missing in 4.1.12.

After running I ran 'make' and am now getting the error below:
make[4]: Entering directory `/usr2/www/pub/alpha-RH7/database/mysql/mysql-4.1.12/sql'
ccache cxx -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr\"" -DDATADIR="\"/usr/var\""
-DSHAREDIR="\"/usr/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../innobase/include
-I../include -I../regex -I.     -O3 -DDBUG_OFF -O5 -fast -inline speed  -arch ev56 -w
-pipe     -std ansi -nousing_std -D_BSD_SOURCE   -c -o set_var.o set_var.cc
cxx: Fatal: A memory access violation (bus error or segmentation fault)
has occurred.  Please submit a problem report.
make[4]: *** [set_var.o] Error 1

I tried reconfiguring with '--with-low-memory' but the error is the same... Oh btw, I
have 512mb of ram and 600mb of swap.
[7 Jul 2005 18:52] Joerg Behrens
After i reported this error some time ago i gathering some more information about the
build process by asking Hartmut. I didnt know that headerfiles are creating during
compile time and first we thought that the gen_lex_hash is still missing or creating the
wrong output. But we found no issues there and  take a look the the pre processor
output.

ll output.txt
-rw-r--r--    1 root     sys        103148  1. Juni 08:28 output.txt
http://www.irixworld.net/output.txt
Dont know if it looks normal :)

Normaly my enviroment doesnt contains the right autoconf and automake version to compile
mysql from cvs (bitkeeper). It was a big surprise after adding the right versions to
$PATH and recompile went fine after this.

Setting the pathes back to the standard $PATH *dont* bring the error back! Today i
recompile mysql 4.1.12 and 5.0.7 serveral times without this special error and i must say
i cant produce it anymore.

So there is only one thing left. Is it possible that this is a timing issure when using 
gmake -j on  a 32 way cpu machine?

regards
Joerg
[25 Jul 2005 10:10] Sergei Golubchik
You're right. Having 'symbols undeclared' and empty (0-size) lex_hash.h is due to a race
condition in Makefile, when a parallel make (make -j) is used - one make process tries to
execute gen_lex_hash (to generate lex_hash.h) while it is still being built by another
make process. To continue the build you need to manually delete empty lex_hash.h and run
make again.

This problem was fixed in 4.1.13
[31 Mar 2006 17:42] John Chew
I encountered the same problem when compiling on a web server where I had had to build my
own private copy of g++. I had specified ./configure --prefix=$HOME/private/mysql
CC=$HOME/private/gcc/bin/gcc CXX=$HOME/private/gcc/bin/g++
LDFLAGS=-L$HOME/private/gcc/lib CPPFLAGS=-I$HOME/private/gcc/include but I had neglected
to set LD_LIBRARY_PATH, so when gen_lex_hash tried to run it couldn't find its shared
library and silently crashed.

It would have been helpful if the make process had stopped and more clearly described the
problem either when gen_lex_hash failed, or when the empty header file was detected. And
when gen_lex_hash fails, it should not leave behind an empty header file.
[8 Dec 2006 14:20] Sveta Smirnova
Same error on Intel Mac and current 4.1 BK sources.
[7 Feb 2007 8:52] 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/19464

ChangeSet@1.2602, 2007-02-07 09:46:20+01:00, msvensson@neptunus.(none) +1 -0
  Bug#10777 ERROR File = sql_lex.cc, Line = 93 The identifier "symbols" is undefined.
   - Protect againt empty/corrupt lex_hash-h by writing output from gen_lex_hash to 
     a temporary file first.
[8 Mar 2007 20:18] Timothy Smith
pushed to 4.1.23, 5.0.38, 5.1.17
[8 Mar 2007 20:39] Paul DuBois
No changelog entry needed.