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

glob function problems with long file names in Perl 5.6.0 on AIX 4.3 #3547

Closed
p5pRT opened this issue Mar 9, 2001 · 9 comments
Closed

glob function problems with long file names in Perl 5.6.0 on AIX 4.3 #3547

p5pRT opened this issue Mar 9, 2001 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 9, 2001

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

Searchable as RT6002$

@p5pRT
Copy link
Author

p5pRT commented Mar 9, 2001

From steve.hart@cp.net

Ramblings​:
  I thought this might be a problem with a file name length limit on my installation of
  AIX 4.3. I don't know much about AIX, but I did find this, which seems to indicate that
  the file name can be up to 255 chars, and the path name up to 1024​:

  $ /usr/bin/getconf NAME_MAX .
  255
  $ /usr/bin/getconf PATH_MAX .
  1024

  The above commands were executed in the same directory from where I ran the test case
  Perl script (see below), and the path and file names that caused the error were well
  below both of these limits.

Other stuff​:
  Doesn't happen with Perl 5.6.0 on AIX 4.2, or any other platform that I've used.


Test Case​:

#!/usr/bin/perl -w

  foreach (glob shift) {
  print "$_\n";
  }
__END__

Execute this script like this​:

  scriptname '*'


$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration​:
  Platform​:
  osname=aix, osvers=4.3, archname=aix
  uname='aix orbit 3 4 00201295e800 '
  config_args=''
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=undef d_sfio=undef uselargefiles=define
  use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler​:
  cc='cc', optimize='-O', gccversion=
  cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384'
  ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -q32 -D_LARGE_FILES -qlonglong'
  stdchar='unsigned char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries​:
  ld='ld', ldflags =' -L/usr/local/lib -b32'
  libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
  libs=-lbind -lnsl -ldbm -ldl -lld -lm -lC -lc -lcrypt -lbsd -lPW -liconv
  libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -bE​:/usr/local/lib/perl5/5.6.0/aix/CORE/perl.exp'
  cccdlflags=' ', lddlflags='-bhalt​:4 -bM​:SRE -bI​:$(PERL_INC)/perl.exp -bE​:$(BASEEXT).exp -b noentry -lC -lc -L/usr/local/lib'

Characteristics of this binary (from libperl)​:
  Compile-time options​: USE_LARGE_FILES
  Built under aix
  Compiled at Dec 11 2000 13​:30​:34
  @​INC​:
  /usr/local/lib/perl5/5.6.0/aix
  /usr/local/lib/perl5/5.6.0
  /usr/local/lib/perl5/site_perl/5.6.0/aix
  /usr/local/lib/perl5/site_perl/5.6.0
  /usr/local/lib/perl5/site_perl
  .


Thanks!

Steve Hart
steve.hart@​cp.net

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2002

From reid@i2.com

I have the following files​:

  /dvobs/build_tools/production/db/products/df
  /dvobs/build_tools/production/db/products/fp
  /dvobs/build_tools/production/db/products/scp

