Bug #43599 Bad magic number ; on installing DBD-mysql-4.010
Submitted: 12 Mar 2009 15:08 Modified: 17 Mar 2009 7:57
Reporter: Wilfried Kersting Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connectors: DBD::mysql ( Perl ) Severity:S3 (Non-critical)
Version:5.1.32 OS:HP/UX (B.11.23 U ia64)
Assigned to: CPU Architecture:Any

[12 Mar 2009 15:08] Wilfried Kersting
Description:
I Can't complete the Installation of mysql on HP-UX
When i try to install then DBD::mysql for Perl i get an Error in testing

Versions: HP/ux B.11.23 U ia64
Perl: perl_32  version 5.8.8

Installation Dialog :
$ cd DBD-mysql-4.010/
[herbck_B.11.23]:/homeroot:root]:/opt/perl/DBD-mysql-4.010
$ perl Makefile.PL
Use of uninitialized value in concatenation (.) or string at Makefile.PL line 48
8, <PIPE> line 33.
Use of uninitialized value in concatenation (.) or string at Makefile.PL line 48
8, <PIPE> line 33.

PLEASE NOTE:

For 'make test' to run properly, you must ensure that the 
database user '' can connect to your MySQL server 
and has the proper privileges that these tests require such 
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others. 

mysql> grant all privileges on test.* to ''@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.pl --testuser=username

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/local/mysql/include  -g +O2 +DD64 +DSita
nium2 -mt -DHPUX11  -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DHAVE_BROKEN_GE
TPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_
COND_TIMEDWAIT -DHAVE_BROKEN_INLINE -DUNIV_HPUX
  embedded      (mysql_config) = 
  libs          (mysql_config) = +DD64  -L/usr/local/mysql/lib -lmysqlclient -lz
 -lnsl -lm
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) = 
  testpassword  (default     ) = 
  testsocket    (default     ) = 
Use of uninitialized value in printf at Makefile.PL line 175, <PIPE> line 102.
Use of uninitialized value in printf at Makefile.PL line 175, <PIPE> line 102.
  testuser      (            ) = 

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Unrecognized argument in LIBS ignored: '+DD64'
Using DBI 1.607 (for perl 5.008008 on IA64.ARCHREV_0-thread-multi) installed in 
/opt/perl_32/lib/site_perl/5.8.8/IA64.ARCHREV_0-thread-multi/auto/DBI/
Writing Makefile for DBD::mysql
[herbck_B.11.23]:/homeroot:root]:/opt/perl/DBD-mysql-4.010
$ 
******************************************************************************
$ make
        cc -c  -I/opt/perl_32/lib/site_perl/5.8.8/IA64.ARCHREV_0-thread-multi/au
to/DBI -I/usr/local/mysql/include  -g +O2 +DD64 +DSitanium2 -mt -DHPUX11  -DSNPR
INTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK 
-DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROK
EN_INLINE -DUNIV_HPUX -DDBD_MYSQL_INSERT_ID_IS_GOOD -g   -D_POSIX_C_SOURCE=19950
6L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE
 -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fast +DSitanium2 +Of
ltacc=strict    -DVERSION=\"4.010\"  -DXS_VERSION=\"4.010\" +Z "-I/opt/perl_32/l
ib/5.8.8/IA64.ARCHREV_0-thread-multi/CORE"   dbdimp.c
"dbdimp.c", line 2816: warning #3197-D: the prototype declaration of
          "int *__errno(void)" (declared at line 21 of "/usr/include/errno.h")
          is ignored after this unprototyped redeclaration
    int errno;
        ^

"dbdimp.c", line 2881: warning #2068-D: integer conversion resulted in a
          change of sign
        return -2;
               ^
...@ some more warnings 

"dbdimp.c", line 4220: warning #2549-D: variable "slen" is used before its
          value is set
    int buffer_length= slen;
                       ^

"dbdimp.c", line 112: warning #4275-D: constant out of range ([0 - 4294967295]
          ) for the operator
      Newz(908, params, (unsigned int) num_params, imp_sth_ph_t);
      ^
...@ some more warnings 

