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

Mailing List Archive: ModPerl: ModPerl

Segment Fault when creating a thread

 

 

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


mike at acorg

Aug 23, 2011, 2:23 PM

Post #1 of 4 (1136 views)
Permalink
Segment Fault when creating a thread

I must have a problem with my mod_perl set up. When I try to run this script, I get a "child pid 451 exit signal Segmentation fault (11)". It seems that creating the thread causes the error. This is the startup line from the log file with the apache, mod_perl, and perl versions.

Apache/2.2.11 (Unix) mod_perl/2.0.4 Perl/v5.8.5 configured -- resuming normal operations

The script that causes a failure is

#!/usr/bin/perl -wT

use strict;
use threads;
use threads::shared;

my $temp = threads->new(\&foo,"mike");
exit;

sub foo {
my $input = shift;
my $number = int(rand(10));
print "this went in the thread\n";
return($number);
}


fred at redhotpenguin

Aug 23, 2011, 2:26 PM

Post #2 of 4 (1098 views)
Permalink
Re: Segment Fault when creating a thread [In reply to]

Might want to try 2.0.5 which is about 6 months old.

On Tue, Aug 23, 2011 at 2:23 PM, Mike OK <mike [at] acorg> wrote:
> I must have a problem with my mod_perl set up.  When I try to run this
> script, I get a "child pid 451 exit signal Segmentation fault (11)".  It
> seems that creating the thread causes the error. This is the startup line
> from the log file with the apache, mod_perl, and perl versions.
>
> Apache/2.2.11 (Unix) mod_perl/2.0.4 Perl/v5.8.5 configured -- resuming
> normal operations
>
> The script that causes a failure is
>
> #!/usr/bin/perl -wT
>
> use strict;
> use threads;
> use threads::shared;
>
> my $temp = threads->new(\&foo,"mike");
> exit;
>
> sub foo {
>    my $input = shift;
>    my $number = int(rand(10));
>    print "this went in the thread\n";
>    return($number);
> }


mike at acorg

Aug 23, 2011, 2:58 PM

Post #3 of 4 (1093 views)
Permalink
Re: Segment Fault when creating a thread [In reply to]

Thanks for the tip Fred. I just now upgraded to 2.0.5 but still get the
same error.

Mike


----- Original Message -----
From: "Fred Moyer" <fred [at] redhotpenguin>
To: "Mike OK" <mike [at] acorg>
Cc: "mod_perl list" <modperl [at] perl>
Sent: Tuesday, August 23, 2011 5:26 PM
Subject: Re: Segment Fault when creating a thread


Might want to try 2.0.5 which is about 6 months old.

On Tue, Aug 23, 2011 at 2:23 PM, Mike OK <mike [at] acorg> wrote:
> I must have a problem with my mod_perl set up. When I try to run this
> script, I get a "child pid 451 exit signal Segmentation fault (11)". It
> seems that creating the thread causes the error. This is the startup line
> from the log file with the apache, mod_perl, and perl versions.
>
> Apache/2.2.11 (Unix) mod_perl/2.0.4 Perl/v5.8.5 configured -- resuming
> normal operations
>
> The script that causes a failure is
>
> #!/usr/bin/perl -wT
>
> use strict;
> use threads;
> use threads::shared;
>
> my $temp = threads->new(\&foo,"mike");
> exit;
>
> sub foo {
> my $input = shift;
> my $number = int(rand(10));
> print "this went in the thread\n";
> return($number);
> }


fred at redhotpenguin

Aug 23, 2011, 3:15 PM

Post #4 of 4 (1099 views)
Permalink
Re: Segment Fault when creating a thread [In reply to]

I'm not that knowledgeable on threads, but this guy managed to get the
working with mpm_worker a month or so ago:

http://www.gossamer-threads.com/lists/modperl/modperl/103420

That is still a rather old version of Perl, so I would suggest trying
5.10 or something newer.

On Tue, Aug 23, 2011 at 2:58 PM, Mike OK <mike [at] acorg> wrote:
> Thanks for the tip Fred.  I just now upgraded to 2.0.5 but still get the
> same error.
>
> Mike
>
>
> ----- Original Message ----- From: "Fred Moyer" <fred [at] redhotpenguin>
> To: "Mike OK" <mike [at] acorg>
> Cc: "mod_perl list" <modperl [at] perl>
> Sent: Tuesday, August 23, 2011 5:26 PM
> Subject: Re: Segment Fault when creating a thread
>
>
> Might want to try 2.0.5 which is about 6 months old.
>
> On Tue, Aug 23, 2011 at 2:23 PM, Mike OK <mike [at] acorg> wrote:
>>
>> I must have a problem with my mod_perl set up. When I try to run this
>> script, I get a "child pid 451 exit signal Segmentation fault (11)". It
>> seems that creating the thread causes the error. This is the startup line
>> from the log file with the apache, mod_perl, and perl versions.
>>
>> Apache/2.2.11 (Unix) mod_perl/2.0.4 Perl/v5.8.5 configured -- resuming
>> normal operations
>>
>> The script that causes a failure is
>>
>> #!/usr/bin/perl -wT
>>
>> use strict;
>> use threads;
>> use threads::shared;
>>
>> my $temp = threads->new(\&foo,"mike");
>> exit;
>>
>> sub foo {
>> my $input = shift;
>> my $number = int(rand(10));
>> print "this went in the thread\n";
>> return($number);
>> }
>
>

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.