Re: Problem Compiling with Perl 5.6.0

2000-04-03 Thread Randy Kobes

On Mon, 3 Apr 2000, Steve Hay wrote:
> Randy Kobes <[EMAIL PROTECTED]> wrote:
> > Steve Hay <[EMAIL PROTECTED]> wrote:
> > > $status = system "D:\\WINNT\\system32\\ipconfig.exe > D:\\Temp\\ip.txt";
> > >
> > > then it carries on fine under Apache (now re-directing the output to the
> > "ip.txt"
> > > file), but under Apache+mod_perl the $status gets set to 256, the "ip.txt"
> > file is
> > > not created and I get the error
> > >
> > > The handle could not be opened
> > > during redirection of handle 1.
> > >
> > > in error.log
> > >
> >
> > Hi Steve,
> > I've tried this with the latest cvs mod_perl snapshot, like you
> > use, with Perl 5.6.0 and Apache_1.3.12. I'm using Win98, with the
> > 4DOS tools. As a cgi-bin script,
> >  my $status = "ipconfig > C:\\test.txt"
> 
> [I take it you meant 'my $status = system "ipconfig > C:\\test.txt";' here?!]

Hi,
Yes, I did mean that .
> 
> >
> > returns $status = 0, and C:\test.txt capturing the output.
> > As an Apache::Registry script, the same thing returns
> > a status of 256 (with a DOS window briefly opening and
> > closing), but I get C:\test.txt still capturing the output. So it
> > may have something to do with the different DOS "shells"?
> 
> Eh?  I don't believe the DOS "shell" changed between Apache 1.3.6 and Apache
> 1.3.12!!

I didn't of course mean that the DOS "shell" changed between apache
versions, but the behaviour as far as interaction with
Perl/apache may have - from reading the README.win32 file in
the Perl sources, it's apparent that a perfectly legal
interaction with the shell under Unix can have quite
different outcomes under DOS, depending on what DOS "shell"
is used (Win95/98, NT, 4DOS tools, ). As an example,
for the test suite for Perl 5.00503 on Win98, simply switching 
the "shell" from the standard one to 4DOS results in a significant
increase in the success rate of the tests passed, for the *same* 
compiled Perl binary.

> 
> The fact that you're running a different DOS "shell" to me does not explain the
> problem: it only explains why your experience of the problem it slightly
> different to mine.
> 
> It was changing from Apache 1.3.6 to Apache 1.3.12 which broke it -- my DOS
> "shell" didn't change!

But given the at times tenuous nature of Win32 system calls,
the newer Perl/mod_perl/Apache combination may
have changed the behaviour with the DOS shell - as I mentioned, the
4DOS "shell" for me managed to capture the output of this command to
an external file, albeit with a non-zero status. One moral perhaps
is that system calls like this are not as reliable under Win32
as they are in Unix.
 
> 
> And did you get the line in the error.log?

There weren't any errors logged, which is again perhaps an
indication of a touch of unreliability with system calls
under Win32.

> 
> 
> Steve Hay
> 
> 

best regards,
randy kobes





Re: Problem Compiling with Perl 5.6.0

2000-04-03 Thread Steve Hay

> > $status = system "D:\\WINNT\\system32\\ipconfig.exe >
> D:\\Temp\\ip.txt";
> >
> > then it carries on fine under Apache (now re-directing the output to the
> "ip.txt"
> > file), but under Apache+mod_perl the $status gets set to 256, the "ip.txt"
> file is
> > not created and I get the error
> >
> > The handle could not be opened
> > during redirection of handle 1.
> >
> > in error.log
> >
> > What is it that changed between Apache 1.3.6 (which doesn't have this
> problem) and
> > Apache 1.3.12 which causes this to happen, and can mod_perl be changed to
> cope
> > with it?
>
> Hi Steve,
> I've tried this with the latest cvs mod_perl snapshot, like you
> use, with Perl 5.6.0 and Apache_1.3.12. I'm using Win98, with the
> 4DOS tools. As a cgi-bin script,
>  my $status = "ipconfig > C:\\test.txt"

[I take it you meant 'my $status = system "ipconfig > C:\\test.txt";' here?!]

>
> returns $status = 0, and C:\test.txt capturing the output.
> As an Apache::Registry script, the same thing returns
> a status of 256 (with a DOS window briefly opening and
> closing), but I get C:\test.txt still capturing the output. So it
> may have something to do with the different DOS "shells"?