If I do the following​:

  foreach $file ( </dvobs/build_tools/production/db/products/*> ) {
  print $file, "\n";
  }

I get the following results​:

  /dvobs/build_tools/productio <GARBAGE>
  /dvobs/build_tools/production/db/products/scp

The problem appears to have something to do with the length of the
path. If I do the following instead​:

  chdir ("/dvobs");
  foreach $file ( <build_tools/production/db/products/*> ) {
  print $file, "\n";
  }

I get a different, but also mangled, list​:

  build_tools/production/db/products/d
  build_tools/production/db/products/f
  build_tools/production/db/products/scp

If I descend a bit deeper before doing the globbing, then
things work okay​:

  chdir ("/dvobs/build_tools");
  foreach $file ( <production/db/products/*> ) {
  print $file, "\n";
  }

Which results in​:

  production/db/products/df
  production/db/products/fp
  production/db/products/scp

Is this a known bug in perl on AIX, or am I doing something wrong?

Reid

--
Reid Madsen reid_madsen@​i2.com
Senior Member, Tech. Staff (469) 357-8389 (Desk)
I2 Technologies
--
On a crusade to eliminate dead code ...

@p5pRT
Copy link
Author

p5pRT commented Apr 19, 2010

From @chorny

Can somebody test this on perl 5.12.0/AIX 4.3?

On Fri Mar 09 07​:40​:20 2001, steve.hart@​cp.net wrote​:

Ramblings​:
I thought this might be a problem with a file name length limit on
my installation of
AIX 4.3. I don't know much about AIX, but I did find this, which
seems to indicate that
the file name can be up to 255 chars, and the path name up to 1024​:

   $ /usr/bin/getconf NAME\_MAX \.
   255
   $ /usr/bin/getconf PATH\_MAX \.
   1024

The above commands were executed in the same directory from where I
ran the test case
Perl script (see below), and the path and file names that caused
the error were well
below both of these limits.

Other stuff​:
Doesn't happen with Perl 5.6.0 on AIX 4.2, or any other platform
that I've used.

-------------------------------------------------
Test Case​:

#!/usr/bin/perl -w

foreach (glob shift) {
print "$_\n";
}
__END__

Execute this script like this​:

scriptname '*'
-------------------------------------------------
$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0)
configuration​:
Platform​:
osname=aix, osvers=4.3, archname=aix
uname='aix orbit 3 4 00201295e800 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
Compiler​:
cc='cc', optimize='-O', gccversion=
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-qmaxmem=16384'
ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-qmaxmem=16384 -q32 -D_LARGE_FILES -qlonglong'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, usemymalloc=n, prototype=define
Linker and Libraries​:
ld='ld', ldflags =' -L/usr/local/lib -b32'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -ldbm -ldl -lld -lm -lC -lc -lcrypt -lbsd -lPW
-liconv
libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
Dynamic Linking​:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='
-bE​:/usr/local/lib/perl5/5.6.0/aix/CORE/perl.exp'
cccdlflags=' ', lddlflags='-bhalt​:4 -bM​:SRE
-bI​:$(PERL_INC)/perl.exp -bE​:$(BASEEXT).exp -b noentry -lC -lc
-L/usr/local/lib'

Characteristics of this binary (from libperl)​:
Compile-time options​: USE_LARGE_FILES
Built under aix
Compiled at Dec 11 2000 13​:30​:34
@​INC​:
/usr/local/lib/perl5/5.6.0/aix
/usr/local/lib/perl5/5.6.0
/usr/local/lib/perl5/site_perl/5.6.0/aix
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl
.
------------------------------------------------------

Thanks!

Steve Hart
steve.hart@​cp.net

--
Alexandr Ciornii, http​://chorny.net

@p5pRT
Copy link
Author

p5pRT commented May 1, 2012

From @dmcbride

I don't have access to AIX 4.3, and, besides, it's way out of support by
now. I can't reproduce this with the system perl (5.10.1) or perl 5.14.2
(path/file names going up over 100 characters anyway) on AIX 6.1, so I
vote to close this.

@p5pRT
Copy link
Author

p5pRT commented May 1, 2012

@cpansprout - Status changed from 'open' to 'resolved'

@p5pRT
Copy link
Author

p5pRT commented May 1, 2012

From @nwc10

On Mon, Apr 30, 2012 at 09​:26​:30PM -0700, Darin McBride via RT wrote​:

I don't have access to AIX 4.3, and, besides, it's way out of support by
now. I can't reproduce this with the system perl (5.10.1) or perl 5.14.2
(path/file names going up over 100 characters anyway) on AIX 6.1, so I
vote to close this.

I *can* however reproduce this with 5.6.0 on current-ish AIX.

My bisect run to find out what "fixed" it has got mired down in a tarpit
of skips. I'm curious to see whether we "fixed" it or fixed it.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented May 1, 2012

@cpansprout - Status changed from 'resolved' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 3, 2012

@nwc10 - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed May 3, 2012
@p5pRT
Copy link
Author

p5pRT commented May 3, 2012

From @nwc10

On Tue, May 01, 2012 at 03​:49​:51PM +0100, Nicholas Clark wrote​:

On Mon, Apr 30, 2012 at 09​:26​:30PM -0700, Darin McBride via RT wrote​:

I don't have access to AIX 4.3, and, besides, it's way out of support by
now. I can't reproduce this with the system perl (5.10.1) or perl 5.14.2
(path/file names going up over 100 characters anyway) on AIX 6.1, so I
vote to close this.

I *can* however reproduce this with 5.6.0 on current-ish AIX.

My bisect run to find out what "fixed" it has got mired down in a tarpit
of skips. I'm curious to see whether we "fixed" it or fixed it.

Most strange. We did fix it, but not in the way I would have guessed​:

commit 61d42ce
Author​: Jarkko Hietaniemi <jhi@​iki.fi>
Date​: Wed Jun 13 02​:23​:16 2001 +0000

  New AIX dynaloading code from Jens-Uwe Mager.
  Does break binary compatibility.
 
  p4raw-id​: //depot/perl@​10554

The SEGV (due to an illegal instruction) goes away once perl switched to using
dlopen() for dynamic linking on AIX.

So my hunch that this bug was interesting was right, but not for reason I'd
guessed.

Nicholas Clark

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