Segment Fault when creating a thread

2011-08-23 Thread Mike OK
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);
}

Re: Segment Fault when creating a thread

2011-08-23 Thread Fred Moyer
Might want to try 2.0.5 which is about 6 months old.

On Tue, Aug 23, 2011 at 2:23 PM, Mike OK m...@acorg.com 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);
 }


Re: Segment Fault when creating a thread

2011-08-23 Thread Mike OK
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 f...@redhotpenguin.com

To: Mike OK m...@acorg.com
Cc: mod_perl list modperl@perl.apache.org
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 m...@acorg.com 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);
} 




Re: Segment Fault when creating a thread

2011-08-23 Thread Fred Moyer
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 m...@acorg.com 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 f...@redhotpenguin.com
 To: Mike OK m...@acorg.com
 Cc: mod_perl list modperl@perl.apache.org
 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 m...@acorg.com 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);
 }




Re: [ANNOUNCE] mod_perl 2.0.5

2011-08-23 Thread Hans Scharler
Any word on the release of mod_perl 2.0.6?

I will be glad to test to see if it solves the Apache restart issue when a
client stops the browser.

Thanks,
Hans


On Mon, May 30, 2011 at 8:31 PM, Fred Moyer f...@redhotpenguin.com wrote:

 You might try pulling and building from svn trunk, Steve Hay fixed
 something that may be related.  I don't have enough WinFoo to say for
 sure.  Or wait another 4-6 weeks for 2.0.6.

 http://perl.apache.org/download/source.html

 =item 2.0.6-dev

 PerlIOApache_flush() and mpxs_Apache2__RequestRec_rflush() now no longer
 throw
 exceptions when modperl_wbucket_flush() fails if the failure was just a
 reset
 connection or an aborted connection. The failure is simply logged to the
 error
 log instead. This should fix cases of httpd.exe crashing when users press
 the
 Stop button in their web browsers.
 [Steve Hay]

 On Sun, May 29, 2011 at 7:56 PM, Hans Scharler hschar...@gmail.com
 wrote:
  Yes, the entire process restarts.
  Here is the exact line:
  ModPerl::Util::exit: (12) exit was called at
  D:/InterfaceServer/Perl/lib/CGI/Carp.pm line 561
  [Sun May 29 05:25:10 2011] [notice] Parent: child process exited with
 status
  255 -- Restarting.
  It's a notice.
  I did some further testing and found that it restarts and exits apache
 when
  the application is printing to the browser. So, if you have a bunch of
 data
  to send to the browser and the connection stops in the middle, it throws
  the above error.
  my $template = Lots of data ..;
  print $template;
  Is there a better way to transfer lots of data to the browser?
  This is where I was able to to track it down to. If I stop the browser
  before it hits this print line, the ModPerl::Util::exit(0) works.
  Thanks fro taking a look.
  Hans
 
  On Sun, May 29, 2011 at 3:07 PM, Thomas den Braber tho...@delos.nl
 wrote:
 
  Hans,
 
   ModPerl::Util::exit: (12) exit was called at
   D:/InterfaceServer/Perl/lib/CGI/Carp.pm line 561
   Parent: child process exited with status 255 -- Restarting.
 
  I have done a lot of testing on windows with the 2.05 release and have
 not
  seen this error before. It must be something specific in your code. It
  looks like the exit command is triggers some where in your code (
  http://perl.apache.org/docs/2.0/api/ModPerl/Util.html#C_exit_ ).
 
  Does it also restart Apache?
 
  I have done some testing with calling ModPerl::Util::exit(0) (that's
 what
  is actually done in CGI::Carp) and did not found an error in my log.
 does
  it say [error] or [warn] in your log file ?
 
  --
  Thomas