Eh?  I don't believe the DOS "shell" changed between Apache 1.3.6 and Apache
1.3.12!!

The fact that you're running a different DOS "shell" to me does not explain the
problem: it only explains why your experience of the problem it slightly
different to mine.

It was changing from Apache 1.3.6 to Apache 1.3.12 which broke it -- my DOS
"shell" didn't change!

And did you get the line in the error.log?


Steve Hay





Re: Problem Compiling with Perl 5.6.0

2000-03-31 Thread Steve Hay

Doug MacEachern wrote:

> lemme guess, Perl_rsignal?  somehow i managed not to commit this
> yesterday, it's in cvs now.  i don't have a win32 system to test on at the
> moment, so any feeback from you, Randy K and others helps a great deal,
> thanks.

Great!

I've just given the latest cvs another try, and for the first time that I've seen
ApacheModulePerl.dll compiled and linked with 0 errors and 0 warnings.

What's more, it even seems to work too after having given it a quick bashing.

Unfortunately (for me, at least), I've still got the same problem which I had with
Perl 5.005_03, namely that I can't re-direct STDOUT in system() calls.

The following program works fine:

$| = 1;
print "Content-Type: text/plain\n\n";
$status = system "D:\\WINNT\\system32\\ipconfig.exe";
print "The system() call exited with status $status.\n";

(under Apache the output from IPCONFIG.EXE appears in the browser, under
Apache+mod_perl it disappears somewhere, like the mod_perl Guide says it will, and
$status is 0 both times).

But, if I change:

$status = system "D:\\WINNT\\system32\\ipconfig.exe";

to:

$status = system "D:\\WINNT\\system32\\ipconfig.exe > D:\\Temp\\ip.txt";

then it carries on fine under Apache (now re-directing the output to the "ip.txt"
file), but under Apache+mod_perl the $status gets set to 256, the "ip.txt" file is
not created and I get the error

The handle could not be opened
during redirection of handle 1.

in error.log

What is it that changed between Apache 1.3.6 (which doesn't have this problem) and
Apache 1.3.12 which causes this to happen, and can mod_perl be changed to cope
with it?


Steve Hay





Re: Problem Compiling with Perl 5.6.0

2000-03-30 Thread G.W. Haywood

Hi there,

On Thu, 30 Mar 2000, Steve Hay wrote:

> Since I had no reply to my previous problem (re-directing STDOUT in
> system() calls), 

This is probably because you're talking about NT.  Don't take it
personally.

> I thought I would try using Perl 5.6.0 instead of > 5.005_03

Brave chap.

> (probably a good idea anyway)

No, I don't think so, not on NT, not yet.  Come to think of it, NT
probably wasn't the best idea you ever had either.

> Unfortunately, now I can't get (the Apache side of) mod_perl to
> compile.

You aren't alone.  You really are on the bleeding edge with that lot.
My advice would be ro try Linux, and stick with Perl 5.005_03 and
mod_perl 1.21/Apache 1.3.11 (or .12) for a few weeks.

73,
Ged.
PS: Horrible mail problems here just now, reply only to mod_perl List.








Re: Problem Compiling with Perl 5.6.0

2000-03-30 Thread Doug MacEachern

On Thu, 30 Mar 2000, Steve Hay wrote:

> Thanks for this!
> 
> I tried it with the latest mod_perl cvs: mine now compiles perfectly too
> (_never_ seen that before!!!), and there's now only 1 unresolved external
> symbol instead of 7.  Looks like it could be nearly there - I'll try another
> one some time.

lemme guess, Perl_rsignal?  somehow i managed not to commit this
yesterday, it's in cvs now.  i don't have a win32 system to test on at the
moment, so any feeback from you, Randy K and others helps a great deal,
thanks.

--- src/modules/perl/mod_perl.c 2000/03/30 00:20:34 1.109
+++ src/modules/perl/mod_perl.c 2000/03/30 19:32:22
@@ -1099,6 +1099,7 @@
cfg->pnotes = Nullhv;
 }
 
+#ifndef WIN32
 sigs = (perl_request_sigsave **)cfg->sigsave->elts;
 for (i=0; i < cfg->sigsave->nelts; i++) {
MP_TRACE_g(fprintf(stderr, 
@@ -1108,6 +1109,7 @@
   (unsigned long)sigs[i]->h));
rsignal(sigs[i]->signo, sigs[i]->h);
 }
+#endif
 }
 
 void mod_perl_end_cleanup(void *data)




Re: Problem Compiling with Perl 5.6.0

