Bug #58350 5.5.7-rc compile failed at sp_head.cc
Submitted: 20 Nov 2010 22:02 Modified: 22 Dec 2010 19:14
Reporter: George (Liwen) Zhang Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5.7, 5.5.8 OS:Any (with systemtap installed)
Assigned to: Georgi Kodinov CPU Architecture:Any

[20 Nov 2010 22:02] George (Liwen) Zhang
Description:
Download  mysql-5.5.7-rc.tar.gz from dev.mysql.com, compile with provided scripts, got error when compiling. OS is Redhat Enterprise Linux 6 Beta2 64bit:
cmake version 2.6-patch 4
gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)
glibc 2.12

./BUILD/compile-pentium64-gprof
...
/usr/src/mysql-5.5.7-rc/sql/sp_head.cc: In member function ‘virtual int sp_instr_stmt::exec_core(THD*, uint*)’:
/usr/src/mysql-5.5.7-rc/sql/sp_head.cc:3136: error: array must be initialized with a brace-enclosed initializer
gmake[2]: *** [sql/CMakeFiles/sql.dir/sp_head.cc.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2

How to repeat:
./BUILD/compile-pentium64-gprof
[21 Nov 2010 18:23] Valeriy Kravchuk
Do you have SystemTap installed?
[22 Nov 2010 4:24] George (Liwen) Zhang
yes. systemtap installed and works:

SystemTap translator/driver (version 1.2/0.148 non-git sources)

[root@geovm01 /]# stap -l 'process("/opt/mysql/bin/mysqld").mark("*")'
..
process("/opt/mysql/bin/mysqld").mark("net__read__start")
process("/opt/mysql/bin/mysqld").mark("net__write__done")
process("/opt/mysql/bin/mysqld").mark("net__write__start")
..
[22 Nov 2010 4:26] George (Liwen) Zhang
[mysql@geovm01 mysql]$ rpm -qa|grep tap
systemtap-server-1.2-9.el6.x86_64
systemtap-initscript-1.2-9.el6.x86_64
systemtap-1.2-9.el6.x86_64
systemtap-sdt-devel-1.2-9.el6.x86_64
systemtap-runtime-1.2-9.el6.x86_64
systemtap-client-1.2-9.el6.x86_64

BTW, 5.5.6-rc compiles fine.
[22 Nov 2010 9:35] Valeriy Kravchuk
I\ve got the same problem on Ubuntu 10.04 as soon as systemtap is installed, on current mysql-5.5 tree:

[ 84%] Building CXX object sql/CMakeFiles/sql.dir/sql_analyse.cc.o
/home2/openxs/bzr2/mysql-5.5/sql/sp_head.cc: In member function ‘virtual int sp_instr_stmt::exec_core(THD*, uint*)’:
/home2/openxs/bzr2/mysql-5.5/sql/sp_head.cc:3136: error: array must be initialized with a brace-enclosed initializer
[ 84%] Building CXX object sql/CMakeFiles/sql.dir/sql_base.cc.o
make[2]: *** [sql/CMakeFiles/sql.dir/sp_head.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
make: *** [all] Error 2

The only "workaround" I've found so far is to remove systemtap. I've used the following command line to build:

BUILD/compile-pentium-debug-max-no-ndb --prefix=/home/openxs/dbs/5.5
[3 Dec 2010 10:01] Tor Didriksen
The relevant diff between 5.5.6 and 5.5.7 seems to be in sql_class.h
<   char   *host, *user, *priv_user, *ip;
---
>   char   *host, *user, *ip;
>   char   priv_user[USERNAME_LENGTH];
>   char   proxy_user[USERNAME_LENGTH + MAX_HOSTNAME + 5];

so this probe now fails to compile:
  MYSQL_QUERY_EXEC_START(thd->query(),
                         thd->thread_id,
                         (char *) (thd->db ? thd->db : ""),
                         thd->security_ctx->priv_user,
                         (char *)thd->security_ctx->host_or_ip,
                         3);

As a workaround, it should be possible to invoke cmake with
-DENABLE_DTRACE=0
[8 Dec 2010 16:47] 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/126345

3180 Georgi Kodinov	2010-12-08
      Bug #58350: 5.5.7-rc compile failed at sp_head.cc
      
      Fixed the references to security_ctx->priv_user
      to be real char * pointers instead of a C array name reference.
      This is somehow important for some 3d party 
      dtrace replacements
[14 Dec 2010 15:11] 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/126782

3191 Georgi Kodinov	2010-12-08
      Bug #58350: 5.5.7-rc compile failed at sp_head.cc
      
      Fixed the references to security_ctx->priv_user
      to be real char * pointers instead of a C array name reference.
      This is somehow important for some 3d party 
      dtrace replacements
[17 Dec 2010 12:52] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:georgi.kodinov@oracle.com-20101217124733-p1ivu6higouawv8l) (version source revid:georgi.kodinov@oracle.com-20101208164721-8vrwi8wck8vojjbj) (merge vers: 5.5.8) (pib:24)
[17 Dec 2010 12:56] Bugs System
Pushed into mysql-trunk 5.6.1 (revid:georgi.kodinov@oracle.com-20101217125013-y8pb3az32rtbplc9) (version source revid:mats.kindahl@oracle.com-20101215103340-a0wp0yq8t4byel1o) (merge vers: 5.6.1) (pib:24)
[22 Dec 2010 19:14] Paul DuBois
Noted in 5.5.9 changelog.

Security context references in sp_head.cc were rewritten for improved
DTrace compatibility.