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

#126041 preserve systemroot env var during env wipe for Win32 in magic.t #15494

Closed
p5pRT opened this issue Aug 4, 2016 · 8 comments
Closed

Comments

@p5pRT
Copy link

p5pRT commented Aug 4, 2016

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

Searchable as RT128837$

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2016

From @bulk88

Created by @bulk88

See attached patch.

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.23.4:

Configured by Owner at Thu Oct  1 07:03:10 2015.

Summary of my perl5 (revision 5 version 23 subversion 4) configuration:
  Derived from: 8c763bac457cf183bba63ecccf78664ee81f0cf8
  Platform:
    osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
    uname=''
    config_args=''
    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 -DNO_HASH_SEED 
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -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, 
doublekind=3
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8, 
longdblkind=0
    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:\perl521\lib\CORE"         -machine:x86'
    libpth=\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=perl523.lib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug        
 -libpath:"c:\perl521\lib\CORE"         -machine:x86'

Locally applied patches:
    uncommitted-changes


@INC for perl 5.23.4:
    C:/perl521/site/lib
    C:/perl521/lib
    .


Environment for perl 5.23.4:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\perl521\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 Aug 4, 2016

From @bulk88

0001-126041-preserve-systemroot-env-var-during-env-wipe-f.patch
From 4901670ce2bde772982df6d10f047704dd22fb28 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Thu, 4 Aug 2016 00:37:46 -0500
Subject: [PATCH] #126041 preserve systemroot env var during env wipe for
 Win32 in magic.t

This fixes a test fail with VC 2005 on WinXP in magic.t. See perl #126041
for an example of the failure. Systemroot env var is required on WinXP to
load SXS tracked DLLs, VC 2005 and 2008's MS libc's are SXS tracked
(before and after are not), so once %ENV is wipe and systemroot is deleted
the require Win32; cant load the XS DLL because the XS DLL is linked
against the SXS tracked libc specific to 2005/2008.
---
 t/op/magic.t |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/t/op/magic.t b/t/op/magic.t
index ad90749..0881876 100644
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -718,10 +718,12 @@ SKIP: {
 	    if $ENV{PERL_VALGRIND} || $Is_VMS;
 
 	    $PATH = $ENV{PATH};
+	    $SYSTEMROOT = $ENV{SYSTEMROOT} if exists $ENV{SYSTEMROOT}; # win32
 	    $PDL = $ENV{PERL_DESTRUCT_LEVEL} || 0;
 	    $ENV{foo} = "bar";
 	    %ENV = ();
 	    $ENV{PATH} = $PATH;
+	    $ENV{SYSTEMROOT} = $SYSTEMROOT if defined $SYSTEMROOT;
 	    $ENV{PERL_DESTRUCT_LEVEL} = $PDL || 0;
 	    if ($Is_MSWin32) {
 		is `set foo 2>NUL`, "";
-- 
1.7.9.msysgit.0

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2016

From @jkeenan

Does the "126041" in the Subject indicate that this is the same bug as https://rt-archive.perl.org/perl5/Ticket/Display.html?id=126041 ?

If so, then we should merge the two tickets. If not, then we should omit that string from the Subject line to avoid confusion.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2016

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

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2016

From @cpansprout

On Wed Aug 03 22​:47​:56 2016, bulk88 wrote​:

This is a bug report for perl from bulk88@​hotmail.com,
generated with the help of perlbug 1.40 running under perl 5.23.4.

-----------------------------------------------------------------
[Please describe your issue here]

See attached patch.

Thank you. Applied as 15dd003.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2016

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

@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release today of Perl 5.26.0, this and 210 other issues have been
resolved.

Perl 5.26.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.26.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

@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