2000-03-30 Thread Steve Hay

Thanks for this!

I tried it with the latest mod_perl cvs: mine now compiles perfectly too
(_never_ seen that before!!!), and there's now only 1 unresolved external
symbol instead of 7.  Looks like it could be nearly there - I'll try another
one some time.

I look forward to mod_perl 1.23 ...

Steve Hay


Randy Kobes wrote:

> On Thu, 30 Mar 2000, Steve Hay wrote:
>
> > Has anyone else got 5.6.0 / 1.3.12 / 1.22 going on NT 4?
>
> Hi,
>  There's a couple things you can do -
>
> - add the flag /D "WIN32IOP_H" - this handles the win32_opendir
> and similar errors.
> - for the mode_t error, in apache/src/os/win32/os.h, change
> the typedef of mode_t from 'int' to 'unsigned short', so as
> to agree with the mode_t typedef of perl in perl/lib/core/win32.h.
> In the same apache os.h file, if you change the typedef of
> uid_t and gid_t from 'int' to 'long', again so as to agree
> with Perl's typedefs, then the compilation, at least for me,
> proceeeds without warnings.
>
> Unfortunately, there's some problems in the linking phase - some
> symbols that were present in perl.lib of 5.005_03 have been
> removed from perl56.lib of 5.6.0. Doug has worked on this - you
> may want to get the latest mod_perl cvs snapshot from
> http://perl.apache.org/ and try that.




Re: Problem Compiling with Perl 5.6.0

2000-03-30 Thread Randy Kobes

On Thu, 30 Mar 2000, Steve Hay wrote:

> Since I had no reply to my previous problem (re-directing STDOUT in
> system() calls), I thought I would try using Perl 5.6.0 instead of
> 5.005_03 (probably a good idea anyway) to see if that helped.
> 
> Unfortunately, now I can't get (the Apache side of) mod_perl to compile.
> 
> I'm using MSVC++ 6.0 on Windows NT 4.  Perl 5.6.0 and Apache 1.3.12
> compiled fine, as does the Perl side of mod_perl 1.22, but when I go
> into Dev Studio to compile the Apache side I get the following output
> for each file:
> 
> D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(87) : warning C4005:
> 'crypt' : macro redefinition
> D:\perl5\lib\CORE\win32iop.h(301) : see previous definition of
> 'crypt'
> D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(109) : warning C4142:
> benign redefinition of type
> D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(110) : warning C4142:
> benign redefinition of type
> D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(112) : error C2371:
> 'mode_t' : redefinition; different basic types
> D:\perl5\lib\CORE\win32.h(197) : see declaration of 'mode_t'
> D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(146) : warning C4005:
> 'sleep' : macro redefinition
> D:\perl5\lib\CORE\win32iop.h(279) : see previous definition of
> 'sleep'
> D:\Program Files\Microsoft Visual Studio\VC98\Include\stddef.h(78) :
> warning C4005: 'errno' : macro redefinition
> D:\perl5\lib\CORE\win32iop.h(188) : see previous definition of
> 'errno'
> D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(165) : warning C4005:
> 'stat' : macro redefinition
> D:\perl5\lib\CORE\win32iop.h(223) : see previous definition of
> 'stat'
> D:\Temp\apache_1.3.12\src\include\../os/win32/readdir.h(34) : error
> C2373: 'win32_opendir' : redefinition; different type modifiers
> D:\perl5\lib\CORE\win32iop.h(116) : see declaration of
> 'win32_opendir'
> D:\Temp\apache_1.3.12\src\include\../os/win32/readdir.h(35) : error
> C2373: 'win32_readdir' : redefinition; different type modifiers
> D:\perl5\lib\CORE\win32iop.h(117) : see declaration of
> 'win32_readdir'
> D:\Temp\apache_1.3.12\src\include\../os/win32/readdir.h(36) : error
> C2373: 'win32_closedir' : redefinition; different type modifiers
> D:\perl5\lib\CORE\win32iop.h(121) : see declaration of
> 'win32_closedir'
> 
> Any ideas, anyone?
> 
> Has anyone else got 5.6.0 / 1.3.12 / 1.22 going on NT 4?

Hi,
 There's a couple things you can do -

- add the flag /D "WIN32IOP_H" - this handles the win32_opendir
and similar errors.
- for the mode_t error, in apache/src/os/win32/os.h, change
the typedef of mode_t from 'int' to 'unsigned short', so as
to agree with the mode_t typedef of perl in perl/lib/core/win32.h.
In the same apache os.h file, if you change the typedef of
uid_t and gid_t from 'int' to 'long', again so as to agree
with Perl's typedefs, then the compilation, at least for me,
proceeeds without warnings.

