Bug #3200 cannot compile with pstack
Submitted: 17 Mar 2004 5:49 Modified: 1 Apr 2004 8:15
Reporter: Martin Mokrejs Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:mysql-4.0-bk OS:Linux (Linux)
Assigned to: Victor Vagin CPU Architecture:Any

[17 Mar 2004 5:49] Martin Mokrejs
Description:
make[2]: Entering directory `/scratch/mysql-4.0/pstack'
Making all in aout
make[3]: Entering directory `/scratch/mysql-4.0/pstack/aout'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/scratch/mysql-4.0/pstack/aout'
make[3]: Entering directory `/scratch/mysql-4.0/pstack'
source='bucomm.c' object='bucomm.o' libtool=no \
depfile='.deps/bucomm.Po' tmpdepfile='.deps/bucomm.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I../include    -O3 -DDBUG_OFF -O0 -g3  -c `test -f 'bucomm.c' || echo './'`bucomm.c
In file included from bucomm.c:26:
bucomm.h:66: error: syntax error before "boolean"
bucomm.c: In function `print_arelt_descr':
bucomm.c:155: error: syntax error before "boolean"
make[3]: *** [bucomm.o] Error 1
make[3]: Leaving directory `/scratch/mysql-4.0/pstack'

How to repeat:
The very first few lines of "bk changes" show:

ChangeSet@1.1759.2.1, 2004-03-17 10:35:03+01:00, guilhem@mysql.com
  Fix for BUG#2922 "Crash (signal11) after "load data from master""
  with a testcase.
  We needed to init_master_info before we flush_master_info
  in LOAD DATA FROM MASTER.
[18 Mar 2004 2:32] Victor Vagin
Please, let me know the version of your binutils?
(take a look at http://bugs.mysql.com/bug.php?id=1661)
[19 Mar 2004 2:50] Victor Vagin
bk commit - 4.0 tree (vva:1.1771)

ChangeSet
  1.1771 04/03/19 18:38:25 vva@eagle.mysql.r18.ru +3 -0
  fixed bug #3200 "cannot compile with pstack"
  as downgrade of patch for 
  bug #1661 "Compiling --with-pstack fails with binutils 2.13.90"

Could you test your case with the patch below:

===== pstack/bucomm.h 1.1 vs edited =====
*** /tmp/bucomm.h-1.1-13863     Wed Apr 11 16:03:51 2001
--- edited/pstack/bucomm.h      Fri Mar 19 00:51:25 2004
***************
*** 50,55 ****
--- 50,61 ----
  # endif /* HAVE_ALLOCA_H */
  #endif

+ #ifndef BFD_TRUE_FALSE
+ #define boolean bfd_boolean
+ #define true TRUE
+ #define false FALSE
+ #endif
+
  /* bucomm.c */
  void bfd_nonfatal PARAMS ((CONST char *));

===== pstack/budbg.h 1.1 vs edited =====
*** /tmp/budbg.h-1.1-13863      Wed Apr 11 16:03:52 2001
--- edited/pstack/budbg.h       Fri Mar 19 00:51:58 2004
***************
*** 24,29 ****
--- 24,35 ----

  #include <stdio.h>

+ #ifndef BFD_TRUE_FALSE
+ #define boolean bfd_boolean
+ #define true TRUE
+ #define false FALSE
+ #endif
+
  /* Routine used to read generic debugging information.  */

  extern PTR read_debugging_info PARAMS ((bfd *, asymbol **, long));
===== pstack/pstack.c 1.2 vs edited =====
*** /tmp/pstack.c-1.2-13863     Thu Dec  6 16:10:43 2001
--- edited/pstack/pstack.c      Fri Mar 19 17:27:59 2004
***************
*** 2667,2673 ****
        if ((abfd = load_bfd(pid))==0)
                fprintf(stderr, "BFD load failed..\n");
        else {
!               long    storage_needed = bfd_get_symtab_upper_bound (abfd);
                long    i;
                (void)i;

--- 2667,2674 ----
        if ((abfd = load_bfd(pid))==0)
                fprintf(stderr, "BFD load failed..\n");
        else {
!               long    storage_needed= (bfd_get_file_flags(abfd) & HAS_SYMS) ?
!                                        bfd_get_symtab_upper_bound (abfd) : 0;
                long    i;
                (void)i;
[1 Apr 2004 8:15] Victor Vagin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

The fix will be in mysql-4.0.19