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

AutoLoader truncating when it shouldn't ? #5885

Closed
p5pRT opened this issue Sep 2, 2002 · 12 comments
Closed

AutoLoader truncating when it shouldn't ? #5885

p5pRT opened this issue Sep 2, 2002 · 12 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 2, 2002

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

Searchable as RT16928$

@p5pRT
Copy link
Author

p5pRT commented Sep 2, 2002

From @lizmat

Created by @lizmat

I'm running AutoSplit on a Linux system and get​:

blib/lib/Thread/Signal.pm​: some names are not unique when truncated to 8
charact
ers​:
  directory blib/lib/auto/Thread/Signal​:
  register.al, registered.al truncate to register

The pod of AutoLoader.pm specifies​:

"On systems with restrictions on file name length, the file corresponding
to a subroutine may have a shorter name that the routine itself. This can
lead to conflicting file names. The AutoSplit package warns of these
potential conflicts when used to split a module."

However, the system on this was attempted, was an "ext3" file system under
Linux, so that hardly has the 8 character filename limit.

Is the documentation wrong​: is it always truncating just to make sure?

Or is the check for filesystem (if any) wrongly assuming it _should_
truncate to 8 characters?

A check for a truncating filesystem should be easy to make​: create a
file "123456789" and see if there is a file called "12345678" afterwards.

Perl Info


Flags:
     category=core
     severity=low

Site configuration information for perl v5.8.0:

Configured by liz at Tue Aug 20 12:44:35 CEST 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
   Platform:
     osname=linux, osvers=2.4.18, archname=i686-linux-thread-multi
     uname='linux echt.dijkmat.nl 2.4.18 #8 smp mon mar 25 22:28:36 cet 
2002 i686 unknown '
     config_args='-de -Dusethreads'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing 
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm',
     optimize='-O2',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing 
-I/usr/local/include -I/usr/include/gdbm'
     ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.1 2.96-98)', 
gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
     perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
     libc=/lib/libc-2.2.4.so, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.2.4'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:



@INC for perl v5.8.0:
     /usr/local/lib/perl5/5.8.0/i686-linux-thread-multi
     /usr/local/lib/perl5/5.8.0
     /usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
     /usr/local/lib/perl5/site_perl/5.8.0
     /usr/local/lib/perl5/site_perl/5.7.3
     /usr/local/lib/perl5/site_perl
     .


Environment for perl v5.8.0:
     HOME=/home/liz
     LANG=en_US
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
     PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/liz/bin
     PERL_BADLANG (unset)
     SHELL=/bin/bash



@p5pRT
Copy link
Author

p5pRT commented Sep 2, 2002

From @lizmat

More of an interpretation problem with the warning.

@p5pRT
Copy link
Author

p5pRT commented Sep 2, 2002

@lizmat - Status changed from 'new' to 'resolved'

@p5pRT
Copy link
Author

p5pRT commented Sep 2, 2002

From @doughera88

On 2 Sep 2002, Elizabeth Mattijsen wrote​:

-----------------------------------------------------------------
[Please enter your report here]

I'm running AutoSplit on a Linux system and get​:

blib/lib/Thread/Signal.pm​: some names are not unique when truncated to 8
charact
ers​:
directory blib/lib/auto/Thread/Signal​:
register.al, registered.al truncate to register

The pod of AutoLoader.pm specifies​:

"On systems with restrictions on file name length, the file corresponding
to a subroutine may have a shorter name that the routine itself. This can
lead to conflicting file names. The AutoSplit package warns of these
potential conflicts when used to split a module."

A check for a truncating filesystem should be easy to make​: create a
file "123456789" and see if there is a file called "12345678" afterwards.

