develooper Front page | perl.perl5.porters | Postings from September 2014

[perl #122684] character limit on socket path "Local" arg for IO::Socket::UNIX

Thread Next
From:
Mark Hedges
Date:
September 7, 2014 17:50
Subject:
[perl #122684] character limit on socket path "Local" arg for IO::Socket::UNIX
Message ID:
rt-4.0.18-21829-1409697184-445.122684-75-0@perl.org
# New Ticket Created by  Mark Hedges 
# Please include the string:  [perl #122684]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=122684 >


It seems like there is a 109-character limit on socket file path names, at least with IO::Socket::UNIX.  It silently truncates the file path without error or warning, which is difficult to debug.  This is perl 5.20.0.  I didn't find anything in the manual about this.  Thank you.  -Mark

PRD me@myhost /tmp
2014-09-02 15:26:42 Tue  PRD $ perl -e 'use IO::Socket::UNIX; print $IO::Socket::UNIX::VERSION, "\n"'
1.26

PRD me@myhost /tmp
2014-09-02 15:28:34 Tue  PRD $ perl -e 'use IO::Socket::UNIX; print $IO::Socket::VERSION, "\n"'
1.37

PRD me@myhost /tmp
2014-09-02 15:15:42 Tue  PRD $ mkdir -p /tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/

PRD me@myhost /tmp
2014-09-02 15:16:35 Tue  PRD $ perl
use IO::Socket::UNIX;
my $sock = IO::Socket::UNIX->new(
Local => '/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/foo.sock',
Type => SOCK_STREAM,
Listen => 1,
);

PRD me@myhost /tmp
2014-09-02 15:17:04 Tue  PRD $ find /tmp/iosock_longname_test/
/tmp/iosock_longname_test/
/tmp/iosock_longname_test/123456789
/tmp/iosock_longname_test/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/12
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789

PRD me@myhost /tmp
2014-09-02 15:17:07 Tue  PRD $ ls -lah /tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/12
srwxr-xr-x 1 sre sre 0 Sep  2 15:17 /tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/12

PRD me@myhost /tmp
2014-09-02 15:17:34 Tue  PRD $ perl
use IO::Socket::UNIX;
my $sock = IO::Socket::UNIX->new(
Local => '/tmp/iosock_longname_test/abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij.sock',
Type => SOCK_STREAM,
Listen => 1,
);

PRD me@myhost /tmp
2014-09-02 15:18:41 Tue  PRD $ !find
find /tmp/iosock_longname_test/
/tmp/iosock_longname_test/
/tmp/iosock_longname_test/abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijab
/tmp/iosock_longname_test/123456789
/tmp/iosock_longname_test/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/12
/tmp/iosock_longname_test/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789

PRD me@myhost /tmp
2014-09-02 15:18:46 Tue  PRD $ echo '/tmp/iosock_longname_test/abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijab' | wc
      1       1     109

PRD me@myhost /tmp
2014-09-02 15:26:41 Tue  PRD $ perl -V
Summary of my perl5 (revision 5 version 20 subversion 0) configuration:

  Platform:
    osname=linux, osvers=2.6.18-308.0.0.0.1.el5xen, archname=x86_64-linux-thread-multi-ld
    uname='linux nwa1.ntf.cft1.coresys.tmcs 2.6.18-308.0.0.0.1.el5xen #1 smp sat feb 25 16:26:29 est 2012 x86_64 x86_64 x86_64 gnulinux '
    config_args='-de -Dprefix=/ntfhome/local -Duse64bitall -Dusethreads -Dinc_version_list=none -Duselongdouble -Dusemorebits -Dotherlibdirs=/ntf/shared/ntf/lib/perl5 -A ccflags=-fPIC'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    use64bitint=define, use64bitall=define, uselongdouble=define
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-52)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='long double', nvsize=16, Off_t='off_t', lseeksize=8
    alignbytes=16, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib /lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.5'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl):
  Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
                        USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS
                        USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
                        USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE
                        USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API
  Built under linux
  Compiled at Jul 13 2014 21:00:46
  @INC:
    /ntfhome/local/lib/perl5/site_perl/5.20.0/x86_64-linux-thread-multi-ld
    /ntfhome/local/lib/perl5/site_perl/5.20.0
    /ntfhome/local/lib/perl5/5.20.0/x86_64-linux-thread-multi-ld
    /ntfhome/local/lib/perl5/5.20.0
    /ntf/shared/ntf/lib/perl5/x86_64-linux-thread-multi-ld
    /ntf/shared/ntf/lib/perl5
    .


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About