-
Notifications
You must be signed in to change notification settings - Fork 540
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
Cwd: different return values between pure perl and XS variants #16338
Comments
From @eserteThis is a bug report for perl from slaven@rezic.de, The functions getcwd and abs_path return different values for the A test program: #!/usr/bin/perl use strict; my $tmp = tempdir(CLEANUP => 1); __END__ Output: ok 1 - XS getcwd on non-existent directory Additionally, the PP variants are quite loud while the XS variant is Probably the fix is to change all "return ''" statements in _perl_abs_path Regards, Flags: Site configuration information for perl 5.26.1: Configured by eserte at Sat Sep 23 09:36:11 CEST 2017. Summary of my perl5 (revision 5 version 26 subversion 1) configuration: @INC for perl 5.26.1: Environment for perl 5.26.1: |
From zefram@fysh.orgFixed in commit d2e38af. -zefram |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Sun, 24 Dec 2017 11:16:06 GMT, zefram@fysh.org wrote:
This does appear to be fixed on FreeBSD, but we've got a smoke test report from Cygwin explicitly FAILing on dist/PathTools/t/cwd_enoent.t. Please see: http://perl.develop-help.com/raw/?id=204663 Thank you very much. |
From @jkeenanOn Tue, 26 Dec 2017 16:59:16 GMT, jkeenan wrote:
Please ignore the above. Wrong ticket. -- |
@iabyn - Status changed from 'open' to 'pending release' |
From @tonycozOn Sun, Dec 24, 2017 at 11:15:47AM +0000, Zefram wrote:
This new test has been failing on cygwin since it was introduced. tony@saturn ~/dev/perl/git/perl/t Test Summary Report ../dist/PathTools/t/cwd_enoent.t (Wstat: 512 Tests: 2 Failed: 2) tony@saturn ~/dev/perl/git/perl/t Tony |
From @eserteDana Sun, 14 Jan 2018 18:32:28 -0800, tonyc reče:
I guess that's because Cygwin's getcwd() is implemented with _backtick_pwd(), and Cygwin's pwd command behaves differently than on Unix --- in this situation it returns the non-existent directory. Regards, |
From zefram@fysh.orgTony Cook wrote:
For getcwd() to yield a non-error return for a non-existent directory
This is another problem. That's abs_path() dying, which it shouldn't: -zefram |
From zefram@fysh.orgI wrote:
This bit fixed in commit a97021b. -zefram |
From @tonycozOn Mon, Jan 15, 2018 at 11:28:06PM +0000, Zefram wrote:
I tested with: tony@saturn ~/dev/perl/git int main(void) { if (!getcwd(buf, sizeof(buf))) { return 0; tony@saturn ~/dev/perl/git tony@saturn ~/dev/perl/git I've asked about it on the cygwin mailing list. I suspect this will be WONTFIX at the cygwin level. Tony |
From zefram@fysh.orgTony Cook wrote:
I'd still like to know which bug it is that they won't fix. -zefram |
From @tonycozOn Tue, Jan 16, 2018 at 05:50:47AM +0000, Zefram wrote:
Well, remembering cygwin is built on top of Win32, and if I'm reading Having to record that the directory (or file) is marked deleted and Tony |
From zefram@fysh.orgTony Cook wrote:
That's not what I'm proposing, and would be totally unworkable. If rmdir(2) doesn't actually succeed in removing the directory -zefram |
From @tonycozOn Tue, Jan 16, 2018 at 08:23:58AM +0000, Zefram wrote:
If this what you need? tony@saturn ~/dev/perl/git tony@saturn ~/dev/perl/git mkdir "foo", 0700 Tony |
From zefram@fysh.orgTony Cook wrote:
Nearly. Instead of the -d line, please do print stat( and please show the output of Cwd::_backtick_pwd(), not just getcwd(). print $_, " ", \&{"Cwd::$_"}, "\n" -zefram |
From @tonycozOn Tue, Jan 16, 2018 at 10:45:38AM +0000, Zefram wrote:
tony@saturn ~/dev/perl/git tony@saturn ~/dev/perl/git mkdir "foo", 0700 I assumed you wanted the Cwd::foo functions called rather than a bunch Tony |
From zefram@fysh.orgTony Cook wrote:
I wanted the CODE(...) output. I want to see which names are aliased, -zefram |
From @tonycozOn Tue, Jan 16, 2018 at 11:44:00PM +0000, Zefram wrote:
$ perl 132648.pl Tony |
From zefram@fysh.orgFindings from debugging output provided by Tony: * rmdir() succeeds in making the directory's former name unresolvable. * Cygwin uses the XS implementation for its getcwd(), not _backtick_pwd() * both the XS getcwd() and _backtick_pwd() produce the erroneous result. * behind the XS getcwd(), the core's getcwd_sv() and libc's getcwd(3) This is fixable, but it's got more complicated than I'm willing to -zefram |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#132648 (status was 'resolved')
Searchable as RT132648$
The text was updated successfully, but these errors were encountered: