Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utf8cache.t tried to lauches nonexistant process on Win32 but still passes #13628

Closed
p5pRT opened this issue Feb 27, 2014 · 9 comments
Closed

Comments

@p5pRT
Copy link

p5pRT commented Feb 27, 2014

Migrated from rt.perl.org#121337 (status was 'resolved')

Searchable as RT121337$

@p5pRT
Copy link
Author

p5pRT commented Feb 27, 2014

From @bulk88

Created by @bulk88

I noticed this strange message during a harness run from utf8cache.t, so
I investigated. It was mentioned once in
http​://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg176054.html
and it got 1 response in
http​://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg176059.html .

--------------------------------------------------------------
C​:\perl519\src\t>perl -I..\lib op/utf8cache.t
1..15
'-' is not recognized as an internal or external command,
operable program or batch file.
ok 1
ok 2 - quadratic pos
ok 3 - get-magic resets utf8cache on match vars
ok 4 - get-magic resets utf8cache on LVALUEs
ok 5 - get-magic resets uf8cache on defelems
ok 6 - pos on overloaded utf8 toggler
ok 7 - pos on overloaded utf8 toggler (again)
ok 8 - utf8 cache + overloading does not confuse substr lvalues
ok 9 - utf8 cache + overloading does not confuse substr lvalues (again)
ok 10 - utf8 cache + overloading does not confuse substr lvalue assignment
ok 11 - utf8 cache + overload does not confuse substr lv assignment (again)
ok 12 - no utf8 pos cache on globs
ok 13 - no utf8 pos cache on references
ok 14 - no utf8 length cache on globs
ok 15 - no utf8 length cache on references

C​:\perl519\src\t>
-------------------------------------------------------------------

From utf8cache.t

