nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

Warning: unable to close filehandle DATA properly. #310

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
t/testc.sh -O3 95
=> 
./ccode95_o3
Warning: unable to close filehandle DATA properly.
PASS ./ccode95_o3 => 'ok'

I tried closing the new DATA filehandle, introduced by 
IO::Socket::SSL::PublicSuffix __DATA__ but to no avail.

See commit 947601d50cfe871b63df0cbbd8a7d9d992761f3f
Author: Reini Urban <rurban@cpanel.net>
Date:   Wed Apr 30 11:50:28 2014 -0500

    C: pre_destruct close __DATA__ filehandles

Original issue reported on code.google.com by reini.urban on 30 Apr 2014 at 7:43

GoogleCodeExporter commented 9 years ago
The problem happens earlier, when we open the scalar DATA fh.

do_open:
  if (result == EOF && fd > PL_maxsysfd)
  => Warning: unable to close filehandle %s properly

Original comment by reini.urban on 2 May 2014 at 2:24

GoogleCodeExporter commented 9 years ago
Actually any read of <DATA> in code breaks this way now.  This is all you need. 
to reproduce the problem.

package foo;

sub dada {
   my $line = <DATA>
}

1;
__DATA__
a
b
c

Original comment by todd.e.rinaldo on 7 May 2014 at 3:24

GoogleCodeExporter commented 9 years ago
Fixed with commit 28f994c62207fc24806f04242a6adf3775116a68
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu May 8 14:11:21 2014 -0500

    C: Support __DATA__ blocks in packages without printing wrong warnings (#310)

    Fixes issue 310
    Pass a flag to IO::save if it is a __DATA__ fh. So far we only checked for main::DATA.

    This fixes the wrong Warning: unable to close filehandle DATA properly when opening
    the PerlIO::scalar __DATA__ fh a second time, and also the wrong
    Read BEGIN-block $fullname from FileHandle $iotype warning.

Original comment by reini.urban on 8 May 2014 at 7:22

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 28f994c62207.

Original comment by reini.urban on 8 May 2014 at 10:49