in reply to Re^3: CGI Perl output cut with xampp
in thread CGI Perl output cut with xampp

Hello,

I've removed the "odd number of elements in hash assignment" as well as all "\1 better written as $1" error messages and the "$* is no longer supported" message. Staying now are only some "Use of uninitialized value" messages after starting the Perl/CGI-application by calling the stating page.

With the next click I can call the error in my originally database. This should print out all existing FAQ independent from which category. It prints until title of FAQ 50 which is shown. Then it seems to hang a time. At last I get the following message:

[Fri Aug 19 12:54:35.185884 2016] [core:error] [pid 9868:tid 1728] (70007)The timeout specified has expired: [client 127.0.0.1:51845] AH00574: ap_content_length_filter: apr_bucket_read() failed, referer: http://localhost/faq/cgi-bin/faq.pl?kat=1

best regards

Replies are listed 'Best First'.
Re^5: CGI Perl output cut with xampp
by Corion (Patriarch) on Aug 19, 2016 at 11:18 UTC

    Now could be a good time to progressively trace the progress of your program by sprinkling warn statements around (maybe) the body of ausgabefaq to see where it hangs there, or maybe if it hangs before that or after that.

    When I visit the online link you posted earlier, I see all 58 (or how many, at least more than 50) FAQs in all categories...

      Hello everybody

      I have checked some other thing. I did manage to make the script run on command line. In this case the output doesn't stop and all information and the whole page is put out until the last closing /html. In this point of view it seems, that Perl can handle the script well and does not stop or cut the output. So I think it is possible, that the error comes in relation of XAMPP and Perl.

      The error message is:

      [Fri Sep 02 13:35:07.214332 2016] [core:error] [pid 9616:tid 1728] (70007)The timeout specified has expired: [client 127.0.0.1:64014] AH00574: ap_content_length_filter: apr_bucket_read() failed, referer: http://localhost/faq/cgi-bin/faq.pl?kat=1

      The length of the cut page (IE) is 138429 byte. The uncut HTML from command line is 222448 byte. The length of the error output from command line is 107708 byte.

      Thought this might be interesting to you.

      best regards

Re^5: CGI Perl output cut with xampp
by NetWallah (Canon) on Aug 19, 2016 at 14:16 UTC
    The symptoms (Hang/truncation) seem to match this bug report.

    Try to install a fix - sorry I'm not familiar enough with xampp distribution to locate that.

    You should also pay attention and look for potential bugs related to "use of uninitialized value".
    Those should have a line number, and variable name (in recent perl), and be easy to track and fix.

            "Software interprets lawyers as damage, and routes around them" - Larry Wall

      Hello everybody

      what NetWallah wrote at 19. Aug is true. This is the reason, why the output did hang and was driving into time out.

      How did I get to this? I managed to remove all error messages, respective warnings except of one. This one error message takes 96 bytes. So now the code was put out completely. So the problem is really in the amount of error output. This was described in the link postet above to the 10 year old problem with error buffer.

      So now all works fine. I thank you all. Have a nice day

      PS: NetWallah, I have seen you posted another comment. I have a Windows system. The time command there has another function as under Linux. So I cannot test. Also I have removed all points that did cause error messages. It took round about 2 sec to run the complete output on command line. The error did not appear, when I did run on command line.

      um, that bug was closed ten years ago

      Hi gods,

      That might be possible. I do not know how to test this. Because when the error emerges, the error.log might also be cut off. Only way in this seems to minimize the error output.

      best regards

        When you run the script from the command line, how long does it take before the output is seen ?

        You can use a command like:

        time perl <script-name>
        to get overall execution time.

        The message:
        70007)The timeout specified has expired
        seems to indicate that the apache web server timed-out waiting for the output to be produced.

        You could try to set the Timeout directive in httpd.conf, to something like 300 seconds (5 minutes).

        See https://httpd.apache.org/docs/2.4/mod/core.html#timeout.

        TimeOut Directive Description: Amount of time the server will wait for certain events before failing a request
        Syntax: TimeOut seconds
        Default: TimeOut 60
        Context: server config, virtual host
        Status: Core
        Module: core
        The TimeOut directive defines the length of time Apache httpd will wait for I/O in various circumstances:

        When reading data from the client, the length of time to wait for a TCP packet to arrive if the read buffer is empty.
        For initial data on a new connection, this directive doesn't take effect until after any configured AcceptFilter has passed the new connection to the server.

                "Software interprets lawyers as damage, and routes around them" - Larry Wall