-------------------------------------------------------------------
my $pid = open CHILD, '-|';
die "kablam​: $!\n" unless defined $pid;
unless ($pid) {
  open STDERR, ">&STDOUT";
  $a = "hello \x{1234}";
-------------------------------------------------------------------

$pid is true, and is a PID to the following process,
-------------------------------------------------------------------
Path​: "C​:\WINDOWS\system32\cmd.exe"
Command Line​: "cmd.exe /x/d/c -"
-------------------------------------------------------------------

I am not sure if the CHILD FH actually works (IDK what works means). Its
only use in utf8cache.t is
-------------------------------------------------------------------
{ local $/; $_ = <CHILD> }
-------------------------------------------------------------------

The '-|' is from day 1 of this test, from
http​://perl5.git.perl.org/perl.git/commitdiff/fa421ef92a7e8058000e870bee22bbe09d7055c9
added in 5.11.2. I am not sure what this test does, but it does pass in
the end. It probably doesn't do what is intended on *nix on Windows
though and something needs to change.

Perl Info

Flags:
category=core
severity=low

Site configuration information for perl 5.19.9:

Configured by Owner at Wed Feb 12 06:47:30 2014.

Summary of my perl5 (revision 5 version 19 subversion 9) configuration:
Derived from: 633f0fd2ca244ca83cc99b3af3a7d3ac2931850b
Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -GF -W3 -Od -MD -Zi -DDEBUGGING -DWIN32
-D_CONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS
-DPERL_HASH_FUNC_ONE_AT_A_TIME -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T',
optimize='-Od -MD -Zi -DDEBUGGING',
cppflags='-DWIN32'
ccversion='13.10.6030', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug
-libpath:"c:\perl519\lib\CORE" -machine:x86'
libpth="C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\lib"
libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl519.lib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-libpath:"c:\perl519\lib\CORE" -machine:x86'

Locally applied patches:
uncommitted-changes


@INC for perl 5.19.9:
C:/perl519/site/lib
C:/perl519/lib
.


Environment for perl 5.19.9:
HOME (unset)
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=C:\perl519\bin;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\IDE;C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\BIN;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools\bin\prerelease;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;
PERL_BADLANG (unset)
SHELL (unset)



@p5pRT
Copy link
Author

p5pRT commented May 26, 2014

From @tonycoz

On Thu Feb 27 01​:33​:37 2014, bulk88 wrote​:

[Please describe your issue here]

I noticed this strange message during a harness run from utf8cache.t,
so
I investigated. It was mentioned once in
http​://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg176054.html
and it got 1 response in
http​://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg176059.html
.

As is, it's broken on POSIX systems too, but for a different reason.

open $foo, "-|";

is a fork that feeds the output of the child process to the $foo in the current process.

Unfortunately, back in c45bec6 the load of Devel​::Peek was removed, so the child process now outputs only​:

Undefined subroutine &Devel​::Peek​::Dump called at op/utf8cache.t line 27.
# Looks like you planned 15 tests but ran 0.

Adding a require fixes the output and makes it saner.

This should probably be modified to use runperl() to capture the output.

And presumably a test to make sure the output is reasonable as well as checking it doesn't contain duplicate magic.

Tony

@p5pRT
Copy link
Author

p5pRT commented May 26, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Nov 4, 2014

From @tonycoz

On Thu Feb 27 01​:33​:37 2014, bulk88 wrote​:

I noticed this strange message during a harness run from utf8cache.t,
so
I investigated. It was mentioned once in
http​://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg176054.html
and it got 1 response in
http​://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg176059.html
.

Attached a patch that fixes it for me.

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 4, 2014

From @tonycoz

0001-perl-121337-fix-issues-with-op-utf8cache.t.patch
From 2d0dd748b750074a63b42d0cb1985fd2115422ec Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 4 Nov 2014 17:26:21 +1100
Subject: [PATCH] [perl #121337] fix issues with op/utf8cache.t

This test had two problems:

- it used Devel::Peek::Dump() without loading it, broken when the script
  was refactored to use test.pl in c45bec600

- the C< open CHILD "-|" > doesn't work on Win32

Since the test didn't check it was receiving reasonable dump output,
neither problem resulted in a test failure.
---
 t/op/utf8cache.t |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/t/op/utf8cache.t b/t/op/utf8cache.t
index 65254b1..fba94a4 100644
--- a/t/op/utf8cache.t
+++ b/t/op/utf8cache.t
@@ -9,34 +9,33 @@ BEGIN {
 
 use strict;
 
-plan(tests => 15);
+plan(tests => 16);
 
 SKIP: {
 skip_without_dynamic_extension("Devel::Peek");
 
-my $pid = open CHILD, '-|';
-die "kablam: $!\n" unless defined $pid;
-unless ($pid) {
-    open STDERR, ">&STDOUT";
-    $a = "hello \x{1234}";
+my $out = runperl(stderr => 1,
+		  progs => [ split /\n/, <<'EOS' ]);
+    require Devel::Peek;
+    $a = qq(hello \x{1234});
     for (1..2) {
         bar(substr($a, $_, 1));
     }
     sub bar {
-        $_[0] = "\x{4321}";
+        $_[0] = qq(\x{4321});
         Devel::Peek::Dump($_[0]);
     }
-    exit;
-}
+EOS
 
-{ local $/; $_ = <CHILD> }
+like($out, qr/\ASV =/, "check we got dump output"); # [perl #121337]
 
 my $utf8magic = qr{ ^ \s+ MAGIC \s = .* \n
                       \s+ MG_VIRTUAL \s = .* \n
                       \s+ MG_TYPE \s = \s PERL_MAGIC_utf8 .* \n
                       \s+ MG_LEN \s = .* \n }xm;
 
-unlike($_, qr{ $utf8magic $utf8magic }x);
+unlike($out, qr{ $utf8magic $utf8magic }x,
+       "no duplicate utf8 magic");
 
 } # SKIP
 
-- 
1.7.10.4

@p5pRT
Copy link
Author

p5pRT commented Nov 10, 2014

From @tonycoz

On Mon Nov 03 22​:28​:57 2014, tonyc wrote​:

On Thu Feb 27 01​:33​:37 2014, bulk88 wrote​:

I noticed this strange message during a harness run from utf8cache.t,
so
I investigated. It was mentioned once in
http​://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg176054.html
and it got 1 response in
http​://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg176059.html
.

Attached a patch that fixes it for me.

Applied as 17571de.

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 10, 2014

@tonycoz - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

From @khwilliamson

Thanks for submitting this ticket

The issue should be resolved with the release today of Perl v5.22. If you find that the problem persists, feel free to reopen this ticket

--
Karl Williamson for the Perl 5 porters team

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant