Jochen,

> 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.
>

I'm using:
        Redhat 6.1 (Linux 2.2.12-20RS )
        Apache/1.3.12 (from distribution)
        mod_perl: 1.22 (compiled from source, running as a DSO through APXS)
        mysql  Ver 9.36 Distrib 3.22.27 (from distribution)
        perl 5.005_03 (from distribution)
        Msql-Mysql-modules-1.2211 (compiled form source, retreived from CPAN)
        DBI-1.13 (compiled form source, retreived from CPAN)

None of which are sporting any modifications.



Below is a backtrace of my segfault received on DBI->Connect (sorry but my
perl and apache binaries are stripped)... you can see that mysql_close is
being called with a null argument, rather than mysql_real_connect as
indicated in some of the other backtraces reported.

-----+++++-----
Starting program: /usr/local/apache/bin/httpd -X

Program received signal SIGSEGV, Segmentation fault.
mysql_close (mysql=0x0) at libmysql.c:1555
1555          end_server(mysql);
#0  mysql_close (mysql=0x0) at libmysql.c:1555
#1  0x403bf254 in __DTOR_END__ ()
   from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
#2  0x403ac0dd in mysql_dr_connect ()
   from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
#3  0x403ac420 in _MyLogin ()
   from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
#4  0x403ac48f in mysql_db_login ()
   from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
#5  0x403affd8 in XS_DBD__mysql__db__login ()
...
-----+++++-----

Any suggestions for a fix?

Regards,

Drew Degentesh



> -----Original Message-----
> From: Jochen Wiedmann [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, April 15, 2000 6:57 PM
> To: Doug MacEachern
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: Segfault on DBI->Connect
>
>
>
>
> 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.
>
> 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
>
>
>

Reply via email to