perl FCGI segmentation fault using ithreads ...

Igor Suarez-Sola <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hi,

I imagine this is not new, so apologies in advance if this has been 
disscussed already but I haven't found an answer yet.

I'd like to use FCGI and perl ithreads in the same application. However 
it looks like after one loop the application crashes with a segmentation 
fault.

This is a example that reproduce the problem.

use CGI::Fast qw(:standard *table *script *div start_ul -nosticky);
                                                                                 

use threads;
                                                                                 

my $count = 0;
my $request = FCGI::Request();
                                                                                 

while(new CGI::Fast()) {
{
     print("Content-type: text/html\r\n\r\n", ++$count,"\n");
     my @thArr =();
     for my $num (1..3)
     {
       my $thr = threads->create (\&dispatcher, $num);
       push @thArr, $thr;
     }
                                                                                 

     for my $th (@thArr)
     {
       my $r = $th->join;
       if (defined($r)) {
         print "Thread id [",$r->{tid},"] ;; Order num [",$r->{num},"] 
;; time [",$r->{time},"]\n";
       }
     }
}
                                                                                 

sub dispatcher {
my $num = shift;
# does nothing only returns a hash;
my $hash={};
$hash->{time}=gmtime;
$hash->{tid}=threads->self->tid;
$hash->{num}=$num;
return $hash;
}
                                                                                 

1;
#########################
If I call this cgi from apache I get in the logs:
[Thu Aug 05 14:27:07 2004] [warn] FastCGI: server 
"/var/www/cgi-bin/VSO_FAST/votest.pl" (pid 14843) terminated due to 
uncaught signal '11' (Segmentation fault)

If I run it manually I get a long list of errors like:
Attempt to free non-existent shared string 'SSH_ASKPASS', Perl 
interpreter: 0x8350438 during global destruction.


I'm using perl 5.8.5 , Apache/2.0.48 and mod_fastcgi 2.4.2

Any info is most welcome!

Thanks!

Igor

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.