So presumably it's that failure above, marked (***), which is where it's all gone wrong. Here's a stack trace showing the path to my_stat() which calls _fstati64():
=====
my_fstat(int 35, _stati64 * 0x02f3fb98) line 532
win32_fstat(int 35, _stati64 * 0x02f3fb98) line 2706 + 13 bytes
PerlLIOFileStat(IPerlLIO * 0x0141becc, int 35, _stati64 * 0x02f3fb98) line 974 + 13 bytes
PerlIOUnix_setfd(interpreter * 0x01b2004c, _PerlIO * * 0x01b20ee4, int 35, int 0) line 2348 + 30 bytes
PerlIOUnix_dup(interpreter * 0x01b2004c, _PerlIO * * 0x01b20ee4, _PerlIO * * 0x0108ec8c, clone_params * 0x00000000, int 2) line 2465 + 24 bytes
PerlIOBase_dup(interpreter * 0x01b2004c, _PerlIO * * 0x01b20ee4, _PerlIO * * 0x01b20e5c, clone_params * 0x00000000, int 2) line 2170 + 26 bytes
PerlIOBuf_dup(interpreter * 0x01b2004c, _PerlIO * * 0x01b20ee4, _PerlIO * * 0x01b20e5c, clone_params * 0x00000000, int 2) line 3871 + 25 bytes
PerlIO_fdupopen(interpreter * 0x01b2004c, _PerlIO * * 0x01b20e5c, clone_params * 0x00000000, int 2) line 536 + 35 bytes
Perl_do_openn(interpreter * 0x01b2004c, gv * 0x01fb0334, char * 0x01ac46dc, long 8, int 0, int 1, int 0, _PerlIO * * 0x00000000, sv * * 0x00000000, long 0) line 389 + 19 bytes
Perl_do_open(interpreter * 0x01b2004c, gv * 0x01fb0334, char * 0x1002c664 `string', long 8, int 0, int 1, int 0, _PerlIO * * 0x00000000) line 60 + 41 bytes
modperl_io_perlio_override_stdout(interpreter * 0x01b2004c, request_rec * 0x03386160) line 137 + 28 bytes
modperl_response_handler_cgi(request_rec * 0x03386160) line 918 + 13 bytes
ap_run_handler(request_rec * 0x03386160) line 195 + 78 bytes
ap_invoke_handler(request_rec * 0x03386160) line 401 + 9 bytes
ap_process_request(request_rec * 0x03386160) line 288 + 9 bytes
ap_process_http_connection(conn_rec * 0x0084c650) line 293 + 9 bytes
ap_run_process_connection(conn_rec * 0x0084c650) line 85 + 78 bytes
ap_process_connection(conn_rec * 0x0084c650, void * 0x0084c588) line 213
worker_main(long 19) line 731
_threadstartex(void * 0x0028def0) line 212 + 13 bytes
KERNEL32! 77e7d33b()
=====
I was just trying out your other suggestion of walking through a successful modperl_io_perlio_override_stdout() call, so I tried debugging a randomly chosen test that succeeds - api/lookup_uri - and I noticed that modperl_io_perlio_override_stdout() doesn't get run. Comparing the call stack to the above I have this from api/lookup_uri run:
===== [...] modperl_response_handler(request_rec * 0x03386160) line 879 + 11 bytes ap_run_handler(request_rec * 0x03386160) line 195 + 78 bytes ap_invoke_handler(request_rec * 0x03386160) line 401 + 9 bytes ap_process_request(request_rec * 0x03386160) line 288 + 9 bytes ap_process_http_connection(conn_rec * 0x0084c650) line 293 + 9 bytes ap_run_process_connection(conn_rec * 0x0084c650) line 85 + 78 bytes ap_process_connection(conn_rec * 0x0084c650, void * 0x0084c588) line 213 worker_main(long 19) line 731 _threadstartex(void * 0x0028def0) line 212 + 13 bytes KERNEL32! 77e7d33b() =====
i.e. the test that works (api/lookup_uri) calls modperl_response_handler() which calls modperl_response_handler_run() with little else first, whereas the test that fails (modperl\post_utf8) calls modperl_response_handler_cgi() which calls modperl_response_handler_run() after much more mucking around, including calls to modperl_io_override_stdin() and modperl_io_override_stdout().
This makes sense after reading
http://perl.apache.org/docs/2.0/user/config/config.html#C_modperl_ http://perl.apache.org/docs/2.0/user/config/config.html#C_perl_script_
and sure enough the various tests that fail, e.g.
apache\scanhdrs api\rflush modperl\post_utf8 modules\cgi
specify "SetHandler perl-script" in their .pm files, while the test above that succeeded (api\lookup_ui) specifies "SetHandler modperl" in its .pm file.
So it looks like rather than us having the redirection stuff oddly working for some tests and not for others, what we actually have is a case of it never working! The tests that work only do so because they use the "modperl" response handler which skips the tie()'ing of STDIN/STDOUT.
- Steve
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]