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

IO::Socket getsockopt subroutine on AIX #13484

Comments

Copy link

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

Searchable as RT120835$

Copy link
Author

From [email protected]

Created by [email protected]

Hi,

I've compiled my own Perl 5.18.1 on AIX 7.1 TL2 SP3 with IBM XL C/C++ v12.1.0.5
I've installed a few additional modules and one of them failed a test.
I've reported the error encountered​: https://groups.google.com/forum/#!topic/mojolicious/T34XZX72LaA
After a few tests, we've been able to target the issue in the getsockopt() subroutine of IO​::Socket. It seems that this subroutine does not meet the condition to unpack on AIX while it should do it.
I've opened a ticket against IO​::Socket​: https://rt.cpan.org/Public/Bug/Display.html?id=91183
However, it seems that IO​::Socket is now considered as part of Perl5 core and therefore this is why I'm opening this ticket today.

Best regards,

Yannick Bergeron
Advisory IT Specialist

Perl Info

Flags:
    category=library
    severity=low
    module=IO::Socket

Site configuration information for perl 5.18.1:

Configured by yaberge3 at Thu Dec  5 07:20:48 EST 2013.

Summary of my perl5 (revision 5 version 18 subversion 1) configuration:
   
  Platform:
    osname=aix, osvers=7.1.0.0, archname=aix-thread-multi
    uname='aix aix71tst 1 7 00c0eca24c00 '
    config_args='-desr -Dprefix=/usr/local/perl-5.18.1 -Uman1direxp -Uman3direxp -Doptimize=-O2 -Duselongdoubles -Dusethreads'
    hint=recommended, useposix=true, d_sigaction=define
    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 -q32', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES',
    optimize='-O2',
    cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT'
    ccversion='12.1.0.5', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    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, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -brtl -bdynamic -b32 -bmaxdata:0x80000000'
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lpthreads -lc
    perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc
    libc=, so=a, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -bE:/usr/local/perl-5.18.1/lib/5.18.1/aix-thread-multi/CORE/perl.exp'
    cccdlflags=' ', lddlflags='-bhalt:4 -G -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -bnoentry -lpthreads -lc -lm'

Locally applied patches:
    


@INC for perl 5.18.1:
    /usr/local/perl-5.18.1/lib/site_perl/5.18.1/aix-thread-multi
    /usr/local/perl-5.18.1/lib/site_perl/5.18.1
    /usr/local/perl-5.18.1/lib/5.18.1/aix-thread-multi
    /usr/local/perl-5.18.1/lib/5.18.1
    .


Environment for perl 5.18.1:
    HOME=/home/root/
    LANG=en_US
    LANGUAGE (unset)
    LC__FASTMSG=true
    LD_LIBRARY_PATH (unset)
    LIBPATH (unset)
    LOGDIR (unset)
    PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java7/jre/bin:/sbin:/home/root/:/usr/local/bin:/usr/sbin/acct:/opt/IBM/ITM/bin
    PERL_BADLANG (unset)
    SHELL=/usr/bin/ksh


Copy link
Author

From @rurban

https://groups.google.com/forum/#!topic/mojolicious/T34XZX72LaA

John K. patch looks good but can you test it?

pp_sys.c​:
  case OP_GSOCKOPT​:
  SvGROW(sv, 257);
  (void)SvPOK_only(sv);
  SvCUR_set(sv,256);
  *SvEND(sv) ='\0';
  len = SvCUR(sv);
  if (PerlSock_getsockopt(fd, lvl, optname, SvPVX(sv), &len) < 0)
  goto nuts2;
  SvCUR_set(sv, len);
  *SvEND(sv) ='\0';
  PUSHs(sv);
  break;
=>
  if (PerlSock_getsockopt(fd, lvl, optname, SvPVX(sv), &len) < 0)
  goto nuts2;
  #if defined(_AIX)
  if (len == 256)
  len = sizeof(int);
  #endif
  SvCUR_set(sv, len);
  ...
--
Reini Urban

Copy link
Author

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

Copy link
Author

From [email protected]

Hi,

I've tested it and it works.
Is it too late to get this in 5.18.2?
If so, could this be added for 5.18.3 and 5.19/5.20?

Best regards,

Yannick Bergeron
Advisory IT Specialist

