You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tosh Cooey <to...@1200group.com> on 2010/11/11 00:16:05 UTC

I think AuthCookie(DBI) is causing segfaults?

I have a standard mod_perl setup, application is a server and mysql is 
another.

I use AuthCookieDBI 
http://cpansearch.perl.org/src/MATISSE/Apache2-AuthCookieDBI-2.05/lib/Apache2/AuthCookieDBI.pm 
for authentication against the DB.

If the application has not been used for a while, a few hours, then when 
a user tries to connect Apache segfaults.  Here is debug output:

[Wed Nov 10 22:37:04 2010] [error] auth_type DISKO::AUTH
[Wed Nov 10 22:37:04 2010] [error] 
r=Apache2::RequestRec=SCALAR(0x81f6f290) authtype=DISKO::AUTH
[Wed Nov 10 22:37:04 2010] [error] auth_name berlin3
[Wed Nov 10 22:37:04 2010] [error] ses_key_cookie <cookiestuff>
[Wed Nov 10 22:37:04 2010] [error] uri /clientID/index.pl
[Wed Nov 10 22:37:04 2010] [error] user authenticated as tosh
[Wed Nov 10 22:37:04 2010] [error] authorize() for /clientID/index.pl
[Wed Nov 10 22:37:04 2010] [error] authorize user=tosh type=DISKO::AUTH
[Wed Nov 10 22:37:04 2010] [error] requirement := valid-user,
[Wed Nov 10 22:37:04 2010] [notice] child pid 17510 exit signal 
Segmentation fault (11)

