develooper Front page | perl.perl5.porters | Postings from April 2008

RE: forking problem

Thread Next
Aschwin van der Woude
April 23, 2008 01:50
RE: forking problem
Message ID:

Oops, forgot to mention the most important bits.

This is on Linux (Debian Etch) with version 3.5.3 of TPP behind Apache
version 2.2.3.

After some more trial and error we discovered that the "open STDERR,
'>/dev/null'" statement is not liked by fork(). Merely commenting that
statement makes it work again.

I've also checked out the latest svn version and there STDERR is
redirected to STDOUT, which also makes fork() happy.

I am not sure if this a perl bug or perhaps a wrong use of fork(). The
documentation isn't too clear on this issue. Naturally, STDOUT needs to
be reopened to keep apache happy. But it isn't clear to me why STDERR is
causing these problems.

But it works again, so I am happy.


ps. I am cross-posting this to the perl mailinglist in case they have
more clues about it.

On Tue, 2008-04-22 at 11:59 -0700, Brian Pratt wrote:
> What platform is this on (linux, cygwin, mingw, vc8, Darwin?)?
> Are you using the latest code?  We've been working in this area lately.
> Brian
> -----Original Message-----
> From:
> [] On Behalf Of Aschwin van der
> Woude
> Sent: Tuesday, April 22, 2008 9:44 AM
> To:
> Cc: veronika.suni
> Subject: forking problem
> Hi,
> After pounding my head on a fork, I don't seem to get any wiser. 
> The problem is that doesn't execute any of the external
> commands. The required path settings are all correctly set. And if I run
> the suggested commands by hand they do work. It ain't a permission
> problem either, as they are wide open atm.
> After digging into the code I sprinkled some printToLog statements
> around the fork statement, and for some reason the code doesn't get
> beyond the fork().
> I do see the following error in the apache logs, which I am not sure if
> it relates as it is triggered every time a page is loaded:
> Use of uninitialized value in concatenation (.) or string
> at (eval 22) line 43., referer:
> Nor is it clear where this bug is located, it seems likely to be in one
> of the many string-blocks.
> Unfortunately, some googling for fork() problems didn't reveal anything
> useful.
> So I am hoping one of you can get that damn fork out of my head so I'll
> be smart *ugh* *ugh* again.
> Thanks for any hints,
> -Aschwin
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "spctools-discuss" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at
> -~----------~----~----~----~------~----~------~--~---

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About