List:MySQL and Perl« Previous MessageNext Message »
From:Michael Widenius Date:June 29 1999 4:13am
Subject:connect with dbi:mysql crashes Perl
View as plain text  
>>>>> "Roman" == Roman Maeder <maeder@stripped> writes:

Roman> I just installed the latest mysql-3.22.23b-sun-sunos4.1.4-sparc
Roman> binary distribution, then DBI-1.11 and now Msql-Mysql-modules-1.2200.

Roman> Running a Perl script that connects to mysqld crashes Perl 5.00404
Roman> (this is all under SunOS 4.1.4), for example here is dbimon:

csh> dbx /usr/bin/perl

Roman> (dbx) run /usr/local/bin/dbimon dbi:mysql:test username password

Roman> Running: /usr/bin/perl /usr/local/bin/dbimon dbi:mysql:test username password 
Roman> Can't open trace file : No such file or directory    DBI 1.11-nothread dispatch
> trace level set to 2
Roman>     Note: perl is running without the recommended perl -w option
-> DBI->connect(dbi:mysql:test, username, password)
-> DBI->install_driver(mysql) for perl=5.00404 pid=14174 ruid=1611 euid=1611
Roman>        install_driver: DBD::mysql loaded (version 2.0400)
Roman>     <- install_driver= DBI::dr=HASH(0x179a60)
-> connect for DBD::mysql::dr (DBI::dr=HASH(0x179a60)~0x2eec68 'test' 'username'
'password' HASH(0x2a805c))
imp_dbh-> connect: dsn = test, uid = username, pwd = password
imp_dbh-> MyLogin: dbname = test, uid = username, pwd = password,host = NULL, port =
NULL
imp_dbh-> MyConnect: host = NULL, port = 0, uid = username, pwd = password
Roman> signal SEGV (segmentation violation) in etext at 0xef7276d4
Roman> etext-0x10978aa4:       ld      [%i0 + 428], %o1

Roman> (dbx) where
Roman> etext() at 0xef7276d4
Roman> etext() at 0xef71d0f4
Roman> etext() at 0xef71d60c
Roman> etext() at 0xef71d68c
Roman> etext() at 0xef7226a4
Roman> Perl_pp_entersub() at 0x4123c
Roman> Perl_runops() at 0x3b518
Roman> perl_call_sv() at 0x59d4
Roman> etext() at 0xef748ccc
Roman> Perl_pp_entersub() at 0x4123c
Roman> Perl_runops() at 0x3b518
Roman> perl_run() at 0x4eec
Roman> main() at 0x2334


Roman> I compiled DBD:mysql with acc, Sun's old ANSI compiler (for the only
Roman> reason that this compiler was used a few year ago to compile Perl itself,
Roman> so I am pretty much stick with it).

Roman> There was one glitch when I compiled the module. mysql/include/mysql.h
Roman> contains a use of "long long", which this compiler does not understand.
Roman> After adding the switch -DNO_CLIENT_LONG_LONG to the Makefile, the
Roman> module compiled fine, but everytime DBI->connect("dbi:mysql:....") is
Roman> invoked, Perl silently segfaults.

Roman> Does anyone have any ideas or suggestions? The mysql server and the
Roman> precompiled binaries such as mysql, mysqladmin etc. themselves work fine,
Roman> so it looks like something in the C code of DBD:mysql.

Roman> Roman Maeder

Hi!

Note that if you are using a binary MySQL distribution which is
compiled with a compiler that has longlong, the above
-DNO_CLIENT_LONG_LONG will crash your client!

You have to:

a) Recompile the mysql client library with your current compiler

or

b) Recompile the modules with gcc.

Regards,
Monty
Thread
connect with dbi:mysql crashes PerlRoman Maeder26 Jun
  • Re: connect with dbi:mysql crashes PerlJochen Wiedmann26 Jun
  • connect with dbi:mysql crashes PerlMichael Widenius29 Jun
    • Re: connect with dbi:mysql crashes PerlRoman Maeder30 Jun
      • Re: connect with dbi:mysql crashes PerlMichael Widenius1 Jul