Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

mod_perl and mod_cgi problems

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


magnar at genuity

Jan 29, 2003, 7:34 AM

Post #1 of 6 (528 views)
Permalink
mod_perl and mod_cgi problems

Hi!

On my Solaris 5.8 machine I'm running apache 1.3.27 with mod_cgi and mod_perl
1.0. mod_cgi is compiled into apache and mod_perl are loaded in my httpd.conf.

When I'm requesting for any .cgi script (tested with: #!/usr/bin/perl or
#!/bin/sh) everything works fine, and the scripts compile and return a 200
message to my browser. But after a request that involves mod_perl - .mpl
(#!/usr/bin/perl), these cgi scripts crashes with "500: internal server error"

This is the error.log:
libthread panic: cannot create new lwp : dumping core (PID: 9028 LWP 2)
stacktrace:
ff052030
0

If I start a truss -p on the apache process (all processes) the request will be
OK and reply a 200 OK message. After I've turned off all trusses, the
errormessage is still there.

Then I need to restart apache and all cgi scripts are working fine again.

What can I do to solve this?

Regards, Magnar


stas at stason

Jan 29, 2003, 3:40 PM

Post #2 of 6 (491 views)
Permalink
Re: mod_perl and mod_cgi problems [In reply to]

Magnar Stav Johanssen wrote:
> Hi!
>
> On my Solaris 5.8 machine I'm running apache 1.3.27 with mod_cgi and
> mod_perl 1.0. mod_cgi is compiled into apache and mod_perl are loaded in
> my httpd.conf.
>
> When I'm requesting for any .cgi script (tested with: #!/usr/bin/perl or
> #!/bin/sh) everything works fine, and the scripts compile and return a
> 200 message to my browser. But after a request that involves mod_perl -
> .mpl (#!/usr/bin/perl), these cgi scripts crashes with "500: internal
> server error"
>
> This is the error.log:
> libthread panic: cannot create new lwp : dumping core (PID: 9028 LWP 2)
> stacktrace:
> ff052030
> 0
>
> If I start a truss -p on the apache process (all processes) the request
> will be OK and reply a 200 OK message. After I've turned off all
> trusses, the errormessage is still there.
>
> Then I need to restart apache and all cgi scripts are working fine again.
>
> What can I do to solve this?

Have you tried looking in the archives? I have found:
http://marc.theaimsgroup.com/?l=apache-modperl&w=2&r=1&s=libthread+panic&q=b

In particular:
http://marc.theaimsgroup.com/?l=apache-modperl&m=91763462706496&w=2
http://marc.theaimsgroup.com/?l=apache-modperl&m=97363770902299&w=2

__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas [at] stason http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com


magnar at genuity

Jan 30, 2003, 6:51 AM

Post #3 of 6 (494 views)
Permalink
Re: mod_perl and mod_cgi problems [In reply to]

Sending you a piece of my httpd.conf file:

LoadModule perl_module /local/lib/apache/libperl.so

AddHandler cgi-script .cgi

<IfModule mod_perl.c>
<Location /tools/admin/perl-status>
SetHandler perl-script
PerlHandler Apache::Status
PerlSetVar StatusDumper On
PerlSetVar StatusPeek On
PerlSetVar StatusGraph On
</Location>
</IfModule>

<IfModule mod_perl.c>
PerlFreshRestart On
PerlSetupEnv On
PerlSendHeader On
AddHandler perl-script .mpl
PerlHandler Apache::Registry
</IfModule>

-> I've tryed using "PerlHandler Apache::PerlRun" with same result as
Apache::Registry. Adding "PerlSetVar PerlRunOnce On" -> everything works fine,
but then again whats the need of using mod_perl then?

mod_perl and apache are compiled using the same compiler (cc is
/local/CC/SUNWspro/bin/cc)

$ httpd -l
Compiled-in modules:
http_core.c
mod_env.c
mod_define.c
mod_log_config.c
mod_mime.c
mod_status.c
mod_info.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_alias.c
mod_go.c
mod_access.c
mod_auth.c
mod_auth_anon.c
mod_auth_dbm.c
mod_auth_db.c
mod_expires.c
mod_headers.c
mod_unique_id.c
mod_so.c
mod_setenvif.c

Stas Bekman wrote:
> Magnar Stav Johanssen wrote:
>> What can I do to solve this?
>
>
> Have you tried looking in the archives? I have found:
> http://marc.theaimsgroup.com/?l=apache-modperl&w=2&r=1&s=libthread+panic&q=b

Well, I've used google.com alot, but maybe I didn't push the "magic" button!

>
>
> In particular:
> http://marc.theaimsgroup.com/?l=apache-modperl&m=91763462706496&w=2

For testing I've tuned down my MaxServers to 5 so I easier can trace httpd. In
production MaxServers has been tuned for its amount of Memory!

> http://marc.theaimsgroup.com/?l=apache-modperl&m=97363770902299&w=2

The latest "Linker patch" are installed on the server...

Regards!


stas at stason

Jan 30, 2003, 3:29 PM

Post #4 of 6 (487 views)
Permalink
Re: mod_perl and mod_cgi problems [In reply to]

Magnar Stav Johanssen wrote:
> Sending you a piece of my httpd.conf file:
[...]

looks fine to me.

>> Have you tried looking in the archives? I have found:
>> http://marc.theaimsgroup.com/?l=apache-modperl&w=2&r=1&s=libthread+panic&q=b
>
> Well, I've used google.com alot, but maybe I didn't push the "magic"
> button!

No need to google, pick your favorite archive from:
http://perl.apache.org/maillist/modperl.html#Searchable_Archives
(hint: linked from the menu)

>> In particular:
>> http://marc.theaimsgroup.com/?l=apache-modperl&m=91763462706496&w=2
>
>
> For testing I've tuned down my MaxServers to 5 so I easier can trace
> httpd. In production MaxServers has been tuned for its amount of Memory!
>
>> http://marc.theaimsgroup.com/?l=apache-modperl&m=97363770902299&w=2
>
>
> The latest "Linker patch" are installed on the server...

In that case I hope that somebody else who's on Solaris could step in and help.

__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas [at] stason http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com


" at "<""@genuity

Jan 30, 2003, 5:01 PM

Post #5 of 6 (490 views)
Permalink
Re: mod_perl and mod_cgi problems [In reply to]

Thanks!

I've actually made some kind of progress on this case... I've found a
workaround... I don't fully like it, so if anyone got a sugestion for
aprovement, please tell me!

This was the "problem area" in my old httpd.conf:
(...)
AddHandler cgi-script .cgi
<IfModule mod_perl.c>
AddHandler perl-script .mpl
PerlHandler Apache::Registry
</IfModule>

I've converted it into this:
<IfModule mod_perl.c>
AddHandler perl-script .cgi
PerlHandler Apache::PerlRun
PerlSetVar PerlRunOnce On
</IfModule>

<IfModule mod_perl.c>
AddHandler perl-script .mpl
PerlHandler Apache::Registry
</IfModule>

This works fine, but it will only work for perl-scripts and not for
shell-scripts. Well, to bad! For the perl-script part it actually runs
faster! Apache don't need to fork any new processes to compile the cgi...

If I add the following line to my httpd.conf:
AddHandler cgi-script .sh

This will most likely (not tested) fail like .cgi did when I used
cgi-script-handler in apache... So the problem aren't solved yet!

Stas Bekman wrote:

>> The latest "Linker patch" are installed on the server...
>
>
> In that case I hope that somebody else who's on Solaris could step in
> and help.

I do hope that someone can explain to me why mod_cgi and mod_perl don't
work well together. It worked just fine using apache 1.3.14 and mod_perl
1.X (another version I can't remember). But with apache 1.3.27 and
mod_perl 1.27, it didn't.


stas at stason

Jan 30, 2003, 5:33 PM

Post #6 of 6 (485 views)
Permalink
Re: mod_perl and mod_cgi problems [In reply to]

"@(none) <"@genuity.no wrote:
> Thanks!
>
> I've actually made some kind of progress on this case... I've found a
> workaround... I don't fully like it, so if anyone got a sugestion for
> aprovement, please tell me!
>
> This was the "problem area" in my old httpd.conf:
> (...)
> AddHandler cgi-script .cgi
> <IfModule mod_perl.c>
> AddHandler perl-script .mpl
> PerlHandler Apache::Registry
> </IfModule>
>
> I've converted it into this:
> <IfModule mod_perl.c>
> AddHandler perl-script .cgi
> PerlHandler Apache::PerlRun
> PerlSetVar PerlRunOnce On
> </IfModule>
>
> <IfModule mod_perl.c>
> AddHandler perl-script .mpl
> PerlHandler Apache::Registry
> </IfModule>
>
> This works fine, but it will only work for perl-scripts and not for
> shell-scripts. Well, to bad! For the perl-script part it actually runs
> faster! Apache don't need to fork any new processes to compile the cgi...
>
> If I add the following line to my httpd.conf:
> AddHandler cgi-script .sh
>
> This will most likely (not tested) fail like .cgi did when I used
> cgi-script-handler in apache... So the problem aren't solved yet!

Any particular reason for using AddHandler and not SetHandler?



__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas [at] stason http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.