You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Randy Kobes <ra...@theoryx5.uwinnipeg.ca> on 2004/07/10 03:23:21 UTC

[apreq-2] cgi tests

With the current cvs version of apreq-2, I get (on Win32,
perl-5.8.0, Apache/2.0.50) the cgi tests hanging (the tests
don't even start, and nothing is in the error log), both
under env/ and in the perl glue. The rest of the tests are
all fine (save for a \r issue in one of the perl subtests),
again under env/ and in the perl glue. I was just wondering
if this was premature testing, or instead it looks like
something peculiar to Win32. Thanks.

-- 
best regards,
randy

Re: [apreq-2] cgi tests

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Sat, 10 Jul 2004, Joe Schaefer wrote:

> Randy Kobes <ra...@theoryx5.uwinnipeg.ca> writes:
>
> [...]
>
> > I knew that in the back of my mind - I was just hoping it
> > wasn't just a Win32 problem :)
> >
> > You're right about apreq_env.c - if in cgi_log() I change
> > the apr_file_printf(err, ...) to fprintf(stderr, ...),
> > the cgi tests run. This is with keeping the current
> > cgi_header_out(), and also even keeping within cgi_log()
> > the apr_file_open_stderr(&err, p) call.
>
> Have you tried running any of the env/cgi/test_cgi manually?
> IOW just run the cgi-script as an executable program from the
> command prompt and see what happens. To do this you need to set
> the environment manually, and the POST tests will hang until stdin
> is closed  It might be worthwhile to add a perl script to cvs that
> does all this).

I'll try that - that's a good idea about using the
script ...

> I actually suspect the hanging problem might be in httpd/mod_cgi's
> use of apr_pollset_poll- the Win32 implementation may be broken,
> but I'm not certain.  You might try running this by William Rowe
> to see if he's got any clues.

OK, I'll do that, once I see what happens when it's
run from the command line.

> In any case, here's my +1 to just note this issue in STATUS
> and use appropriate #ifdef WIN32 stuff in apreq_env.c to get
> all the tests passing again.

Thanks - I just made a change that did that.

-- 
best regards,
randy

Re: [apreq-2] cgi tests

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Randy Kobes <ra...@theoryx5.uwinnipeg.ca> writes:

[...]

> I knew that in the back of my mind - I was just hoping it
> wasn't just a Win32 problem :)
> 
> You're right about apreq_env.c - if in cgi_log() I change
> the apr_file_printf(err, ...) to fprintf(stderr, ...),
> the cgi tests run. This is with keeping the current
> cgi_header_out(), and also even keeping within cgi_log()
> the apr_file_open_stderr(&err, p) call.

Have you tried running any of the env/cgi/test_cgi manually?
IOW just run the cgi-script as an executable program from the 
command prompt and see what happens. To do this you need to set
the environment manually, and the POST tests will hang until stdin
is closed  It might be worthwhile to add a perl script to cvs that
does all this).

I actually suspect the hanging problem might be in httpd/mod_cgi's 
use of apr_pollset_poll- the Win32 implementation may be broken,
but I'm not certain.  You might try running this by William Rowe 
to see if he's got any clues.

In any case, here's my +1 to just note this issue in STATUS 
and use appropriate #ifdef WIN32 stuff in apreq_env.c to get 
all the tests passing again.

-- 
Joe Schaefer


Re: [apreq-2] cgi tests

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Fri, 9 Jul 2004, Joe Schaefer wrote:

> Randy Kobes <ra...@theoryx5.uwinnipeg.ca> writes:
>
> > With the current cvs version of apreq-2, I get (on Win32,
> > perl-5.8.0, Apache/2.0.50) the cgi tests hanging (the tests
> > don't even start, and nothing is in the error log), both
> > under env/ and in the perl glue. The rest of the tests are
> > all fine (save for a \r issue in one of the perl subtests),
> > again under env/ and in the perl glue.
>
> I've been working on both the cgi env in src/apreq_env.c and
> the cgi tests.  The most significant change was to replace
> stdio with apr_file_io by using apr_file_std*_open.  Try going
> back to printf in apreq_env.c's cgi_log and cgi_header_out,
> and let me know if the cgi tests start passing on Win32,
>
> > I was just wondering if this was premature testing, or instead
> > it looks like something peculiar to Win32.
>
> Not at all- I run the test suite before every commit, so I
> am expecting cvs to always pass the tests.

I knew that in the back of my mind - I was just hoping it
wasn't just a Win32 problem :)

You're right about apreq_env.c - if in cgi_log() I change
the apr_file_printf(err, ...) to fprintf(stderr, ...),
the cgi tests run. This is with keeping the current
cgi_header_out(), and also even keeping within cgi_log()
the apr_file_open_stderr(&err, p) call.

Just to see if it might be a problem with
apr_file_open_stderr() itself on Win32, I tried
the following standalone program:
==========================================================
#include <stdio.h>
#include "apreq.h"
#include "apreq_env.h"
#include "apr_strings.h"
#include "apr_lib.h"
#include "apr_env.h"
#include "apr_file_io.h"
int main(int argc, char const * const * argv)
{
    apr_pool_t *pool;
    apr_file_t *err, *out;

    atexit(apr_terminate);
    if (apr_app_initialize(&argc, &argv, NULL) != APR_SUCCESS) {
        fprintf(stderr, "apr_app_initialize failed\n");
        exit(-1);
    }

    if (apr_pool_create(&pool, NULL) != APR_SUCCESS) {
        fprintf(stderr, "apr_pool_create failed\n");
        exit(-1);
    }

    apr_file_open_stderr(&err, pool);
    apr_file_open_stdout(&out, pool);
    apr_file_printf(err, "%s", "hello");
    apr_file_printf(out, "%s", "goodbye");
    apr_file_flush(err);
    apr_file_flush(out);
}
==========================================================
but it worked OK. I'll keep looking, though - thanks.

-- 
best regards,
randy

Re: [apreq-2] cgi tests

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Randy Kobes <ra...@theoryx5.uwinnipeg.ca> writes:

> With the current cvs version of apreq-2, I get (on Win32,
> perl-5.8.0, Apache/2.0.50) the cgi tests hanging (the tests
> don't even start, and nothing is in the error log), both
> under env/ and in the perl glue. The rest of the tests are
> all fine (save for a \r issue in one of the perl subtests),
> again under env/ and in the perl glue.

I've been working on both the cgi env in src/apreq_env.c and 
the cgi tests.  The most significant change was to replace 
stdio with apr_file_io by using apr_file_std*_open.  Try going 
back to printf in apreq_env.c's cgi_log and cgi_header_out,
and let me know if the cgi tests start passing on Win32,

> I was just wondering if this was premature testing, or instead
> it looks like something peculiar to Win32.

Not at all- I run the test suite before every commit, so I 
am expecting cvs to always pass the tests.  I have a few 
perl-glue commits pending, but they won't affect the perl 
test results.

-- 
Joe Schaefer