Craig Berry wrote:
On Monday, January 23, 2006, at 09:18AM, John E. Malmberg <[EMAIL PROTECTED]> wrote:



The puzzling thing is that the statement "-e $Null" will only cause an access violation for $Null = '_NLA0:'. Replacing it with "-e '_NLA0:' eliminates the access violation.

Now the one place where that code should be taking a different path under those two conditions that I can find is in doio.c.


Remember Perl is a dynamic language. If $Null is never assigned to,
the Perl compiler may optimize it away. A very slightly different memory
allocation signature could make a difference in whether we trigger the
bug. You can watch memory allocation and deallocation happen by running
with -"Dm" :

$ perl -"Dm" [.op]stat.t

$Null is definitely assigned to, I have a debugging statement that prints out it's value.

I can add statements for "-e '_NLA0:' to the test script before the access violation occurs and they execute with out affecting the access violation for "-e $Null".

It is curious, as for a reproducer, I ended up with code that opens/create the temporary file, and then closes it.

Then it opens it and leaves it open.

1 while unlink $tmpfile;
open(FOO, ">$tmpfile") || DIE("Can't open temp test file: $!");
close FOO;

open(FOO, ">$tmpfile") || DIE("Can't open temp test file: $!");

It does not seem to make a difference if $Null is set from the File::Spec->devnull; or from $Null = '_NLA0:'.

$Null = '/dev/null' does not cause an access violation either.

After that the "-e $Null" statement causes a access violation.

In the test file, if I close that temporary file, no access violation, but in the real stat.t the temporary file should be closed at this point, and I do not see a way around it in the Perl script, so I do not know why that makes a difference.

If I do not open and close the file once before opening it and leaving it open, I do not get the access violation.

If I extract what is left of uncommented of the script out into a new script, I do not get the access violation.

I think this one is going to be a bit painful to find as it does not show up in the VMS debugger.

Some of the other -"D" flags may help isolate what routines that Perl was in just before the access violation as a first pass in zeroing in on it.

-John
[EMAIL PROTECTED]
Personal Opinion Only


Reply via email to