"dbdimp.c", line 3456: warning #4276-D: relational operator ">" always
          evaluates to 'false'
            Renew(fbh->data, fbh->length, char);
            ^

        cc -c  -I/opt/perl_32/lib/site_perl/5.8.8/IA64.ARCHREV_0-thread-multi/au
to/DBI -I/usr/local/mysql/include  -g +O2 +DD64 +DSitanium2 -mt -DHPUX11  -DSNPR
INTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK 
-DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROK
EN_INLINE -DUNIV_HPUX -DDBD_MYSQL_INSERT_ID_IS_GOOD -g   -D_POSIX_C_SOURCE=19950
6L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE
 -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fast +DSitanium2 +Of
ltacc=strict    -DVERSION=\"4.010\"  -DXS_VERSION=\"4.010\" +Z "-I/opt/perl_32/l
ib/5.8.8/IA64.ARCHREV_0-thread-multi/CORE"   mysql.c
"mysql.c", line 1362: warning #2111-D: statement is unreachable
        PUTBACK;
        ^
...@ some more warnings 

"mysql.xs", line 330: warning #4275-D: constant out of range ([0 - 4294967295]
          ) for the operator
          Newz(0, bind, (unsigned int) num_params, MYSQL_BIND);
          ^

"mysql.xs", line 331: warning #4275-D: constant out of range ([0 - 4294967295]
          ) for the operator
          Newz(0, fbind, (unsigned int) num_params, imp_sth_phb_t);
          ^

Running Mkbootstrap for DBD::mysql ()
        chmod 644 mysql.bs
        rm -f blib/arch/auto/DBD/mysql/mysql.so
        LD_RUN_PATH="/usr/local/mysql/lib" /usr/bin/perl myld /usr/bin/ld  -b +v
nocompatwarnings -L/usr/lib/hpux32 dbdimp.o  mysql.o  -o blib/arch/auto/DBD/mysq
l/mysql.so      \
           -L/usr/local/mysql/lib -lmysqlclient -lz -lnsl -lm   \
          
        chmod 755 blib/arch/auto/DBD/mysql/mysql.so
         cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
        chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Manifying blib/man3/DBD::mysql.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/Bundle::DBD::mysql.3
[herbck_B.11.23]:/homeroot:root]:/opt/perl/DBD-mysql-4.010
$ 
******************************************************************************

$ make test
        PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_har
ness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base....................ok 1/6/usr/lib/hpux32/dld.so: '/opt/perl_32/DBD-mysq
l-4.010/blib/arch/auto/DBD/mysql/mysql.so' is not a valid load module: Bad magic
 number

#   Failed test 'use DBD::mysql;'
t/00base....................NOK 2#   in t/00base.t at line 21.               
#     Tried to use 'DBD::mysql'.
#     Error:  Can't load '/opt/perl_32/DBD-mysql-4.010/blib/arch/auto/DBD/mysql/
mysql.so' for module DBD::mysql: Invalid argument at /opt/perl_32/lib/5.8.8/IA64
.ARCHREV_0-thread-multi/DynaLoader.pm line 230.
#  at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at t/00base.t line 21.
FAILED--Further testing stopped: Unable to load DBD::mysql
*** Error exit code 255

Stop.
[herbck_B.11.23]:/homeroot:root]:/opt/perl/DBD-mysql-4.010
$ 

How to repeat:
Installation of DBI completete

unpack DBD-mysql-4.010/ completete
cd DBD-mysql-4.010/
perl Makefiel.PL
make
make test
[13 Mar 2009 11:52] Miguel Solorzano
Changing Category.
[13 Mar 2009 17:19] Sveta Smirnova
Thank you for the report.

Please try solution from comment "[8 Nov 2006 16:54] Bogdan Degtyariov" to bug #23923 and inform us if it solves or not your problem as well:

"The problem can be resolved when use +DD64 compiler option. By default aCC generates
32-bit executables that cannot load 64-bit shared libs."
[17 Mar 2009 7:31] Wilfried Kersting
Thank you
with perl_64 it will work well

Wilfried Kersting
[17 Mar 2009 7:57] Sveta Smirnova
Thank you for the feedback.

I close the report as "Not a Bug", because this is not MySQL bug.