Skip Menu |

This queue is for tickets about the PathTools CPAN distribution.

Report information
The Basics
Id: 65379
Status: open
Priority: 0/
Queue: PathTools

People
Owner: Nobody in particular
Requestors: dmuey [...] cpan.org
jkeenan [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.33
Fixed in: (no value)



Subject: abs_path() errouneously returning undef because lstat() sets errno to EINVAL
Hello, I am seeing several systems behaving strangely (details below) in regards to abs_path. I am still tracing this out and wanted to post the details for reference and in case one of you gurus see what the cause could be right off hand, thanks! [ -- Working server -- ] # perl -MCwd -Mstrict -wle 'my $etc = Cwd::abs_path("/etc");if (defined $etc) { print "Defined: $etc" } else { print "Undefined"; }' Defined: /etc [ -- Affected server -- ] # perl -MCwd -Mstrict -wle 'my $etc = Cwd::abs_path("/etc");if (defined $etc) { print "Defined: $etc" } else { print "Undefined"; }' Undefined [ -- lower level -- ] If I add debug output before and after line 156 in Cwd.xs like so: printf("DEBUG Before %d %s\n", errno, resolved); struct stat sb; if (lstat(resolved, &sb) != 0) { printf("DEBUG After %d %s\n", errno, resolved); if (errno == ENOENT && p == NULL) { errno = serrno; return (resolved); } return (NULL); } printf("DEBUG I got past the return(NULL) above"); and rebuild it, then we now see that errno was changed from ENOENT to EINVAL and thus the return(NULL) is triggered: # perl -I. -I./blib/arch -MCwd -Mstrict -wle 'my $etc = Cwd::abs_path("/etc");if (defined $etc) { print "Defined: $etc" } else { print "Undefined"; }' DEBUG Before 2 /etc DEBUG After 22 /etc Undefined It is the same if we change lstat() to PerlLIO_lstat() [ -- misc info -- ] Both servers are • 64 bit • CentOS release 5.5 (Final) • Using Cwd 3.33 (but installing older version results in the same behavior) • have “d_lstat” set to “define” Working server: • This is perl, v5.8.8 built for x86_64-linux • from RPM: perl.x86_64 4:5.8.8-32.el5_5.2 (another affected server had perl.x86_64 4:5.8.8-27.el5 installed) Affected server: • This is perl, v5.8.8 built for x86_64-linux-thread-multi • from RPM: perl.x86_64 4:5.8.8-32.el5_5.1 (another affected server had perl.x86_64 4:5.8.8-27.el5 installed) A diff of the output of: perl -MConfig -e 'for $k (sort keys %Config) { print "$k:$Config{$k}\n"; }' on each box is attached as sorted_config.diff
Subject: sorted_config.diff

Message body is not shown because it is too large.

I was directed to use perlbug, here is the perlbug version of this report: http://rt.perl.org/rt3//Public/Bug/Display.html?id=84338
On Thu Feb 17 12:10:05 2011, DMUEY wrote: Show quoted text
> I was directed to use perlbug, here is the perlbug version of this report: > > http://rt.perl.org/rt3//Public/Bug/Display.html?id=84338
I have taken perl:84338 for the purpose of closing it in 7 days.