You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Qasem Sweilem <qa...@alqudsnet.com> on 2006/07/02 16:39:09 UTC

Threads under Apache2 and mod-perl2 problem

Hi,

I have a problem running threads under mod perl. I always get a "zero sized 
reply" in the browser.

it works fine under normal cgi and in the shell.

Note: I have perl 5.8.6, and Apache2.0 with mod-perl2

when typing: perl -V:useithreads -V:usemultiplicity
I get: useithreads='define';
  usemultiplicity='define';

Here is the simple test script im trying to run:

--------------------
use threads;

$thr = threads->new(\&sub1);
@ReturnData = $thr->join;

print "Thread returned @ReturnData \n";

sub sub1 {
	return "Fifty-six";
}
---------------------

Is there anything required which I miss?

thanks  in advance
Qasem



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Threads under Apache2 and mod-perl2 problem

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Qasem Sweilem wrote:
> Hi,
> 
> I have a problem running threads under mod perl. I always get a "zero sized 
> reply" in the browser.
I haven't the foggiest what the problem is, but its failing because your server
is seg-faulting. Check your error_log.

Alias /perl-reg /usr/local/software/perl-scripts
<Location /perl-reg>
   SetHandler perl-script
   PerlResponseHandler ModPerl::Registry
   Options +ExecCGI
</Location>

LoadModule cgid_module modules/mod_cgid.so
ScriptAlias /cgi-bin /usr/local/software/cgi-bin
Scriptsock logs/cgisock

./test.pl
Content-Type: text/plain
Thread returned Fifty-six

GET http://localhost:8000/cgi-bin/test.pl
Thread returned Fifty-six

GET http://localhost:8000/perl-reg/test.pl
500 Server closed connection without sending any data back

tail error_log
[Sun Jul 02 16:02:16 2006] [notice] child pid 20687 exit signal Segmentation fault (11), possible coredump in 
/usr/local/software/frebsd-6.1-stable/3.4.4/httpd/2.2.2/worker

sudo killall -9 httpd
./httpd -X
gdb httpd 21887
[Switching to LWP 100136]
0x2818a87b in pthread_testcancel () from /usr/lib/libpthread.so.2
(gdb) c
Continuing.

[in another window GET http://localhost:8000/perl-reg/test.pl]


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x8895800 (LWP 100137)]
0x2839c9f3 in Perl_gv_fetchpv (my_perl=0x88db000, nambeg=0xbf7fc460 "Apache2::RequestRec::", add=1, sv_type=11) at gv.c:721
721                 if (!stash || !SvREFCNT(stash)) /* symbol table under destruction */
(gdb) bt
#0  0x2839c9f3 in Perl_gv_fetchpv (my_perl=0x88db000, nambeg=0xbf7fc460 "Apache2::RequestRec::", add=1, sv_type=11) at 
gv.c:721
#1  0x2839c7da in Perl_gv_stashpvn (my_perl=0x88db000, name=0x28368c34 "Apache2::RequestRec", namelen=21, create=1) at 
gv.c:671
#2  0x2839c730 in Perl_gv_stashpv (my_perl=0x88db000, name=0x28368c34 "Apache2::RequestRec", create=1) at gv.c:640
#3  0x28427953 in Perl_newSVrv (my_perl=0x88db000, rv=0x895c024, classname=0x28368c34 "Apache2::RequestRec") at sv.c:7858
#4  0x284279e7 in Perl_sv_setref_pv (my_perl=0x88db000, rv=0x895c024, classname=0x28368c34 "Apache2::RequestRec", 
pv=0x88cb050) at sv.c:7890
#5  0x2834ec79 in PerlIOApache_getarg (my_perl=0x88db000, f=0x833bc04, param=0xbf7fc950, flags=1) at modperl_io_apache.c:88
#6  0x2849d869 in PerlIOBase_dup (my_perl=0x88db000, f=0x88d9104, o=0x833bc04, param=0xbf7fc950, flags=1) at perlio.c:2212
#7  0x28499e52 in PerlIO_fdupopen (my_perl=0x88db000, f=0x833bc04, param=0xbf7fc950, flags=1) at perlio.c:541
#8  0x2842ba7f in Perl_fp_dup (my_perl=0x88db000, fp=0x833bc04, type=0 '\0', param=0xbf7fc950) at sv.c:9682
#9  0x2849a3a1 in PerlIO_clone (my_perl=0x88db000, proto=0x833f000, param=0xbf7fc950) at perlio.c:649
#10 0x28430bac in perl_clone (proto_perl=0x833f000, flags=2) at sv.c:11071
#10 0x28430bac in perl_clone (proto_perl=0x833f000, flags=2) at sv.c:11071
#18 0x280ab85d in rlock_release () from /libexec/ld-elf.so.1
#44 0x284d35a8 in __JCR_LIST__ () from /usr/local/software/frebsd-6.1-stable/3.4.4/perl/5.8.8-ithread/lib/CORE/libperl.so
#45 0x0833f000 in ?? ()
#46 0xbf7fcaf8 in ?? ()
#47 0x2841496d in Perl_pp_entersub (my_perl=0x833f000) at pp_hot.c:2877
Previous frame identical to this frame (corrupt stack?)


that was perl 5.8.8-ithread, httpd 2.2.2-worker, mod_perl2.0.2

yuck.....

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org