Good suggestion, what I see is:

apache starts up and does what I'd expect
it receives a GET for the test script
it stats test.cgi and says yep
it looks for and finds an .htaccess file in the path, then authenticates okay
it forks, does a couple of lwp things, a bunch of memory things, and creates a door
one error during this, an invalid argument:

lwp_schedctl(SC_DOOR, 0, 0x00000000) Err#22 EINVAL
a bunch more lwp stuff, and a little more memory stuff
then goes:
chdir("/u/callum/public_html/cgi_test") = 0
then 7 closes one after another, before:
door_info(4, 0xEFFFAE70) = 0 door_call(4, 0xEFFFAE58) = 0 door_info(4, 0xEFFF9270) = 0 door_call(4, 0xEFFF9258) = 0 *** process killed ***
And the child dies

Then the error handling kicks in:

Errors are written to logs
The 500 error handler script is invoked
lwp, memory, and door stuff, the same EINVAL error
chdirs to the directory with the error handling script in
a bunch of closes one after the other
then it executes the error handling script as it should.

So, it can stat the script and chdir to the directory, then seems to die for no reason that's evident to me.

Time I suspect to wade line by line through the truss output I guess.


In reply to Re: Re: Apache/CGI error: "Premature end of script headers" by Callum
in thread Apache/CGI error: "Premature end of script headers" by Callum

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.