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

Win32: File::Path fails tests in non-threaded builds on smoke testing #15244

Closed
p5pRT opened this issue Mar 22, 2016 · 8 comments
Closed

Win32: File::Path fails tests in non-threaded builds on smoke testing #15244

p5pRT opened this issue Mar 22, 2016 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 22, 2016

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

Searchable as RT127760$

@p5pRT
Copy link
Author

p5pRT commented Mar 22, 2016

From @tonycoz

http​://www.nntp.perl.org/group/perl.daily-build.reports/2016/03/msg189801.html

@p5pRT
Copy link
Author

p5pRT commented Mar 29, 2016

From @tonycoz

On Mon Mar 21 17​:18​:59 2016, tonyc wrote​:

http​://www.nntp.perl.org/group/perl.daily-
build.reports/2016/03/msg189801.html

This seems to come down to a difference between Win2k (which is what the smoker runs on) and more modern versions of Windows.

It only fails on non-threaded builds, because threaded builds have USE_IMP_SYS enabled, which on Win32 emulates a thread-local current directory.

I've asked George (who runs the smoker) to test a simple program that exercises the APIs that seem to differ in behaviour (attached).

This behaves the same way on Windows XP and Windows 7​:

J​:\dev\perl\git>cl curdir.c
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.01 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

curdir.c
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

/out​:curdir.exe
curdir.obj

J​:\dev\perl\git>curdir j​:\dev
Current directory now 'j​:\dev'
Attributes 10

J​:\dev\perl\git>curdir \\?\j​:\dev
Current directory now '\\?\j​:\dev'
Attributes 10

Tony

@p5pRT
Copy link
Author

p5pRT commented Mar 29, 2016

From @tonycoz

#include <windows.h>
#include <stdio.h>

int main(int argc, char **argv) {
  DWORD r;
  char p[MAX_PATH];
  DWORD len;
  if (argc != 2) {
    fprintf(stderr, "Usage: %s directoryname\n", argv[0]);
    return 1;
  }

  if (!SetCurrentDirectoryA(argv[1])) {
    fprintf(stderr, "SCD failed: %lx\n", GetLastError());
    return 1;
  }
  len = GetCurrentDirectory(sizeof(p), p);
  if (!len) {
    fprintf(stderr, "GCD failed: %lx\n", GetLastError());
    return 1;
  }
  printf("Current directory now '%s'\n", p);
  r = GetFileAttributesA(".");
  if (r == 0xffffffff) {
    fprintf(stderr, "GFA failed: %lx\n", GetLastError());
    return 1;
  }
  printf("Attributes %lx\n", r);
  return 0;
}

@p5pRT
Copy link
Author

p5pRT commented Mar 30, 2016

From @tonycoz

On Mon Mar 28 17​:17​:38 2016, tonyc wrote​:

On Mon Mar 21 17​:18​:59 2016, tonyc wrote​:

http​://www.nntp.perl.org/group/perl.daily-
build.reports/2016/03/msg189801.html

This seems to come down to a difference between Win2k (which is what
the smoker runs on) and more modern versions of Windows.

It only fails on non-threaded builds, because threaded builds have
USE_IMP_SYS enabled, which on Win32 emulates a thread-local current
directory.

I've asked George (who runs the smoker) to test a simple program that
exercises the APIs that seem to differ in behaviour (attached).

This behaves the same way on Windows XP and Windows 7​:

J​:\dev\perl\git>cl curdir.c
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.01 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

curdir.c
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

/out​:curdir.exe
curdir.obj

J​:\dev\perl\git>curdir j​:\dev
Current directory now 'j​:\dev'
Attributes 10

J​:\dev\perl\git>curdir \\?\j​:\dev
Current directory now '\\?\j​:\dev'
Attributes 10

From George, the results on his smoke box were​:

D​:\tmp>curdir d​:\smoke
Current directory now 'd​:\smoke'
Attributes 10

D​:\tmp>curdir \\?\d​:\smoke
Current directory now '\\?\d​:\smoke'
GFA failed​: 35

Since I output the error in hex, that's 53​:

//
// MessageId​: ERROR_BAD_NETPATH
//
// MessageText​:
//
// The network path was not found.
//
#define ERROR_BAD_NETPATH 53L

So it looks like a Win2k issue.

I've pushed a smoke branch to skip that test on Windows 2000.

I don't think it's worth fixing for such an old system.

Tony

@p5pRT
Copy link
Author

p5pRT commented Apr 4, 2016

From @tonycoz

On Tue Mar 29 21​:50​:01 2016, tonyc wrote​:

I've pushed a smoke branch to skip that test on Windows 2000.

I don't think it's worth fixing for such an old system.

Now in blead with appropriate bookkeeping in Porting/Maintainers.pl and customized.dat.

Upstream as rpcme/File-Path#34

Tony

@p5pRT
Copy link
Author

p5pRT commented Apr 4, 2016

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

@p5pRT
Copy link
Author

p5pRT commented May 13, 2016

From @khwilliamson

Thank you for submitting this report. You have helped make Perl better.
 
With the release of Perl 5.24.0 on May 9, 2016, this and 149 other issues have been resolved.

Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0

@p5pRT
Copy link
Author

p5pRT commented May 13, 2016

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant