--On Wednesday, June 28, 2000 4:35 PM +0200 ubr
<[EMAIL PROTECTED]> wrote:
> Hello mailinglist, i have a problem...
>
> I wrote a mod_perl-script running on an Apache-Server which has
> to receive a GIF-File from a NT-Server via a IO::Socket. (see code below)
> On the NT-side there is a JAVA-programm.
>
> Here some information about the used software:
> (A) my workstation:
> Linux 2.2.13
> Apache/1.3.9 (Unix) (SuSE/Linux) PHP/3.0.12 mod_perl/1.21
> perl, version 5.005_03
> (B) production server:
> Linux 2.2.7
> Apache/1.3.6 (Unix) (SuSE/Linux) PHP/3.0.7 mod_perl/1.19
> perl, version 5.005_02
> (C) test-server:
> Linux 2.2.5
> Apache/1.3.4 (Unix) (SuSE/Linux) PHP/3.0.7 mod_perl/1.18
> perl, version 5.005_02
>
> I developed and tested the script on my workstation (A) and it worked.
> Moving to the production server (B) or another test-server (C) the
> mod_perl-script seems to crash without a sigh (C) or doesn´t receive
> the whole file (B).
>
I'm not all that familiar with the various issues surrounding the earlier
releases of mod_perl, but you do notice the above trend. Earlier versions
of mod_perl and Apache have the problem, the later do not. Mod_perl's
current release is 1.24 and apache is 1.3.12. Unless there's a
show-stopper bug in the most recent version of something, I like to keep up
to date so that I don't rediscover something that has already been fixed.
> I have concentrated on the more severe problem (crashing on test-server
> C).
>
> The script cycles through the while-loop receiving a packet, sends
> a newline to the JAVA-program and writes to the IMG-Handle.
> And then after some packets it dies, just before the handshaking newline.
>
> The debugging output "GetFile: ready" does´nt appear in the logfile
> (GISLOG) and the function does´nt return to the main program (No further
> output in GISLOG)
>
Looking at your code, one thing I think might be quite problematics is the
use of the "die" statement. According to the eagle book, except during
apache initialization and startup, die does not necessarily behave as
advertised. I suggest that instead you print to STDERR since apache
reopens that handle to point to error_log, and then simply return with an
SERVER_ERROR set. That way apache handles it as apache was designed to do,
and you won't suffer any of the possible negative consequences of "die".
That might get you a long way towards figuring out what all is going on.
And don't overlook the profuse use of "print STDERR" to write out debugging
information to the error_log. That one mechanism has helped me to find
more bugs than I'm even willing to admit to have had.
Hope that's helpful.
-- Rob
_ _ _ _ _ _ _ _ _ _
/\_\_\_\_\ /\_\ /\_\_\_\_\_\
/\/_/_/_/_/ /\/_/ \/_/_/_/_/_/ QUIDQUID LATINE DICTUM SIT,
/\/_/__\/_/ __ /\/_/ /\/_/ PROFUNDUM VIDITUR
/\/_/_/_/_/ /\_\ /\/_/ /\/_/
/\/_/ \/_/ /\/_/_/\/_/ /\/_/ (Whatever is said in Latin
\/_/ \/_/ \/_/_/_/_/ \/_/ appears profound)
Rob Tanner
McMinnville, Oregon
[EMAIL PROTECTED]