Re: blead-156-g46807d8 on VMS failures

[email protected] ("Craig A. Berry")
Newsgroups perl.perl5.porters,perl.vmsperl
Message-ID <[email protected]>
On Dec 31, 2008, at 7:04 PM, John Malmberg wrote:

> With this build, I am seeing the following failures on VMS:
>
> lib/Thread/Queue/t/02_refs.t is failing on tests 18, 23, 24, and 26

I haven't looked at that one yet.

> The new test lib/autodie/truncate.t fails on test 3 and then hangs  
> until it is killed.
>
> EAGLE> mcr [-]ndbgperl.exe -d "-I../" lib/autodie/truncate.t
>
> Daughter DB session started...
> 1..3
> ok 1 - Truncating STDOUT should throw an exception isa  
> autodie::exception
> ok 2 - Truncating an unopened file is wrong. isa autodie::exception
> not ok 3 - Truncating a normal file should be fine
> #   Failed test 'Truncating a normal file should be fine'
> #   at lib/autodie/truncate.t line 52.
> #          got: 'Can't truncate('VMS::Stdio=GLOB(0x1118210)', '0'):  
> invalid argument at (eval 47)[/PROJECT_ROOT/PERL-BLEAD/lib/Fatal
> .pm:829] line 30
> # '
> #     expected: ''

I've noticed this too but haven't gotten to the bottom of it yet.  The  
code where the hang occurs looks like this:

eval {
     use autodie;
     truncate($tmpfh, 0);
};

is($@, "", "Truncating a normal file should be fine");

The first clue as to what's wrong is that it isn't really a "normal"  
file that we are attempting to truncate -- it is a temp file with the  
delete-on-close bit set.  It was opened by VMS::Stdio::vmssysopen from  
File::Temp.

> The hang appears to be here:
>
> *PERLIO  PerlIOUnix_close   80449  0000000000006B38 00000000000CB1B8
> *PERLIO  PerlIOBase_close   79879  00000000000053DC 00000000000C9A5C
> *PERLIO  PerlIOBuf_close    81783  000000000000984C 00000000000CDECC
> *PERLIO  PerlIO__close      79117  0000000000002B6C 00000000000C71EC
> *PERLIO  Perl_PerlIO_close  79130  0000000000002C14 00000000000C7294
> *DOIO    Perl_io_close      71328  0000000000003824 0000000000127274
> *DOIO    Perl_do_close      71289  00000000000034A0 0000000000126EF0
> *PP_SYS  Perl_pp_close      70940  00000000000021AC 0000000000236ABC
> *DUMP    Perl_runops_debug  81364  00000000000087C4 00000000001B9164
> *PERL    Perl_call_sv       73195  0000000000005B48 00000000000BD478
> *PERL    Perl_call_list     80754  000000000000BF78 00000000000C38A8
> *PERL    perl_destruct      71132  0000000000000F78 00000000000B88A8
>

What's hanging is when the END block in File::Temp tries to clean up  
by closing the file.  There may be a pending write or something.

I think there are really two problems.  There is the hang in  
File::Temp's clean-up code.  We should check to make sure the right  
flavor of flush is getting called for something opened from VMS::Stdio.

Upstream of that is the problem that we cannot call truncate on a  
filehandle opened with VMS::Stdio.  The documentation for VMS::Stdio  
says VMS::Stdio ISA IO::File and you can treat its handles like any  
other Perl filehandles.  So something in the class metadata appears to  
be getting mangled.




________________________________________
Craig A. Berry
mailto:[email protected]

"... getting out of a sonnet is much more
  difficult than getting in."
                  Brad Leithauser
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.