Unfortunately, there's some problems in the linking phase - some
symbols that were present in perl.lib of 5.005_03 have been
removed from perl56.lib of 5.6.0. Doug has worked on this - you
may want to get the latest mod_perl cvs snapshot from
http://perl.apache.org/ and try that.

best regards,
randy kobes





Re: Problem Compiling with Perl 5.6.0

2000-03-30 Thread G.W. Haywood

Hi there,

On Thu, 30 Mar 2000, Steve Hay wrote:

> seems a shame I can't get it to go with Perl 5.6.0.  I just wondered
> if anyone out there new of any more hacks to help...

Search the mod_perl List archive for 5.6.0?  Most of it will be about
it not working with something or other.  After all, it's hardly been
out a week yet...

73,
Ged.





Re: Problem Compiling with Perl 5.6.0

2000-03-30 Thread Steve Hay

"G.W. Haywood" wrote:

> Come to think of it, NT probably wasn't the best idea you ever had
> either.

I agree, but we're selling a web application and most of our customers
want it on NT.

> > Unfortunately, now I can't get (the Apache side of) mod_perl to
> > compile.
>
> You aren't alone.  You really are on the bleeding edge with that lot.
> My advice would be ro try Linux, and stick with Perl 5.005_03 and
> mod_perl 1.21/Apache 1.3.11 (or .12) for a few weeks.

Well, I got mod_perl 1.22 going on NT with Perl 5.005_03 / Apache 1.3.12
(apart from the problem with system() calls...) after two quick hacks (one
to lib\Apache\src.pm and one to src\modules\perl\Util.xs) so it just seems
a shame I can't get it to go with Perl 5.6.0.  I just wondered if anyone
out there new of any more hacks to help...





Problem Compiling with Perl 5.6.0

2000-03-30 Thread Steve Hay

Since I had no reply to my previous problem (re-directing STDOUT in
system() calls), I thought I would try using Perl 5.6.0 instead of
5.005_03 (probably a good idea anyway) to see if that helped.

Unfortunately, now I can't get (the Apache side of) mod_perl to compile.

I'm using MSVC++ 6.0 on Windows NT 4.  Perl 5.6.0 and Apache 1.3.12
compiled fine, as does the Perl side of mod_perl 1.22, but when I go
into Dev Studio to compile the Apache side I get the following output
for each file:

D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(87) : warning C4005:
'crypt' : macro redefinition
D:\perl5\lib\CORE\win32iop.h(301) : see previous definition of
'crypt'
D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(109) : warning C4142:
benign redefinition of type
D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(110) : warning C4142:
benign redefinition of type
D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(112) : error C2371:
'mode_t' : redefinition; different basic types
D:\perl5\lib\CORE\win32.h(197) : see declaration of 'mode_t'
D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(146) : warning C4005:
'sleep' : macro redefinition
D:\perl5\lib\CORE\win32iop.h(279) : see previous definition of
'sleep'
D:\Program Files\Microsoft Visual Studio\VC98\Include\stddef.h(78) :
warning C4005: 'errno' : macro redefinition
D:\perl5\lib\CORE\win32iop.h(188) : see previous definition of
'errno'
D:\Temp\apache_1.3.12\src\include\../os/win32/os.h(165) : warning C4005:
'stat' : macro redefinition
D:\perl5\lib\CORE\win32iop.h(223) : see previous definition of
'stat'
D:\Temp\apache_1.3.12\src\include\../os/win32/readdir.h(34) : error
C2373: 'win32_opendir' : redefinition; different type modifiers
D:\perl5\lib\CORE\win32iop.h(116) : see declaration of
'win32_opendir'
D:\Temp\apache_1.3.12\src\include\../os/win32/readdir.h(35) : error
C2373: 'win32_readdir' : redefinition; different type modifiers
D:\perl5\lib\CORE\win32iop.h(117) : see declaration of
'win32_readdir'
D:\Temp\apache_1.3.12\src\include\../os/win32/readdir.h(36) : error
C2373: 'win32_closedir' : redefinition; different type modifiers
D:\perl5\lib\CORE\win32iop.h(121) : see declaration of
'win32_closedir'

Any ideas, anyone?

Has anyone else got 5.6.0 / 1.3.12 / 1.22 going on NT 4?


Steve Hay