SPUG: unsupported %SIG in ActivePerl??

Chris Petersen lists at forevermore.net
Tue Apr 9 13:01:36 CDT 2002

Hi, on the advice of a coworker, I signed up for the spug-list..  
hopefully someone here can help me out with a particular problem I'm 
having with ActivePerl...

Basically, I have a rather large collection of web robots (300+), and I've
written a scheduler for them based on the pre-forking server model
presented in the perl documentation (with a few modifications since that
one doesn't work quite right under linux - and NOTHING works in windows).  
Most people in alt.perl.* just tell me not to use NT/2k (which is my
opinion, too) but that's not really an option, and I'm hoping that someone
here can help me out with a workaround.

Sorry for the lack of re-editing, but it's a lot easier to just forward 
the message I sent to ActiveState than try to rewrite it - all of the 
information is the same.



you list the standard perl IPC docs at:


However, I've copied this code almost verbatim into a pre-forking server
that I wrote (it works perfectly in linux and under cygwin)..  However, it
never receives $SIG{CHLD} handlers when I run it in Windows (98, NT and
2000).  Again following the code you list, I ran:

	use Config;

	foreach $name (split(' ', $Config{sig_name})) {
		print "$name\n";

This resulted in a rather lengthy list of signal handlers, including CHLD.  
This tells me that NT should be supporting the signal properly.

The pre-forking server is designed to run $Max forked processes (which
basically "require" a subscript and then exit), and to fork off new ones
when the old ones die off..  However, since $SIG{CHLD} is never received,
it merely runs $Max scripts and then hangs, waiting for them to finish,
even when the processes themselves consist entirely of something to the
extent of:

	print "test\n";

$SIG{INT} and other similar signals *do* work, so it's seemingly only the 
CHLD (and possibly other related) signal that doesn't.  I've tracked the 
memory usage of perl while the pre-forking server runs, and the block does 
grow appropriately for each instance of a forked process, and eventually 
deflates back down after a few seconds, as the subscripts finish (telling 
me that fork itself is working fine).

I need to confirm with you that this is a bug in your software or a glitch 
in Windows (I'm pretty sure it's not my code since it's the same code that 
pops up all over the place in the perl IPC docs - includin the ones you 
publish on your site).  If it is a fixable error, do you have any idea 
when a working version of ActivePerl might be available?


Chris Petersen
Programmer, VersusLaw Inc.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org

More information about the spug-list mailing list