From​: "Reini Urban via RT" <perlbug-followup@​perl.org>
To​: Yannick Y Bergeron/Bromont/IBM@​IBMCA,
Date​: 12/21/2013 12​:44 PM
Subject​: [perl #120835] IO​::Socket getsockopt subroutine on AIX

https://groups.google.com/forum/#!topic/mojolicious/T34XZX72LaA

John K. patch looks good but can you test it?

pp_sys.c​:
  case OP_GSOCKOPT​:
  SvGROW(sv, 257);
  (void)SvPOK_only(sv);
  SvCUR_set(sv,256);
  *SvEND(sv) ='\0';
  len = SvCUR(sv);
  if (PerlSock_getsockopt(fd, lvl, optname, SvPVX(sv), &len) < 0)
  goto nuts2;
  SvCUR_set(sv, len);
  *SvEND(sv) ='\0';
  PUSHs(sv);
  break;
=>
  if (PerlSock_getsockopt(fd, lvl, optname, SvPVX(sv), &len) < 0)
  goto nuts2;
  #if defined(_AIX)
  if (len == 256)
  len = sizeof(int);
  #endif
  SvCUR_set(sv, len);
  ...
--
Reini Urban

1 similar comment
Copy link
Author

From [email protected]

Hi,

I've tested it and it works.
Is it too late to get this in 5.18.2?
If so, could this be added for 5.18.3 and 5.19/5.20?

Best regards,

Yannick Bergeron
Advisory IT Specialist

From​: "Reini Urban via RT" <perlbug-followup@​perl.org>
To​: Yannick Y Bergeron/Bromont/IBM@​IBMCA,
Date​: 12/21/2013 12​:44 PM
Subject​: [perl #120835] IO​::Socket getsockopt subroutine on AIX

https://groups.google.com/forum/#!topic/mojolicious/T34XZX72LaA

John K. patch looks good but can you test it?

pp_sys.c​:
  case OP_GSOCKOPT​:
  SvGROW(sv, 257);
  (void)SvPOK_only(sv);
  SvCUR_set(sv,256);
  *SvEND(sv) ='\0';
  len = SvCUR(sv);
  if (PerlSock_getsockopt(fd, lvl, optname, SvPVX(sv), &len) < 0)
  goto nuts2;
  SvCUR_set(sv, len);
  *SvEND(sv) ='\0';
  PUSHs(sv);
  break;
=>
  if (PerlSock_getsockopt(fd, lvl, optname, SvPVX(sv), &len) < 0)
  goto nuts2;
  #if defined(_AIX)
  if (len == 256)
  len = sizeof(int);
  #endif
  SvCUR_set(sv, len);
  ...
--
Reini Urban

Copy link
Author

From [email protected]

Hi,

Is it possible to get the attention of a Perl porter who could commit this
change so it could be part of the next Perl releases ? (5.18.3, 5.19.x,
5.20.x)

Best regards,

Yannick Bergeron
Advisory IT Specialist

Copy link
Author

From @rjbs

On Mon Jan 13 04​:32​:14 2014, yaberger@​ca.ibm.com wrote​:

Is it possible to get the attention of a Perl porter who could commit this
change so it could be part of the next Perl releases ? (5.18.3, 5.19.x,
5.20.x)

I've added it to the 5.18.3 blockers to be reviewed.

Meanwhile, this needs review for 5.20.0 as well, and I'll flag it for that too in a moment.

--
rjbs

Copy link
Author

From @tonycoz

On Mon Feb 10 14​:55​:06 2014, rjbs wrote​:

On Mon Jan 13 04​:32​:14 2014, yaberger@​ca.ibm.com wrote​:

Is it possible to get the attention of a Perl porter who could commit
this
change so it could be part of the next Perl releases ? (5.18.3,
5.19.x,
5.20.x)

I've added it to the 5.18.3 blockers to be reviewed.

Meanwhile, this needs review for 5.20.0 as well, and I'll flag it for
that too in a moment.

Essentially this change was applied as ee2276e by jhi.

I vote to backport to 5.20, any others?

Tony

Copy link
Author

From @cpansprout

On Wed Oct 22 21​:14​:39 2014, tonyc wrote​:

On Mon Feb 10 14​:55​:06 2014, rjbs wrote​:

On Mon Jan 13 04​:32​:14 2014, yaberger@​ca.ibm.com wrote​:

Is it possible to get the attention of a Perl porter who could
commit
this
change so it could be part of the next Perl releases ? (5.18.3,
5.19.x,
5.20.x)

I've added it to the 5.18.3 blockers to be reviewed.

Meanwhile, this needs review for 5.20.0 as well, and I'll flag it for
that too in a moment.

Essentially this change was applied as
ee2276e by jhi.

I vote to backport to 5.20, any others?

Makes sense to me. (I actually understand it, believe it or not.) +1.

--

Father Chrysostomos

Copy link
Author

From @jkeenan

On Wed Oct 22 21​:14​:39 2014, tonyc wrote​:

Essentially this change was applied as
ee2276e by jhi.

I vote to backport to 5.20, any others?

Tony

+1 - though that's from someone with no experience with AIX

--
James E Keenan (jkeenan@​cpan.org)

Copy link
Author

From @cpansprout

On Thu Oct 23 15​:55​:48 2014, jkeenan wrote​:

On Wed Oct 22 21​:14​:39 2014, tonyc wrote​:

Essentially this change was applied as
ee2276e by jhi.

I vote to backport to 5.20, any others?

Tony

+1 - though that's from someone with no experience with AIX

Thank you. Done in e8ac1ac.

--

Father Chrysostomos

Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant