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

Commit 2359510ddb causes test failures on AFS #8362

Open
p5pRT opened this issue Mar 10, 2006 · 11 comments
Open

Commit 2359510ddb causes test failures on AFS #8362

p5pRT opened this issue Mar 10, 2006 · 11 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 10, 2006

Migrated from rt.perl.org#38698 (status was 'stalled')

Searchable as RT38698$

@p5pRT
Copy link
Author

p5pRT commented Mar 10, 2006

From peter@tweety.homeip.net

Created by peter@tweety.homeip.net

This is a bug report for perl from peter@​tweety.homeip.net,
generated with the help of perlbug 1.35 running under perl 5.9.4.

-----------------------------------------------------------------

Change 22258 causes ext/IO/t/io_unix.t to fail and/or hang when
building on AFS. (Yes, this has been in since 5.8.4... it took me a
while to try it out on AFS.)

The line affected​:

< $PATH = "/tmp/sock-$$";

$PATH = "sock-$$";

This means that when attempting to open the Unix domain socket​:

  $sock = IO​::Socket​::UNIX->new(Peer => $PATH) or die "$!";

it is happening on AFS instead of /tmp and Unix domain sockets are not
supported on AFS, so it loses.

It would be helpful if this could be changed back to use /tmp, if only
on AFS (although that would be hard to find out since $afs isn't
propagated by configpm). I don't see any other files where there is a
problem for AFS.

Perl Info

Flags:
    category=core
    severity=low

Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
    osname=solaris, osvers=2.9, archname=sun4-solaris
    uname='sunos xxx 5.9 generic_112233-06 sun4u sparc sunw,sun-blade-100 solaris '
    config_args='-de -Dcc=gcc -B/usr/ccs/bin/ -Uusemymalloc'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc -B/usr/ccs/bin/', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement '
    ccversion='', gccversion='3.0', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc -B/usr/ccs/bin/', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldb -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Characteristics of this binary (from libperl): 
  Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO
  Built under solaris
  Compiled at Mar  7 2006 13:30:05
[...]

@p5pRT
Copy link
Author

p5pRT commented Mar 10, 2006

From @pjscott

I screwed up on the account this bug was sent from; that email address
doesn't work. Please use Peter@​PSDT.com for all replies. Thanks.

--
Peter Scott

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2006

From guest@guest.guest.xxxxxxxx

After 2 days of wondering why my 'make test' hangs at io_unix.t and
trying to build different Perl versions, it looks like I've found my
culprit (this ticket).

Just another vote for this being fixed.

That's what I get for running 'make test' for the first time in 12 years.

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2006

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 4, 2006

From @smpeters

[peter@​tweety.homeip.net - Thu Mar 09 18​:46​:02 2006]​:

This is a bug report for perl from peter@​tweety.homeip.net,
generated with the help of perlbug 1.35 running under perl 5.9.4.

-----------------------------------------------------------------

Change 22258 causes ext/IO/t/io_unix.t to fail and/or hang when
building on AFS. (Yes, this has been in since 5.8.4... it took me a
while to try it out on AFS.)

The line affected​:

< $PATH = "/tmp/sock-$$";

$PATH = "sock-$$";

This means that when attempting to open the Unix domain socket​:

$sock = IO​::Socket​::UNIX->new(Peer => $PATH) or die "$!";

it is happening on AFS instead of /tmp and Unix domain sockets are not
supported on AFS, so it loses.

It would be helpful if this could be changed back to use /tmp, if only
on AFS (although that would be hard to find out since $afs isn't
propagated by configpm). I don't see any other files where there is a
problem for AFS.

Unfortunately, I doubt that any code changed by change #22258 will be
reverted. Is there a way to tell whether a current directory is on an
AFS file system?

@p5pRT
Copy link
Author

p5pRT commented May 4, 2006

From @pjscott

On Thu, 04 May 2006 04​:57​:03 -0700, Steve Peters via RT wrote​:

Change 22258 causes ext/IO/t/io_unix.t to fail and/or hang when
building on AFS. (Yes, this has been in since 5.8.4... it took me a
while to try it out on AFS.)
[...]
Unfortunately, I doubt that any code changed by change #22258 will be
reverted. Is there a way to tell whether a current directory is on an
AFS file system?

$Config{afs} is all you need when building perl. This patch would do it​:

Inline Patch
--- ext/IO/t/io_unix.t.orig     2006-05-04 05:55:34.000001000 -0700
+++ ext/IO/t/io_unix.t  2006-05-04 05:56:38.000001000 -0700
@@ -37,7 +37,7 @@
     }
 }
 
-$PATH = "sock-$$";
+$PATH = $Config{'afs'} eq 'true' ? "/tmp/sock-$$" : "sock-$$";
 
 # Test if we can create the file within the tmp directory
 if (-e $PATH or not open(TEST, ">$PATH") and $^O ne 'os2') {


-- 

Peter Scott
http​://www.perlmedic.com/
http​://www.perldebugged.com/

@p5pRT
Copy link
Author

p5pRT commented May 4, 2006

From @iabyn

On Thu, May 04, 2006 at 05​:59​:43AM -0700, Peter Scott wrote​:

$Config{afs} is all you need when building perl. This patch would do it​:

--- ext/IO/t/io_unix.t.orig 2006-05-04 05​:55​:34.000001000 -0700
+++ ext/IO/t/io_unix.t 2006-05-04 05​:56​:38.000001000 -0700
@​@​ -37,7 +37,7 @​@​
}
}

-$PATH = "sock-$$";
+$PATH = $Config{'afs'} eq 'true' ? "/tmp/sock-$$" : "sock-$$";

But $Config{afs} just says that AFS is (probably) running on this machine;
it makes no assertions as to whether the current directory is an AFS
filesystem.

Also, the current test code already falls back to using /tmp (or
$ENV{TMPDIR}) if the socket creation fails in the current directory.

--
Counsellor Troi states something other than the blindingly obvious.
  -- Things That Never Happen in "Star Trek" #16

@p5pRT
Copy link
Author

p5pRT commented May 4, 2006

From mjtg@cam.ac.uk

Dave Mitchell <davem@​iabyn.com> wrote

Also, the current test code already falls back to using /tmp (or
$ENV{TMPDIR}) if the socket creation fails in the current directory.

If that's the case, and the patch isn't needed, why is the test failing?

Mike Guy

@p5pRT
Copy link
Author

p5pRT commented May 4, 2006

From @pjscott

At 06​:24 AM 5/4/2006, Dave Mitchell via RT wrote​:

On Thu, May 04, 2006 at 05​:59​:43AM -0700, Peter Scott wrote​:

$Config{afs} is all you need when building perl. This patch would do it​:

--- ext/IO/t/io_unix.t.orig 2006-05-04 05​:55​:34.000001000 -0700
+++ ext/IO/t/io_unix.t 2006-05-04 05​:56​:38.000001000 -0700
@​@​ -37,7 +37,7 @​@​
}
}

-$PATH = "sock-$$";
+$PATH = $Config{'afs'} eq 'true' ? "/tmp/sock-$$" : "sock-$$";

But $Config{afs} just says that AFS is (probably) running on this machine;
it makes no assertions as to whether the current directory is an AFS
filesystem.

True; but it is a reasonable heuristic short of invoking Cwd​::abs_path
to see if it starts with /afs/. Would you prefer that?

Also, the current test code already falls back to using /tmp (or
$ENV{TMPDIR}) if the socket creation fails in the current directory.

Unfortunately, on AFS it takes an infinite amount of time to fail. Or
at least more than the hour or so I've given it.

--
Peter Scott
Pacific Systems Design Technologies

@p5pRT
Copy link
Author

p5pRT commented May 16, 2008

p5p@spam.wizbit.be - Status changed from 'open' to 'stalled'

@jkeenan
Copy link
Contributor

jkeenan commented Feb 22, 2020

This issue's name refers to a commit number from an old version control system. This is the commit in question in git:

commit 2359510ddb135dcc6e80153f51cff0a97b20b597
Author:     Solar Designer <solar@openwall.com>
AuthorDate: Mon Jan 26 04:22:18 2004 +0300
Commit:     Dave Mitchell <davem@fdisolutions.com>
CommitDate: Sun Feb 1 17:40:02 2004 +0000

    Re: [perl #15063] /tmp issues
    Message-ID: <20040125222218.GA13499@openwall.com>
    
    Remove insecure usage of /tmp from code and documentation
    
    p4raw-id: //depot/perl@22258

Changing subject to reflect that.

@jkeenan jkeenan changed the title Change 22258 causes test failures on AFS Commit 2359510ddb causes test failures on AFS Feb 22, 2020
@xenu xenu removed the Severity Low label Dec 29, 2021
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

3 participants