Configure already does this and more (including worrying about both DOS
8+3 file names and old v7/System V 14-character file names. Check

  perl -V​:d_flexfnam

it should be 'define' for Linux. Then we can see where to go.

--
  Andy Dougherty doughera@​lafayette.edu
  Dept. of Physics
  Lafayette College, Easton PA 18042

@p5pRT
Copy link
Author

p5pRT commented Sep 2, 2002

From @lizmat

At 07​:05 PM 9/2/02 +0000, via RT wrote​:

On 2 Sep 2002, Elizabeth Mattijsen wrote​:

"On systems with restrictions on file name length, the file corresponding
to a subroutine may have a shorter name that the routine itself. This can
lead to conflicting file names. The AutoSplit package warns of these
potential conflicts when used to split a module."

A check for a truncating filesystem should be easy to make​: create a
file "123456789" and see if there is a file called "12345678" afterwards.

Configure already does this and more (including worrying about both DOS
8+3 file names and old v7/System V 14-character file names. Check

    perl \-V​:d\_flexfnam

it should be 'define' for Linux. Then we can see where to go.

Actually, I already closed this ticket. AutoSplit _was_ correctly
splitting. It was warning me that _if_ this package would be installed on
a 8.3 system, it would get into problems.

I misinterpreted the warning as an error message. Which may indicate a bug
in the wording of the warning... ;-)

Liz

@p5pRT
Copy link
Author

p5pRT commented Sep 2, 2002

From @nwc10

On Mon, Sep 02, 2002 at 03​:05​:23PM -0400, Andy Dougherty wrote​:

On 2 Sep 2002, Elizabeth Mattijsen wrote​:

I'm running AutoSplit on a Linux system and get​:

blib/lib/Thread/Signal.pm​: some names are not unique when truncated to 8
charact
ers​:
directory blib/lib/auto/Thread/Signal​:
register.al, registered.al truncate to register

The pod of AutoLoader.pm specifies​:

"On systems with restrictions on file name length, the file corresponding
to a subroutine may have a shorter name that the routine itself. This can
lead to conflicting file names. The AutoSplit package warns of these
potential conflicts when used to split a module."

A check for a truncating filesystem should be easy to make​: create a
file "123456789" and see if there is a file called "12345678" afterwards.

Configure already does this and more (including worrying about both DOS
8+3 file names and old v7/System V 14-character file names. Check

perl \-V​:d\_flexfnam

it should be 'define' for Linux. Then we can see where to go.

The snippet of code is this​:

  if (%notuniq && $warn){
  print "$filename​: some names are not unique when " .
  "truncated to $maxlen characters​:\n";
  foreach my $dir (sort keys %notuniq){
  print " directory $dir​:\n";
  foreach my $trunc (sort keys %{$notuniq{$dir}}) {
  print " $shorts{$dir}{$trunc} truncate to $trunc\n";
  }
  }
  }

and it seems that paranoia [IMHO correctly :-)] is how it is called during
the build process.

My suggestion, which I never found the time to make a patch, was to have
AutoSplit simply figure out which files might be non-unique, and make a
single file with the definitions for both (or all) functions in it, which
it then writes (copies, hard links or symlinks - not sure which) to all the
names. If that makes several files - fine. If that makes 1 file - fine.
Either way, the first of the functions to be C<AutoLoader​::AUTOLOAD>ed will
cause the definitions for all to be found, so the others won't ever get
near AutoLoader​::AUTOLOAD, and hence there won't be problems with
"redefinition of subroutine" warnings.

Another one for my TODO list, assuming no-one else beats me to it.

Nicholas Clark
--
Even better than the real thing​: http​://nms-cgi.sourceforge.net/

@p5pRT
Copy link
Author

p5pRT commented Sep 3, 2002

From nick.ing-simmons@elixent.com

Elizabeth Mattijsen <perl5-porters@​perl.org> writes​:

I'm running AutoSplit on a Linux system and get​:

blib/lib/Thread/Signal.pm​: some names are not unique when truncated to 8
charact
ers​:
directory blib/lib/auto/Thread/Signal​:
register.al, registered.al truncate to register

However, the system on this was attempted, was an "ext3" file system under
Linux, so that hardly has the 8 character filename limit.

The warning is that so that those of us that develop on Unix are warned
that our modules will not work if someone trys to use them on an 8.3
file system. (I hope there is a similar warning for case differences.)

What would happen is that
sub register and sub registered would both be written to
....../Register.al
one overwtiting the other.

--
Nick Ing-Simmons
http​://www.ni-s.u-net.com/

@p5pRT
Copy link
Author

p5pRT commented Sep 3, 2002

From @lizmat

At 10​:51 PM 9/2/02 +0100, Nicholas Clark wrote​:

My suggestion, which I never found the time to make a patch, was to have
AutoSplit simply figure out which files might be non-unique, and make a
single file with the definitions for both (or all) functions in it, which
it then writes (copies, hard links or symlinks - not sure which) to all the
names. If that makes several files - fine. If that makes 1 file - fine.
Either way, the first of the functions to be C<AutoLoader​::AUTOLOAD>ed will
cause the definitions for all to be found, so the others won't ever get
near AutoLoader​::AUTOLOAD, and hence there won't be problems with
"redefinition of subroutine" warnings.

Wouldn't it be simpler to have AutoSplit create a single file

  a2345678.al

for subroutines a2345678a, a2345678b etc. on an 8.3 system? If then an
attempt would be made to find file a2345678a.al for subroutine a234567a,
then the OS will truncate to a2345678.al and get the right subroutine
automagically?

Another one for my TODO list, assuming no-one else beats me to it.

Well, I got some other plans with AutoLoader, particularly creating the
ability to load all of the AutoSplit subroutines in one go. This would be
important when using AutoLoader modules in a pre-fork MPM mod_perl.

Liz

@p5pRT
Copy link
Author

p5pRT commented Sep 3, 2002

From nick.ing-simmons@elixent.com

Elizabeth Mattijsen <liz@​dijkmat.nl> writes​:

At 10​:51 PM 9/2/02 +0100, Nicholas Clark wrote​:

My suggestion, which I never found the time to make a patch, was to have
AutoSplit simply figure out which files might be non-unique, and make a
single file with the definitions for both (or all) functions in it, which
it then writes (copies, hard links or symlinks - not sure which) to all the
names.

If that makes several files - fine. If that makes 1 file - fine.

Either way, the first of the functions to be C<AutoLoader​::AUTOLOAD>ed will
cause the definitions for all to be found, so the others won't ever get
near AutoLoader​::AUTOLOAD, and hence there won't be problems with
"redefinition of subroutine" warnings.

Wouldn't it be simpler to have AutoSplit create a single file

a2345678.al

for subroutines a2345678a, a2345678b etc. on an 8.3 system? If then an
attempt would be made to find file a2345678a.al for subroutine a234567a,
then the OS will truncate to a2345678.al and get the right subroutine
automagically?

I think that is what Nick said as well. But his scheme of writing it to
all the possible names is safer if system happens to not truncate
after all. (e.g. we think we are on 8.3 because we probed the build
directory, but install directory is a "share" from a more-modern system.)

Another one for my TODO list, assuming no-one else beats me to it.

Well, I got some other plans with AutoLoader, particularly creating the
ability to load all of the AutoSplit subroutines in one go. This would be
important when using AutoLoader modules in a pre-fork MPM mod_perl.

Liz
--
Nick Ing-Simmons
http​://www.ni-s.u-net.com/

@p5pRT
Copy link
Author

p5pRT commented Sep 3, 2002

From @lizmat

At 11​:45 AM 9/3/02 +0100, Nick Ing-Simmons wrote​:

If that makes several files - fine. If that makes 1 file - fine.

Either way, the first of the functions to be C<AutoLoader​::AUTOLOAD>ed will
cause the definitions for all to be found, so the others won't ever get
near AutoLoader​::AUTOLOAD, and hence there won't be problems with
"redefinition of subroutine" warnings.
Wouldn't it be simpler to have AutoSplit create a single file
I think that is what Nick said as well. But his scheme of writing it to
all the possible names is safer if system happens to not truncate
after all. (e.g. we think we are on 8.3 because we probed the build
directory, but install directory is a "share" from a more-modern system.)

Good point. I then agree with Nick's solution.

Liz

@p5pRT
Copy link
Author

p5pRT commented Jul 26, 2004

From @doughera88

The TODO-list items mentioned here are useful, but not a bug, so I'm
closing this.

@p5pRT p5pRT closed this as completed Jul 26, 2004
@p5pRT
Copy link
Author

p5pRT commented Jul 26, 2004

@doughera88 - Status changed from 'open' 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