DISKO::AUTH is where I override:
*Apache2::AuthCookieDBI::_dbi_connect = sub {
the connect() sub so I can do some on-the-fly modification of DSN names.

DBI->connect_cached is used if that is of importance.

My understanding of DBI is that things like ping() and reconnecting are 
all taken care of automagically, so I'm a bit baffled by this, 
especially as I have never had this happen on somewhat similar 
application setups.

Is there something wrong with Apache2::AuthCookieDBI::_dbi_connect ?

Or should I just cron a task to ping the application every hour?

Thanks!

Tosh

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/

Re: Re: I think AuthCookie(DBI) is causing segfaults?

Posted by Clinton Gormley <cl...@traveljury.com>.
On Sat, 2010-11-13 at 14:15 +0100, Tosh Cooey wrote:
> I'm not quite ready to declare victory, but I think installing DBD from 
> source and getting more recent versions of DBD was the problem, and it 
> seems there's a lot of little things going wrong with DBD.
> 
> What's going on there?  When did DBD::mysql become so problematic?  It 
> used to run so flawless, even back in the day when you would have to 
> choose between mysql and msql during the install...

Are you using the same version of Perl and gcc that all the rest of your
stack are using?

I compile the whole stack from source, and have none of the problems
that you have described.

(The only gotcha with DBD is don't use a dbh in the parent process,
during startup, then try to reuse it in the child processes. That will
cause a segfault)

clint



Re: Re: I think AuthCookie(DBI) is causing segfaults?

Posted by Tosh Cooey <to...@1200group.com>.
I'm not quite ready to declare victory, but I think installing DBD from 
source and getting more recent versions of DBD was the problem, and it 
seems there's a lot of little things going wrong with DBD.

What's going on there?  When did DBD::mysql become so problematic?  It 
used to run so flawless, even back in the day when you would have to 
choose between mysql and msql during the install...

Anyway if anyone is having similar problems then try upgrading from source.

Tosh


On 7/22/64 8:59 PM, Tosh Cooey wrote:
> Hi Tuomo, thank-you that was really helpful.
>
> I'm running prefork it seems. Here's the list if that's helpful:
> core.c
> mod_log_config.c
> mod_logio.c
> prefork.c
> http_core.c
> mod_so.c
>
> Also perhaps helpful is that I'm on Ubuntu 9.04 Jaunty with the latest
> libdbd-mysql-perl 4.008-1 which was a pain in the a55 to install and was
> only done because doing a CPAN install of DBD::mysql seemed all but
> impossible on this server.
>
> And again, this ONLY happens when the application has not made any MySQL
> requests for a few hours, or possibly when I restart the MySQL server
> but I can't confirm this as consistent.
>
> The "fix" is to hit the server until all the old child processes have
> crashed and then new ones are spawned, usually only about six processes,
> then everything works fine until the next time.
>
> Tosh
>
>
> On 11/11/10 4:07 PM, Tuomo Salo wrote:
>> On Thu, Nov 11, 2010 at 12:58:23AM +0100, Tosh Cooey wrote:
>>> Maybe Apache MPM prefork? How can I tell?
>>
>> Running httpd with the -l (ell) command line option will print
>> a list of module names. If you see "prefork.c", you are using
>> prefork, and if you see "worker.c", you are using the threaded
>> MPM.
>>
>> -Tuomo
>>
>

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/

Re: I think AuthCookie(DBI) is causing segfaults?

Posted by Tosh Cooey <to...@1200group.com>.
Hi Tuomo, thank-you that was really helpful.

I'm running prefork it seems.  Here's the list if that's helpful:
   core.c
   mod_log_config.c
   mod_logio.c
   prefork.c
   http_core.c
   mod_so.c

Also perhaps helpful is that I'm on Ubuntu 9.04 Jaunty with the latest 
libdbd-mysql-perl 4.008-1 which was a pain in the a55 to install and was 
only done because doing a CPAN install of DBD::mysql seemed all but 
impossible on this server.

And again, this ONLY happens when the application has not made any MySQL 
requests for a few hours, or possibly when I restart the MySQL server 
but I can't confirm this as consistent.

The "fix" is to hit the server until all the old child processes have 
crashed and then new ones are spawned, usually only about six processes, 
then everything works fine until the next time.

Tosh


On 11/11/10 4:07 PM, Tuomo Salo wrote:
> On Thu, Nov 11, 2010 at 12:58:23AM +0100, Tosh Cooey wrote:
>> Maybe Apache MPM prefork?  How can I tell?
>
> Running httpd with the -l (ell) command line option will print
> a list of module names. If you see "prefork.c", you are using
> prefork, and if you see "worker.c", you are using the threaded
> MPM.
>
>    -Tuomo
>

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/

Re: I think AuthCookie(DBI) is causing segfaults?

Posted by Tuomo Salo <Tu...@cybercom.com>.
On Thu, Nov 11, 2010 at 12:58:23AM +0100, Tosh Cooey wrote:
> Maybe Apache MPM prefork?  How can I tell? 

Running httpd with the -l (ell) command line option will print
a list of module names. If you see "prefork.c", you are using
prefork, and if you see "worker.c", you are using the threaded 
MPM.

  -Tuomo

Re: I think AuthCookie(DBI) is causing segfaults?

Posted by Vincent Veyron <vv...@wanadoo.fr>.
Le jeudi 11 novembre 2010 à 00:58 +0100, Tosh Cooey a écrit :

> Maybe Apache MPM prefork?  How can I tell?  



Please read the section "How to Report Problems" on this page :

http://perl.apache.org/docs/1.0/guide/help.html


That should help quite a bit.


-- 
Vincent Veyron
http://marica.fr/
Logiciel de gestion des dossiers de contentieux et d'assurance pour le service juridique

Re: I think AuthCookie(DBI) is causing segfaults?

Posted by Tosh Cooey <to...@1200group.com>.
Maybe Apache MPM prefork?  How can I tell?  Neither of 
/mods-available|enabled contain any mpm_* mods so perhaps no MPM?

Sorry for my weak knowledge here :(

Tosh


On 11/11/10 12:30 AM, Perrin Harkins wrote:
> Which MPM are you using?
>
> - Perrin
>
> On Wed, Nov 10, 2010 at 6:16 PM, Tosh Cooey<to...@1200group.com>  wrote:
>> I have a standard mod_perl setup, application is a server and mysql is
>> another.
>>
>> I use AuthCookieDBI
>> http://cpansearch.perl.org/src/MATISSE/Apache2-AuthCookieDBI-2.05/lib/Apache2/AuthCookieDBI.pm
>> for authentication against the DB.
>>
>> If the application has not been used for a while, a few hours, then when a
>> user tries to connect Apache segfaults.  Here is debug output:
>>
>> [Wed Nov 10 22:37:04 2010] [error] auth_type DISKO::AUTH
>> [Wed Nov 10 22:37:04 2010] [error] r=Apache2::RequestRec=SCALAR(0x81f6f290)
>> authtype=DISKO::AUTH
>> [Wed Nov 10 22:37:04 2010] [error] auth_name berlin3
>> [Wed Nov 10 22:37:04 2010] [error] ses_key_cookie<cookiestuff>
>> [Wed Nov 10 22:37:04 2010] [error] uri /clientID/index.pl
>> [Wed Nov 10 22:37:04 2010] [error] user authenticated as tosh
>> [Wed Nov 10 22:37:04 2010] [error] authorize() for /clientID/index.pl
>> [Wed Nov 10 22:37:04 2010] [error] authorize user=tosh type=DISKO::AUTH
>> [Wed Nov 10 22:37:04 2010] [error] requirement := valid-user,
>> [Wed Nov 10 22:37:04 2010] [notice] child pid 17510 exit signal Segmentation
>> fault (11)
>>
>> DISKO::AUTH is where I override:
>> *Apache2::AuthCookieDBI::_dbi_connect = sub {
>> the connect() sub so I can do some on-the-fly modification of DSN names.
>>
>> DBI->connect_cached is used if that is of importance.
>>
>> My understanding of DBI is that things like ping() and reconnecting are all
>> taken care of automagically, so I'm a bit baffled by this, especially as I
>> have never had this happen on somewhat similar application setups.
>>
>> Is there something wrong with Apache2::AuthCookieDBI::_dbi_connect ?
>>
>> Or should I just cron a task to ping the application every hour?
>>
>> Thanks!
>>
>> Tosh
>>
>> --
>> McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/
>>
>

-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/

Re: I think AuthCookie(DBI) is causing segfaults?

Posted by Perrin Harkins <pe...@elem.com>.
Which MPM are you using?

- Perrin

On Wed, Nov 10, 2010 at 6:16 PM, Tosh Cooey <to...@1200group.com> wrote:
> I have a standard mod_perl setup, application is a server and mysql is
> another.
>
> I use AuthCookieDBI
> http://cpansearch.perl.org/src/MATISSE/Apache2-AuthCookieDBI-2.05/lib/Apache2/AuthCookieDBI.pm
> for authentication against the DB.
>
> If the application has not been used for a while, a few hours, then when a
> user tries to connect Apache segfaults.  Here is debug output:
>
> [Wed Nov 10 22:37:04 2010] [error] auth_type DISKO::AUTH
> [Wed Nov 10 22:37:04 2010] [error] r=Apache2::RequestRec=SCALAR(0x81f6f290)
> authtype=DISKO::AUTH
> [Wed Nov 10 22:37:04 2010] [error] auth_name berlin3
> [Wed Nov 10 22:37:04 2010] [error] ses_key_cookie <cookiestuff>
> [Wed Nov 10 22:37:04 2010] [error] uri /clientID/index.pl
> [Wed Nov 10 22:37:04 2010] [error] user authenticated as tosh
> [Wed Nov 10 22:37:04 2010] [error] authorize() for /clientID/index.pl
> [Wed Nov 10 22:37:04 2010] [error] authorize user=tosh type=DISKO::AUTH
> [Wed Nov 10 22:37:04 2010] [error] requirement := valid-user,
> [Wed Nov 10 22:37:04 2010] [notice] child pid 17510 exit signal Segmentation
> fault (11)
>
> DISKO::AUTH is where I override:
> *Apache2::AuthCookieDBI::_dbi_connect = sub {
> the connect() sub so I can do some on-the-fly modification of DSN names.
>
> DBI->connect_cached is used if that is of importance.
>
> My understanding of DBI is that things like ping() and reconnecting are all
> taken care of automagically, so I'm a bit baffled by this, especially as I
> have never had this happen on somewhat similar application setups.
>
> Is there something wrong with Apache2::AuthCookieDBI::_dbi_connect ?
>
> Or should I just cron a task to ping the application every hour?
>
> Thanks!
>
> Tosh
>
> --
> McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/
>