On Tue, 11 Apr 2000, Doug MacEachern wrote:
> On Tue, 4 Apr 2000 [EMAIL PROTECTED] wrote:
>
> > I've been seeing the same segfault-on-connect problem with Apache 1.2.12
> > + mod_perl 1.22 + DBI 1.13 + Msql-Mysql-modules 1.2211. The segfault is
> > due to a null first argument being passed to mysql_real_connect().
> >
> > Running Apache with a -X argument yields the following backtrace when my
> > mod_perl module does a DBI->connect (str, username, passwd, { options }).
> > Note the null mysql argument ------------
> > |
> > V
> > #0 0x80ef5b7 in mysql_real_connect (mysql=0x0,
> > host=0x8a99db8 "hostname.brown.edu", user=0x8a9b550 "username",
> > passwd=0x8a9b568 "password", db=0x8a99e40 "databasename", port=3306,
> > unix_socket=0x0, client_flag=0) at libmysql.c:1125
> > #1 0x402d01fd in mysql_dr_connect ()
> > from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
> > #2 0x402d0540 in _MyLogin ()
> > from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
> >
> > The mysql_real_connect routine does a set_sigpipe(mysql), which triggers
> > the segfault.
If you are using the DBD-mysql sources, as distributed by me, the
mysql_real_connect function will *never* be called with a NULL
argument. This cannot happen, if mysql_init() is called before
mysql_real_connect(). (Unless you are using some patches that I have
recently reached me from the mod_perl mailing list, but that I haven't
verified yet.) Calling mysql_real_connect with mysql==NULL will surely
cause a SEGFAULT.
So my question remains: Why the heck *are* you passing a NULL argument?
Is this because of some bug in the DBD::mysql driver or are you using
modified sources?
Btw, Doug, as I see the sigpipe thing: What do you recommend for the
DBD::mysql driver? (Remember the "MySQL morning bug"?) Should we
enable or disable SIGPIPE?
Thanks,
Jochen