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

perl-5.24.3, wrong Configure test for IPC_STAT #16297

Closed
p5pRT opened this issue Dec 10, 2017 · 13 comments
Closed

perl-5.24.3, wrong Configure test for IPC_STAT #16297

p5pRT opened this issue Dec 10, 2017 · 13 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 10, 2017

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

Searchable as RT132560$

@p5pRT
Copy link
Author

p5pRT commented Dec 10, 2017

From Joakim.Tjernlund@infinera.com

This is a bug report for perl from Joakim.Tjernlund@​infinera.com,
generated with the help of perlbug 1.40 running under perl 5.24.3.


in perl Configure script there is this test for IPC_STAT​:

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include "tryh.h"
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
int main() {
  struct semid_ds arg;
  int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
  printf("size​:%d\n", sizeof(semopts));
  sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
  if (sem > -1) {
# ifdef IPC_STAT
  st = semctl(sem, 0, IPC_STAT, &arg);
  if (st == 0)
  printf("semid_ds\n");
  else
# endif /* IPC_STAT */
  printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
  if (semctl(sem, 0, IPC_RMID, &arg) != 0)
# endif /* IPC_RMID */
  printf("semctl IPC_RMID failed​: errno = %d\n", errno);
  } else
#endif /* IPC_PRIVATE && ... */
  printf("semget failed​: errno = %d\n", errno);

  return 0;
}

This fails on ppc32 with​:
  semctl IPC_STAT failed​: errno = 14
because the test is flawed. The semctl() test must be like so​:

  union semun {
  void *buf;
  } semopts;
  semopts.buf = &arg;
..
  st = semctl(sem, 0, IPC_STAT, semopts);
..
  if (semctl(sem, 0, IPC_RMID, semopts) != 0) /* semopts not really needed */

Now the test works.



Flags​:
  category=core
  severity=medium


Site configuration information for perl 5.24.3​:

Configured by Gentoo at Fri Oct 13 16​:43​:19 CEST 2017.

Summary of my perl5 (revision 5 version 24 subversion 3) configuration​:
 
  Platform​:
  osname=linux, osvers=4.12.8, archname=x86_64-linux
  uname='linux gentoo-jocke.infinera.com 4.12.8 #1 smp preempt wed aug 30 19​:00​:29 cest 2017 x86_64 intel(r) core(tm) i7-2600 cpu @​ 3.40ghz genuineintel gnulinux '
  config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none -Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux 5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dnoextensions=ODBM_File -Duseshrplib -Darchname=x86_64-linux -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-O2 -pipe -Dldflags=-Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr/local -Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib64/perl5/5.24.3 -Darchlib=/usr/lib64/perl5/5.24.3/x86_64-linux -Dsitelib=/usr/local/lib64/perl5/5.24.3 -Dsitearch=/usr/local/lib64/perl5/5.24.3/x86_64-linux -Dvendorlib=/usr/lib64/perl5/vendor_perl/5.24.3 -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -D
libperl=
libperl.so.5.24.3 -Dlocincpth=/usr/include -Dglibpth=/lib64 /usr/lib64 -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@​localhost -Ud_csh -Dsh=/bin/sh -Dtargetsh=/bin/sh -Uusenm -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none -Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux 5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dnoextensions=ODBM_File'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2 -pipe',
  cppflags='-fwrapv -fno-strict-aliasing -pipe'
  ccversion='', gccversion='5.4.0', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='x86_64-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
  libpth=/usr/local/lib64 /lib64 /usr/lib64 /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include-fixed /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib
  libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
  perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
  libc=libc-2.23.so, so=so, useshrplib=true, libperl=libperl.so.5.24.3
  gnulibc_version='2.23'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -O2 -pipe -Wl,-O1 -Wl,--as-needed'

Locally applied patches​:
  gentoo/hints_hpux - Fix hpux hints
  gentoo/aix_soname - aix gcc detection and shared library soname support
  gentoo/EUMM-RUNPATH - https://bugs.gentoo.org/105054 cpan/ExtUtils-MakeMaker​: drop $PORTAGE_TMPDIR from LD_RUN_PATH
  gentoo/config_over - Remove -rpath and append LDFLAGS to lddlflags
  gentoo/opensolaris_headers - Add headers for opensolaris
  gentoo/patchlevel - List packaged patches for perl-5.24.3(#1) in patchlevel.h
  gentoo/cleanup-paths - Cleanup PATH and shrpenv
  gentoo/enc2xs - Tweak enc2xs to follow symlinks and ignore missing @​INC directories.
  gentoo/darwin-cc-ld - https://bugs.gentoo.org/297751 darwin​: Use $CC to link
  gentoo/cpan_definstalldirs - Provide a sensible INSTALLDIRS default for modules installed from CPAN.
  gentoo/interix - Fix interix hints
  gentoo/create_libperl_soname - https://bugs.gentoo.org/286840 Set libperl soname
  gentoo/mod_paths - Add /etc/perl to @​INC
  gentoo/EUMM_perllocalpod - cpan/ExtUtils-MakeMaker​: remove targets that generate perllocal.pod
  gentoo/drop_fstack_protector - https://bugs.gentoo.org/348557 Don't force -fstack-protector on everyone
  gentoo/usr_local - Configure​: Don't include sources in /usr/local/ for compiling perl
  gentoo/D-SHA-CFLAGS - https://bugs.gentoo.org/506818 Do not set custom CFLAGS in cpan/Digest-SHA
  gentoo/io_socket_ip_tests - cpan/IO-Socket-IP​: Disable network tests
  gentoo/cygwin-libperl - Cygwin​: avoid libperl.dll.dll.a
  gentoo/tests - Fixup EUMM perlocal.pod tests and customised SHA1s
  gentoo/zlib-1.2.9-backported-fixes - [rt#119762] Compress-Raw-Zlib​: backport zlib 1.2.9+ fixes from upstream 2.073
  debian/cpan-missing-site-dirs - Fix CPAN​::FirstTime defaults with nonexisting site dirs if a parent is writable
  debian/makemaker-pasthru - Pass LD settings through to subdirectories
  fixes/memoize_storable_nstore - [rt.cpan.org #77790] Memoize​::Storable​: respect 'nstore' option not respected
  fixes/podman-pipe - Better errors for man pages from standard input
  fixes/respect_umask - Respect umask during installation
  fixes/net_smtp_docs - [rt.cpan.org #36038] Document the Net​::SMTP 'Port' option
  fixes/document_makemaker_ccflags - [rt.cpan.org #68613] Document that CCFLAGS should include $Config{ccflags}
  fixes/parallel-manisort.patch - Fix parallel building


@​INC for perl 5.24.3​:
  /etc/perl
  /usr/local/lib64/perl5/5.24.3/x86_64-linux
  /usr/local/lib64/perl5/5.24.3
  /usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
  /usr/lib64/perl5/vendor_perl/5.24.3
  /usr/local/lib64/perl5
  /usr/lib64/perl5/vendor_perl/5.24.1
  /usr/lib64/perl5/vendor_perl
  /usr/lib64/perl5/5.24.3/x86_64-linux
  /usr/lib64/perl5/5.24.3


Environment for perl 5.24.3​:
  HOME=/home/jocke
  LANG=en_GB.utf8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0​:/usr/x86_64-pc-linux-gnu/powerpc-g2.20-linux-gnu/gcc-bin/4.9.3​:/usr/i686-pc-linux-gnu/powerpc-softfloat-linux-gnu/gcc-bin/3.4.6​:/usr/x86_64-pc-linux-gnu/powerpc-softfloat_4.5.3-linux-gnu/gcc-bin/4.5.3​:/usr/x86_64-pc-linux-gnu/powerpc-softfloat_4.9.3-linux-gnu/gcc-bin/4.9.4​:/usr/x86_64-pc-linux-gnu/x86_64-inf-linux-gnu/gcc-bin/4.9.4​:/usr/local/bin​:/usr/bin​:/bin​:/opt/bin​:/usr/games/bin
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2017

From @jkeenan

On Sun, 10 Dec 2017 17​:19​:46 GMT, Joakim.Tjernlund@​infinera.com wrote​:

This is a bug report for perl from Joakim.Tjernlund@​infinera.com,
generated with the help of perlbug 1.40 running under perl 5.24.3.

-----------------------------------------------------------------
in perl Configure script there is this test for IPC_STAT​:

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include "tryh.h"
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
int main() {
struct semid_ds arg;
int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) &&
defined(S_IRWXO) && defined(IPC_CREAT)
printf("size​:%d\n", sizeof(semopts));
sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
if (sem > -1) {
# ifdef IPC_STAT
st = semctl(sem, 0, IPC_STAT, &arg);
if (st == 0)
printf("semid_ds\n");
else
# endif /* IPC_STAT */
printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
if (semctl(sem, 0, IPC_RMID, &arg) != 0)
# endif /* IPC_RMID */
printf("semctl IPC_RMID failed​: errno = %d\n", errno);
} else
#endif /* IPC_PRIVATE && ... */
printf("semget failed​: errno = %d\n", errno);

return 0;
}

This fails on ppc32 with​:
semctl IPC_STAT failed​: errno = 14
because the test is flawed. The semctl() test must be like so​:

union semun {
void *buf;
} semopts;
semopts.buf = &arg;
..
st = semctl(sem, 0, IPC_STAT, semopts);
..
if (semctl(sem, 0, IPC_RMID, semopts) != 0) /* semopts not really
needed */

Now the test works.

I'm having trouble understanding exactly where in Configure you think a correction should be made.

Would you be able to do a checkout of the Perl 5 git repository, create a patch to Configure with your corrections and, assuming the patch "works", attach that patch to this ticket?

[Note to metaconfig team​: I *think* this pertains to approx. line 190 in U/modified/d_union_semun.U.]

Thank you very much.


---
Flags​:
category=core
severity=medium
---
Site configuration information for perl 5.24.3​:

Configured by Gentoo at Fri Oct 13 16​:43​:19 CEST 2017.

Summary of my perl5 (revision 5 version 24 subversion 3)
configuration​:

Platform​:
osname=linux, osvers=4.12.8, archname=x86_64-linux
uname='linux gentoo-jocke.infinera.com 4.12.8 #1 smp preempt wed aug
30 19​:00​:29 cest 2017 x86_64 intel(r) core(tm) i7-2600 cpu @​ 3.40ghz
genuineintel gnulinux '
config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n
-Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none
-Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux
5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64
/usr/lib64 -Dnoextensions=ODBM_File -Duseshrplib -Darchname=x86_64-
linux -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-O2 -pipe -Dldflags=-
Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr/local
-Dvendorprefix=/usr -Dscriptdir=/usr/bin
-Dprivlib=/usr/lib64/perl5/5.24.3
-Darchlib=/usr/lib64/perl5/5.24.3/x86_64-linux
-Dsitelib=/usr/local/lib64/perl5/5.24.3
-Dsitearch=/usr/local/lib64/perl5/5.24.3/x86_64-linux
-Dvendorlib=/usr/lib64/perl5/vendor_perl/5.24.3
-Dvendorarch=/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
-Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3
-Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3
-Dvendorman1dir=/usr/share/man/man1
-Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -D
libperl=
libperl.so.5.24.3 -Dlocincpth=/usr/include -Dglibpth=/lib64
/usr/lib64 -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo
-Dmyhostname=localhost -Dperladmin=root@​localhost -Ud_csh -Dsh=/bin/sh
-Dtargetsh=/bin/sh -Uusenm -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none
-Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux
5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64
/usr/lib64 -Dnoextensions=ODBM_File'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fwrapv -fno-strict-aliasing
-pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -pipe',
cppflags='-fwrapv -fno-strict-aliasing -pipe'
ccversion='', gccversion='5.4.0', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678,
doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16,
longdblkind=3
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='x86_64-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
libpth=/usr/local/lib64 /lib64 /usr/lib64 /usr/lib/gcc/x86_64-pc-
linux-gnu/5.4.0/include-fixed /usr/lib /lib/../lib64 /usr/lib/../lib64
/lib
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
-lgdbm_compat
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.23.so, so=so, useshrplib=true, libperl=libperl.so.5.24.3
gnulibc_version='2.23'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -pipe -Wl,-O1 -Wl,--as-
needed'

Locally applied patches​:
gentoo/hints_hpux - Fix hpux hints
gentoo/aix_soname - aix gcc detection and shared library soname
support
gentoo/EUMM-RUNPATH - https://bugs.gentoo.org/105054
cpan/ExtUtils-MakeMaker​: drop $PORTAGE_TMPDIR from LD_RUN_PATH
gentoo/config_over - Remove -rpath and append LDFLAGS to lddlflags
gentoo/opensolaris_headers - Add headers for opensolaris
gentoo/patchlevel - List packaged patches for perl-5.24.3(#1) in
patchlevel.h
gentoo/cleanup-paths - Cleanup PATH and shrpenv
gentoo/enc2xs - Tweak enc2xs to follow symlinks and ignore missing
@​INC directories.
gentoo/darwin-cc-ld - https://bugs.gentoo.org/297751 darwin​: Use
$CC to link
gentoo/cpan_definstalldirs - Provide a sensible INSTALLDIRS
default for modules installed from CPAN.
gentoo/interix - Fix interix hints
gentoo/create_libperl_soname - https://bugs.gentoo.org/286840 Set
libperl soname
gentoo/mod_paths - Add /etc/perl to @​INC
gentoo/EUMM_perllocalpod - cpan/ExtUtils-MakeMaker​: remove targets
that generate perllocal.pod
gentoo/drop_fstack_protector - https://bugs.gentoo.org/348557
Don't force -fstack-protector on everyone
gentoo/usr_local - Configure​: Don't include sources in /usr/local/
for compiling perl
gentoo/D-SHA-CFLAGS - https://bugs.gentoo.org/506818 Do not set
custom CFLAGS in cpan/Digest-SHA
gentoo/io_socket_ip_tests - cpan/IO-Socket-IP​: Disable network
tests
gentoo/cygwin-libperl - Cygwin​: avoid libperl.dll.dll.a
gentoo/tests - Fixup EUMM perlocal.pod tests and customised SHA1s
gentoo/zlib-1.2.9-backported-fixes - [rt#119762] Compress-Raw-
Zlib​: backport zlib 1.2.9+ fixes from upstream 2.073
debian/cpan-missing-site-dirs - Fix CPAN​::FirstTime defaults with
nonexisting site dirs if a parent is writable
debian/makemaker-pasthru - Pass LD settings through to
subdirectories
fixes/memoize_storable_nstore - [rt.cpan.org #77790]
Memoize​::Storable​: respect 'nstore' option not respected
fixes/podman-pipe - Better errors for man pages from standard
input
fixes/respect_umask - Respect umask during installation
fixes/net_smtp_docs - [rt.cpan.org #36038] Document the Net​::SMTP
'Port' option
fixes/document_makemaker_ccflags - [rt.cpan.org #68613] Document
that CCFLAGS should include $Config{ccflags}
fixes/parallel-manisort.patch - Fix parallel building

---
@​INC for perl 5.24.3​:
/etc/perl
/usr/local/lib64/perl5/5.24.3/x86_64-linux
/usr/local/lib64/perl5/5.24.3
/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
/usr/lib64/perl5/vendor_perl/5.24.3
/usr/local/lib64/perl5
/usr/lib64/perl5/vendor_perl/5.24.1
/usr/lib64/perl5/vendor_perl
/usr/lib64/perl5/5.24.3/x86_64-linux
/usr/lib64/perl5/5.24.3

---
Environment for perl 5.24.3​:
HOME=/home/jocke
LANG=en_GB.utf8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0​:/usr/x86_64-pc-linux-
gnu/powerpc-g2.20-linux-gnu/gcc-bin/4.9.3​:/usr/i686-pc-linux-
gnu/powerpc-softfloat-linux-gnu/gcc-bin/3.4.6​:/usr/x86_64-pc-linux-
gnu/powerpc-softfloat_4.5.3-linux-gnu/gcc-bin/4.5.3​:/usr/x86_64-pc-
linux-gnu/powerpc-softfloat_4.9.3-linux-gnu/gcc-bin/4.9.4​:/usr/x86_64-
pc-linux-gnu/x86_64-inf-linux-gnu/gcc-
bin/4.9.4​:/usr/local/bin​:/usr/bin​:/bin​:/opt/bin​:/usr/games/bin
PERL_BADLANG (unset)
SHELL=/bin/bash

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

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2017

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

@p5pRT
Copy link
Author

p5pRT commented Dec 14, 2017

From Joakim.Tjernlund@infinera.com

On Mon, 2017-12-11 at 16​:43 -0800, James E Keenan via RT wrote​:

On Sun, 10 Dec 2017 17​:19​:46 GMT, Joakim.Tjernlund@​infinera.com wrote​:

This is a bug report for perl from Joakim.Tjernlund@​infinera.com,
generated with the help of perlbug 1.40 running under perl 5.24.3.

-----------------------------------------------------------------
in perl Configure script there is this test for IPC_STAT​:

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include "tryh.h"
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
int main() {
struct semid_ds arg;
int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) &&
defined(S_IRWXO) && defined(IPC_CREAT)
printf("size​:%d\n", sizeof(semopts));
sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
if (sem > -1) {
# ifdef IPC_STAT
st = semctl(sem, 0, IPC_STAT, &arg);
if (st == 0)
printf("semid_ds\n");
else
# endif /* IPC_STAT */
printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
if (semctl(sem, 0, IPC_RMID, &arg) != 0)
# endif /* IPC_RMID */
printf("semctl IPC_RMID failed​: errno = %d\n", errno);
} else
#endif /* IPC_PRIVATE && ... */
printf("semget failed​: errno = %d\n", errno);

return 0;
}

This fails on ppc32 with​:
semctl IPC_STAT failed​: errno = 14
because the test is flawed. The semctl() test must be like so​:

union semun {
void *buf;
} semopts;
semopts.buf = &arg;
..
st = semctl(sem, 0, IPC_STAT, semopts);
..
if (semctl(sem, 0, IPC_RMID, semopts) != 0) /* semopts not really
needed */

Now the test works.

I'm having trouble understanding exactly where in Configure you think a correction should be made.

Me too, I just snagged the try.c files and worked from there.

Would you be able to do a checkout of the Perl 5 git repository, create a patch to Configure with your corrections and, assuming the patch "works", attach that patch to this ticket?

Sorry, not any easier for me, not even knowing anything about perl internal build system.

[Note to metaconfig team​: I *think* this pertains to approx. line 190 in U/modified/d_union_semun.U.]

Thank you very much.
-----------------------------------------------------------------

---
Flags​:
category=core
severity=medium
---
Site configuration information for perl 5.24.3​:

Configured by Gentoo at Fri Oct 13 16​:43​:19 CEST 2017.

Summary of my perl5 (revision 5 version 24 subversion 3)
configuration​:

Platform​:
osname=linux, osvers=4.12.8, archname=x86_64-linux
uname='linux gentoo-jocke.infinera.com 4.12.8 #1 smp preempt wed aug
30 19​:00​:29 cest 2017 x86_64 intel(r) core(tm) i7-2600 cpu @​ 3.40ghz
genuineintel gnulinux '
config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n
-Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none
-Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux
5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64
/usr/lib64 -Dnoextensions=ODBM_File -Duseshrplib -Darchname=x86_64-
linux -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-O2 -pipe -Dldflags=-
Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr/local
-Dvendorprefix=/usr -Dscriptdir=/usr/bin
-Dprivlib=/usr/lib64/perl5/5.24.3
-Darchlib=/usr/lib64/perl5/5.24.3/x86_64-linux
-Dsitelib=/usr/local/lib64/perl5/5.24.3
-Dsitearch=/usr/local/lib64/perl5/5.24.3/x86_64-linux
-Dvendorlib=/usr/lib64/perl5/vendor_perl/5.24.3
-Dvendorarch=/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
-Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3
-Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3
-Dvendorman1dir=/usr/share/man/man1
-Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -D
libperl=
libperl.so.5.24.3 -Dlocincpth=/usr/include -Dglibpth=/lib64
/usr/lib64 -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo
-Dmyhostname=localhost -Dperladmin=root@​localhost -Ud_csh -Dsh=/bin/sh
-Dtargetsh=/bin/sh -Uusenm -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none
-Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux
5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64
/usr/lib64 -Dnoextensions=ODBM_File'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fwrapv -fno-strict-aliasing
-pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -pipe',
cppflags='-fwrapv -fno-strict-aliasing -pipe'
ccversion='', gccversion='5.4.0', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678,
doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16,
longdblkind=3
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='x86_64-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
libpth=/usr/local/lib64 /lib64 /usr/lib64 /usr/lib/gcc/x86_64-pc-
linux-gnu/5.4.0/include-fixed /usr/lib /lib/../lib64 /usr/lib/../lib64
/lib
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
-lgdbm_compat
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.23.so, so=so, useshrplib=true, libperl=libperl.so.5.24.3
gnulibc_version='2.23'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -pipe -Wl,-O1 -Wl,--as-
needed'

Locally applied patches​:
gentoo/hints_hpux - Fix hpux hints
gentoo/aix_soname - aix gcc detection and shared library soname
support
gentoo/EUMM-RUNPATH - https://bugs.gentoo.org/105054
cpan/ExtUtils-MakeMaker​: drop $PORTAGE_TMPDIR from LD_RUN_PATH
gentoo/config_over - Remove -rpath and append LDFLAGS to lddlflags
gentoo/opensolaris_headers - Add headers for opensolaris
gentoo/patchlevel - List packaged patches for perl-5.24.3(#1) in
patchlevel.h
gentoo/cleanup-paths - Cleanup PATH and shrpenv
gentoo/enc2xs - Tweak enc2xs to follow symlinks and ignore missing
@​INC directories.
gentoo/darwin-cc-ld - https://bugs.gentoo.org/297751 darwin​: Use
$CC to link
gentoo/cpan_definstalldirs - Provide a sensible INSTALLDIRS
default for modules installed from CPAN.
gentoo/interix - Fix interix hints
gentoo/create_libperl_soname - https://bugs.gentoo.org/286840 Set
libperl soname
gentoo/mod_paths - Add /etc/perl to @​INC
gentoo/EUMM_perllocalpod - cpan/ExtUtils-MakeMaker​: remove targets
that generate perllocal.pod
gentoo/drop_fstack_protector - https://bugs.gentoo.org/348557
Don't force -fstack-protector on everyone
gentoo/usr_local - Configure​: Don't include sources in /usr/local/
for compiling perl
gentoo/D-SHA-CFLAGS - https://bugs.gentoo.org/506818 Do not set
custom CFLAGS in cpan/Digest-SHA
gentoo/io_socket_ip_tests - cpan/IO-Socket-IP​: Disable network
tests
gentoo/cygwin-libperl - Cygwin​: avoid libperl.dll.dll.a
gentoo/tests - Fixup EUMM perlocal.pod tests and customised SHA1s
gentoo/zlib-1.2.9-backported-fixes - [rt#119762] Compress-Raw-
Zlib​: backport zlib 1.2.9+ fixes from upstream 2.073
debian/cpan-missing-site-dirs - Fix CPAN​::FirstTime defaults with
nonexisting site dirs if a parent is writable
debian/makemaker-pasthru - Pass LD settings through to
subdirectories
fixes/memoize_storable_nstore - [rt.cpan.org #77790]
Memoize​::Storable​: respect 'nstore' option not respected
fixes/podman-pipe - Better errors for man pages from standard
input
fixes/respect_umask - Respect umask during installation
fixes/net_smtp_docs - [rt.cpan.org #36038] Document the Net​::SMTP
'Port' option
fixes/document_makemaker_ccflags - [rt.cpan.org #68613] Document
that CCFLAGS should include $Config{ccflags}
fixes/parallel-manisort.patch - Fix parallel building

---
@​INC for perl 5.24.3​:
/etc/perl
/usr/local/lib64/perl5/5.24.3/x86_64-linux
/usr/local/lib64/perl5/5.24.3
/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
/usr/lib64/perl5/vendor_perl/5.24.3
/usr/local/lib64/perl5
/usr/lib64/perl5/vendor_perl/5.24.1
/usr/lib64/perl5/vendor_perl
/usr/lib64/perl5/5.24.3/x86_64-linux
/usr/lib64/perl5/5.24.3

---
Environment for perl 5.24.3​:
HOME=/home/jocke
LANG=en_GB.utf8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0​:/usr/x86_64-pc-linux-
gnu/powerpc-g2.20-linux-gnu/gcc-bin/4.9.3​:/usr/i686-pc-linux-
gnu/powerpc-softfloat-linux-gnu/gcc-bin/3.4.6​:/usr/x86_64-pc-linux-
gnu/powerpc-softfloat_4.5.3-linux-gnu/gcc-bin/4.5.3​:/usr/x86_64-pc-
linux-gnu/powerpc-softfloat_4.9.3-linux-gnu/gcc-bin/4.9.4​:/usr/x86_64-
pc-linux-gnu/x86_64-inf-linux-gnu/gcc-
bin/4.9.4​:/usr/local/bin​:/usr/bin​:/bin​:/opt/bin​:/usr/games/bin
PERL_BADLANG (unset)
SHELL=/bin/bash

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

@p5pRT
Copy link
Author

p5pRT commented Dec 18, 2017

From Joakim.Tjernlund@infinera.com

On Wed, 2017-12-13 at 16​:23 +0100, Joakim Tjernlund wrote​:

On Mon, 2017-12-11 at 16​:43 -0800, James E Keenan via RT wrote​:

On Sun, 10 Dec 2017 17​:19​:46 GMT, Joakim.Tjernlund@​infinera.com wrote​:

This is a bug report for perl from Joakim.Tjernlund@​infinera.com,
generated with the help of perlbug 1.40 running under perl 5.24.3.

-----------------------------------------------------------------
in perl Configure script there is this test for IPC_STAT​:

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include "tryh.h"
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
int main() {
struct semid_ds arg;
int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) &&
defined(S_IRWXO) && defined(IPC_CREAT)
printf("size​:%d\n", sizeof(semopts));
sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
if (sem > -1) {
# ifdef IPC_STAT
st = semctl(sem, 0, IPC_STAT, &arg);
if (st == 0)
printf("semid_ds\n");
else
# endif /* IPC_STAT */
printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
if (semctl(sem, 0, IPC_RMID, &arg) != 0)
# endif /* IPC_RMID */
printf("semctl IPC_RMID failed​: errno = %d\n", errno);
} else
#endif /* IPC_PRIVATE && ... */
printf("semget failed​: errno = %d\n", errno);

return 0;
}

This fails on ppc32 with​:
semctl IPC_STAT failed​: errno = 14
because the test is flawed. The semctl() test must be like so​:

union semun {
void *buf;
} semopts;
semopts.buf = &arg;
..
st = semctl(sem, 0, IPC_STAT, semopts);
..
if (semctl(sem, 0, IPC_RMID, semopts) != 0) /* semopts not really
needed */

Now the test works.

I'm having trouble understanding exactly where in Configure you think a correction should be made.

Me too, I just snagged the try.c files and worked from there.

Would you be able to do a checkout of the Perl 5 git repository, create a patch to Configure with your corrections and, assuming the patch "works", attach that patch to this ticket?

Sorry, not any easier for me, not even knowing anything about perl internal build system.

[Note to metaconfig team​: I *think* this pertains to approx. line 190 in U/modified/d_union_semun.U.]

Ping?

Thank you very much.
-----------------------------------------------------------------

---
Flags​:
category=core
severity=medium
---
Site configuration information for perl 5.24.3​:

Configured by Gentoo at Fri Oct 13 16​:43​:19 CEST 2017.

Summary of my perl5 (revision 5 version 24 subversion 3)
configuration​:

Platform​:
osname=linux, osvers=4.12.8, archname=x86_64-linux
uname='linux gentoo-jocke.infinera.com 4.12.8 #1 smp preempt wed aug
30 19​:00​:29 cest 2017 x86_64 intel(r) core(tm) i7-2600 cpu @​ 3.40ghz
genuineintel gnulinux '
config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n
-Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none
-Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux
5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64
/usr/lib64 -Dnoextensions=ODBM_File -Duseshrplib -Darchname=x86_64-
linux -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-O2 -pipe -Dldflags=-
Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr/local
-Dvendorprefix=/usr -Dscriptdir=/usr/bin
-Dprivlib=/usr/lib64/perl5/5.24.3
-Darchlib=/usr/lib64/perl5/5.24.3/x86_64-linux
-Dsitelib=/usr/local/lib64/perl5/5.24.3
-Dsitearch=/usr/local/lib64/perl5/5.24.3/x86_64-linux
-Dvendorlib=/usr/lib64/perl5/vendor_perl/5.24.3
-Dvendorarch=/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
-Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3
-Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3
-Dvendorman1dir=/usr/share/man/man1
-Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -D
libperl=
libperl.so.5.24.3 -Dlocincpth=/usr/include -Dglibpth=/lib64
/usr/lib64 -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo
-Dmyhostname=localhost -Dperladmin=root@​localhost -Ud_csh -Dsh=/bin/sh
-Dtargetsh=/bin/sh -Uusenm -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none
-Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux
5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64
/usr/lib64 -Dnoextensions=ODBM_File'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fwrapv -fno-strict-aliasing
-pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -pipe',
cppflags='-fwrapv -fno-strict-aliasing -pipe'
ccversion='', gccversion='5.4.0', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678,
doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16,
longdblkind=3
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='x86_64-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
libpth=/usr/local/lib64 /lib64 /usr/lib64 /usr/lib/gcc/x86_64-pc-
linux-gnu/5.4.0/include-fixed /usr/lib /lib/../lib64 /usr/lib/../lib64
/lib
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
-lgdbm_compat
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.23.so, so=so, useshrplib=true, libperl=libperl.so.5.24.3
gnulibc_version='2.23'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -pipe -Wl,-O1 -Wl,--as-
needed'

Locally applied patches​:
gentoo/hints_hpux - Fix hpux hints
gentoo/aix_soname - aix gcc detection and shared library soname
support
gentoo/EUMM-RUNPATH - https://bugs.gentoo.org/105054
cpan/ExtUtils-MakeMaker​: drop $PORTAGE_TMPDIR from LD_RUN_PATH
gentoo/config_over - Remove -rpath and append LDFLAGS to lddlflags
gentoo/opensolaris_headers - Add headers for opensolaris
gentoo/patchlevel - List packaged patches for perl-5.24.3(#1) in
patchlevel.h
gentoo/cleanup-paths - Cleanup PATH and shrpenv
gentoo/enc2xs - Tweak enc2xs to follow symlinks and ignore missing
@​INC directories.
gentoo/darwin-cc-ld - https://bugs.gentoo.org/297751 darwin​: Use
$CC to link
gentoo/cpan_definstalldirs - Provide a sensible INSTALLDIRS
default for modules installed from CPAN.
gentoo/interix - Fix interix hints
gentoo/create_libperl_soname - https://bugs.gentoo.org/286840 Set
libperl soname
gentoo/mod_paths - Add /etc/perl to @​INC
gentoo/EUMM_perllocalpod - cpan/ExtUtils-MakeMaker​: remove targets
that generate perllocal.pod
gentoo/drop_fstack_protector - https://bugs.gentoo.org/348557
Don't force -fstack-protector on everyone
gentoo/usr_local - Configure​: Don't include sources in /usr/local/
for compiling perl
gentoo/D-SHA-CFLAGS - https://bugs.gentoo.org/506818 Do not set
custom CFLAGS in cpan/Digest-SHA
gentoo/io_socket_ip_tests - cpan/IO-Socket-IP​: Disable network
tests
gentoo/cygwin-libperl - Cygwin​: avoid libperl.dll.dll.a
gentoo/tests - Fixup EUMM perlocal.pod tests and customised SHA1s
gentoo/zlib-1.2.9-backported-fixes - [rt#119762] Compress-Raw-
Zlib​: backport zlib 1.2.9+ fixes from upstream 2.073
debian/cpan-missing-site-dirs - Fix CPAN​::FirstTime defaults with
nonexisting site dirs if a parent is writable
debian/makemaker-pasthru - Pass LD settings through to
subdirectories
fixes/memoize_storable_nstore - [rt.cpan.org #77790]
Memoize​::Storable​: respect 'nstore' option not respected
fixes/podman-pipe - Better errors for man pages from standard
input
fixes/respect_umask - Respect umask during installation
fixes/net_smtp_docs - [rt.cpan.org #36038] Document the Net​::SMTP
'Port' option
fixes/document_makemaker_ccflags - [rt.cpan.org #68613] Document
that CCFLAGS should include $Config{ccflags}
fixes/parallel-manisort.patch - Fix parallel building

---
@​INC for perl 5.24.3​:
/etc/perl
/usr/local/lib64/perl5/5.24.3/x86_64-linux
/usr/local/lib64/perl5/5.24.3
/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
/usr/lib64/perl5/vendor_perl/5.24.3
/usr/local/lib64/perl5
/usr/lib64/perl5/vendor_perl/5.24.1
/usr/lib64/perl5/vendor_perl
/usr/lib64/perl5/5.24.3/x86_64-linux
/usr/lib64/perl5/5.24.3

---
Environment for perl 5.24.3​:
HOME=/home/jocke
LANG=en_GB.utf8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0​:/usr/x86_64-pc-linux-
gnu/powerpc-g2.20-linux-gnu/gcc-bin/4.9.3​:/usr/i686-pc-linux-
gnu/powerpc-softfloat-linux-gnu/gcc-bin/3.4.6​:/usr/x86_64-pc-linux-
gnu/powerpc-softfloat_4.5.3-linux-gnu/gcc-bin/4.5.3​:/usr/x86_64-pc-
linux-gnu/powerpc-softfloat_4.9.3-linux-gnu/gcc-bin/4.9.4​:/usr/x86_64-
pc-linux-gnu/x86_64-inf-linux-gnu/gcc-
bin/4.9.4​:/usr/local/bin​:/usr/bin​:/bin​:/opt/bin​:/usr/games/bin
PERL_BADLANG (unset)
SHELL=/bin/bash

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

@p5pRT
Copy link
Author

p5pRT commented Mar 1, 2018

From Joakim.Tjernlund@infinera.com

On Mon, 2017-12-18 at 23​:38 +0100, Joakim Tjernlund wrote​:

On Wed, 2017-12-13 at 16​:23 +0100, Joakim Tjernlund wrote​:

On Mon, 2017-12-11 at 16​:43 -0800, James E Keenan via RT wrote​:

On Sun, 10 Dec 2017 17​:19​:46 GMT, Joakim.Tjernlund@​infinera.com wrote​:

This is a bug report for perl from Joakim.Tjernlund@​infinera.com,
generated with the help of perlbug 1.40 running under perl 5.24.3.

-----------------------------------------------------------------
in perl Configure script there is this test for IPC_STAT​:

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include "tryh.h"
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
int main() {
struct semid_ds arg;
int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) &&
defined(S_IRWXO) && defined(IPC_CREAT)
printf("size​:%d\n", sizeof(semopts));
sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
if (sem > -1) {
# ifdef IPC_STAT
st = semctl(sem, 0, IPC_STAT, &arg);
if (st == 0)
printf("semid_ds\n");
else
# endif /* IPC_STAT */
printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
if (semctl(sem, 0, IPC_RMID, &arg) != 0)
# endif /* IPC_RMID */
printf("semctl IPC_RMID failed​: errno = %d\n", errno);
} else
#endif /* IPC_PRIVATE && ... */
printf("semget failed​: errno = %d\n", errno);

return 0;
}

This fails on ppc32 with​:
semctl IPC_STAT failed​: errno = 14
because the test is flawed. The semctl() test must be like so​:

union semun {
void *buf;
} semopts;
semopts.buf = &arg;
..
st = semctl(sem, 0, IPC_STAT, semopts);
..
if (semctl(sem, 0, IPC_RMID, semopts) != 0) /* semopts not really
needed */

Now the test works.

I'm having trouble understanding exactly where in Configure you think a correction should be made.

Me too, I just snagged the try.c files and worked from there.

Would you be able to do a checkout of the Perl 5 git repository, create a patch to Configure with your corrections and, assuming the patch "works", attach that patch to this ticket?

Sorry, not any easier for me, not even knowing anything about perl internal build system.

[Note to metaconfig team​: I *think* this pertains to approx. line 190 in U/modified/d_union_semun.U.]

Ping?

Gentle ping ..

Thank you very much.
-----------------------------------------------------------------

---
Flags​:
category=core
severity=medium
---
Site configuration information for perl 5.24.3​:

Configured by Gentoo at Fri Oct 13 16​:43​:19 CEST 2017.

Summary of my perl5 (revision 5 version 24 subversion 3)
configuration​:

Platform​:
osname=linux, osvers=4.12.8, archname=x86_64-linux
uname='linux gentoo-jocke.infinera.com 4.12.8 #1 smp preempt wed aug
30 19​:00​:29 cest 2017 x86_64 intel(r) core(tm) i7-2600 cpu @​ 3.40ghz
genuineintel gnulinux '
config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n
-Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none
-Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux
5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64
/usr/lib64 -Dnoextensions=ODBM_File -Duseshrplib -Darchname=x86_64-
linux -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-O2 -pipe -Dldflags=-
Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr/local
-Dvendorprefix=/usr -Dscriptdir=/usr/bin
-Dprivlib=/usr/lib64/perl5/5.24.3
-Darchlib=/usr/lib64/perl5/5.24.3/x86_64-linux
-Dsitelib=/usr/local/lib64/perl5/5.24.3
-Dsitearch=/usr/local/lib64/perl5/5.24.3/x86_64-linux
-Dvendorlib=/usr/lib64/perl5/vendor_perl/5.24.3
-Dvendorarch=/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
-Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3
-Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3
-Dvendorman1dir=/usr/share/man/man1
-Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -D
libperl=
libperl.so.5.24.3 -Dlocincpth=/usr/include -Dglibpth=/lib64
/usr/lib64 -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo
-Dmyhostname=localhost -Dperladmin=root@​localhost -Ud_csh -Dsh=/bin/sh
-Dtargetsh=/bin/sh -Uusenm -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none
-Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux
5.24.1 5.24.0/x86_64-linux 5.24.0 -Dlibpth=/usr/local/lib64 /lib64
/usr/lib64 -Dnoextensions=ODBM_File'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fwrapv -fno-strict-aliasing
-pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -pipe',
cppflags='-fwrapv -fno-strict-aliasing -pipe'
ccversion='', gccversion='5.4.0', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678,
doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16,
longdblkind=3
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='x86_64-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
libpth=/usr/local/lib64 /lib64 /usr/lib64 /usr/lib/gcc/x86_64-pc-
linux-gnu/5.4.0/include-fixed /usr/lib /lib/../lib64 /usr/lib/../lib64
/lib
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
-lgdbm_compat
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.23.so, so=so, useshrplib=true, libperl=libperl.so.5.24.3
gnulibc_version='2.23'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -pipe -Wl,-O1 -Wl,--as-
needed'

Locally applied patches​:
gentoo/hints_hpux - Fix hpux hints
gentoo/aix_soname - aix gcc detection and shared library soname
support
gentoo/EUMM-RUNPATH - https://bugs.gentoo.org/105054
cpan/ExtUtils-MakeMaker​: drop $PORTAGE_TMPDIR from LD_RUN_PATH
gentoo/config_over - Remove -rpath and append LDFLAGS to lddlflags
gentoo/opensolaris_headers - Add headers for opensolaris
gentoo/patchlevel - List packaged patches for perl-5.24.3(#1) in
patchlevel.h
gentoo/cleanup-paths - Cleanup PATH and shrpenv
gentoo/enc2xs - Tweak enc2xs to follow symlinks and ignore missing
@​INC directories.
gentoo/darwin-cc-ld - https://bugs.gentoo.org/297751 darwin​: Use
$CC to link
gentoo/cpan_definstalldirs - Provide a sensible INSTALLDIRS
default for modules installed from CPAN.
gentoo/interix - Fix interix hints
gentoo/create_libperl_soname - https://bugs.gentoo.org/286840 Set
libperl soname
gentoo/mod_paths - Add /etc/perl to @​INC
gentoo/EUMM_perllocalpod - cpan/ExtUtils-MakeMaker​: remove targets
that generate perllocal.pod
gentoo/drop_fstack_protector - https://bugs.gentoo.org/348557
Don't force -fstack-protector on everyone
gentoo/usr_local - Configure​: Don't include sources in /usr/local/
for compiling perl
gentoo/D-SHA-CFLAGS - https://bugs.gentoo.org/506818 Do not set
custom CFLAGS in cpan/Digest-SHA
gentoo/io_socket_ip_tests - cpan/IO-Socket-IP​: Disable network
tests
gentoo/cygwin-libperl - Cygwin​: avoid libperl.dll.dll.a
gentoo/tests - Fixup EUMM perlocal.pod tests and customised SHA1s
gentoo/zlib-1.2.9-backported-fixes - [rt#119762] Compress-Raw-
Zlib​: backport zlib 1.2.9+ fixes from upstream 2.073
debian/cpan-missing-site-dirs - Fix CPAN​::FirstTime defaults with
nonexisting site dirs if a parent is writable
debian/makemaker-pasthru - Pass LD settings through to
subdirectories
fixes/memoize_storable_nstore - [rt.cpan.org #77790]
Memoize​::Storable​: respect 'nstore' option not respected
fixes/podman-pipe - Better errors for man pages from standard
input
fixes/respect_umask - Respect umask during installation
fixes/net_smtp_docs - [rt.cpan.org #36038] Document the Net​::SMTP
'Port' option
fixes/document_makemaker_ccflags - [rt.cpan.org #68613] Document
that CCFLAGS should include $Config{ccflags}
fixes/parallel-manisort.patch - Fix parallel building

---
@​INC for perl 5.24.3​:
/etc/perl
/usr/local/lib64/perl5/5.24.3/x86_64-linux
/usr/local/lib64/perl5/5.24.3
/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
/usr/lib64/perl5/vendor_perl/5.24.3
/usr/local/lib64/perl5
/usr/lib64/perl5/vendor_perl/5.24.1
/usr/lib64/perl5/vendor_perl
/usr/lib64/perl5/5.24.3/x86_64-linux
/usr/lib64/perl5/5.24.3

---
Environment for perl 5.24.3​:
HOME=/home/jocke
LANG=en_GB.utf8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0​:/usr/x86_64-pc-linux-
gnu/powerpc-g2.20-linux-gnu/gcc-bin/4.9.3​:/usr/i686-pc-linux-
gnu/powerpc-softfloat-linux-gnu/gcc-bin/3.4.6​:/usr/x86_64-pc-linux-
gnu/powerpc-softfloat_4.5.3-linux-gnu/gcc-bin/4.5.3​:/usr/x86_64-pc-
linux-gnu/powerpc-softfloat_4.9.3-linux-gnu/gcc-bin/4.9.4​:/usr/x86_64-
pc-linux-gnu/x86_64-inf-linux-gnu/gcc-
bin/4.9.4​:/usr/local/bin​:/usr/bin​:/bin​:/opt/bin​:/usr/games/bin
PERL_BADLANG (unset)
SHELL=/bin/bash

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

@p5pRT
Copy link
Author

p5pRT commented Apr 8, 2018

From @Tux

Added James and Leon to To​: as my mails do not seem to arrive in p5p

On Sun, 10 Dec 2017 09​:19​:47 -0800, (via RT) <perlbug-followup@​perl.org> wrote​:

# Please include the string​: [perl #132560]
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=132560 >
-----------------------------------------------------------------
in perl Configure script there is this test for IPC_STAT​:

That is unit U/modified/d_union_semun.U, which you can find here​:
https://github.com/perl5-metaconfig/metaconfig/blob/master/U/modified/d_union_semun.U#L176

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include "tryh.h"
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
int main() {
struct semid_ds arg;
int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
printf("size​:%d\n", sizeof(semopts));
sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
if (sem > -1) {
# ifdef IPC_STAT
st = semctl(sem, 0, IPC_STAT, &arg);
if (st == 0)
printf("semid_ds\n");
else
# endif /* IPC_STAT */
printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
if (semctl(sem, 0, IPC_RMID, &arg) != 0)
# endif /* IPC_RMID */
printf("semctl IPC_RMID failed​: errno = %d\n", errno);
} else
#endif /* IPC_PRIVATE && ... */
printf("semget failed​: errno = %d\n", errno);

return 0;

}

This fails on ppc32 with​:
semctl IPC_STAT failed​: errno = 14
because the test is flawed. The semctl() test must be like so​:

union semun \{
  void \*buf;
\} semopts;
semopts\.buf = &arg;

..
st = semctl(sem, 0, IPC_STAT, semopts);
..
if (semctl(sem, 0, IPC_RMID, semopts) != 0) /* semopts not really needed */

Now the test works.

If I read the rest of the unit, combined with your rem,arks, that makes
me think this ought to fix it​:

--8<---

Inline Patch
diff --git a/U/modified/d_union_semun.U b/U/modified/d_union_semun.U
index 55f224f..6ddad1a 100644
--- a/U/modified/d_union_semun.U
+++ b/U/modified/d_union_semun.U
@@ -184,21 +184,31 @@ END
 extern int errno;
 #endif
 int main() {
-    struct semid_ds arg;
+    union semun
+#ifndef HAS_UNION_SEMUN
+    {
+       int val;
+       struct semid_ds *buf;
+       unsigned short *array;
+    }
+#endif
+    arg;
+    struct semid_ds argbuf;
     int sem, st;

 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) &&  defined(S_IRWXO) && defined(IPC_CREAT)
     sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
     if (sem > -1) {
+       arg.buf = &argbuf;
 #      ifdef IPC_STAT
-       st = semctl(sem, 0, IPC_STAT, &arg);
+       st = semctl(sem, 0, IPC_STAT, arg);
        if (st == 0)
            printf("semid_ds\n");
        else
 #      endif /* IPC_STAT */
            printf("semctl IPC_STAT failed: errno = %d\n", errno);
 #      ifdef IPC_RMID
-       if (semctl(sem, 0, IPC_RMID, &arg) != 0)
+       if (semctl(sem, 0, IPC_RMID, arg) != 0)
 #      endif /* IPC_RMID */
            printf("semctl IPC_RMID failed: errno = %d\n", errno);
     } else
-->8---


Do people with more knowledge on semctl agree?

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using perl5.00307 .. 5.27 porting perl5 on HP-UX, AIX, and openSUSE
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/
http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

@p5pRT
Copy link
Author

p5pRT commented Apr 8, 2018

From @Tux

d_union_semun.U.diff
diff --git a/U/modified/d_union_semun.U b/U/modified/d_union_semun.U
index 55f224f..6ddad1a 100644
--- a/U/modified/d_union_semun.U
+++ b/U/modified/d_union_semun.U
@@ -184,21 +184,31 @@ END
 extern int errno;
 #endif
 int main() {
-    struct semid_ds arg;
+    union semun
+#ifndef HAS_UNION_SEMUN
+    {
+	int val;
+	struct semid_ds *buf;
+	unsigned short *array;
+    }
+#endif
+    arg;
+    struct semid_ds argbuf;
     int sem, st;
 
 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) &&  defined(S_IRWXO) && defined(IPC_CREAT)
     sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
     if (sem > -1) {
+	arg.buf = &argbuf;
 #	ifdef IPC_STAT
-	st = semctl(sem, 0, IPC_STAT, &arg);
+	st = semctl(sem, 0, IPC_STAT, arg);
 	if (st == 0)
 	    printf("semid_ds\n");
 	else
 #	endif /* IPC_STAT */
 	    printf("semctl IPC_STAT failed: errno = %d\n", errno);
 #	ifdef IPC_RMID
-	if (semctl(sem, 0, IPC_RMID, &arg) != 0)
+	if (semctl(sem, 0, IPC_RMID, arg) != 0)
 #	endif /* IPC_RMID */
 	    printf("semctl IPC_RMID failed: errno = %d\n", errno);
     } else

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2018

From @Tux

Karl, finally an update from me :)
Sorry it took so long ...

On Thu, 29 Mar 2018 16​:23​:10 +0200, "H.Merijn Brand" <h.m.brand@​xs4all.nl> wrote​:

Added James and Leon to To​: as my mails do not seem to arrive in p5p

Ping?

As this is the last hurdle before Configure is back to sync again with
META/DIST, I'd like some feedback. The rest of the issues is now
resolved and push to meta

If I commit this, Karl can continue with his LANGINFO work

On Sun, 10 Dec 2017 09​:19​:47 -0800, (via RT) <perlbug-followup@​perl.org> wrote​:

# Please include the string​: [perl #132560]
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=132560 >
-----------------------------------------------------------------
in perl Configure script there is this test for IPC_STAT​:

That is unit U/modified/d_union_semun.U, which you can find here​:
https://github.com/perl5-metaconfig/metaconfig/blob/master/U/modified/d_union_semun.U#L176

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include "tryh.h"
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
int main() {
struct semid_ds arg;
int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
printf("size​:%d\n", sizeof(semopts));
sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
if (sem > -1) {
# ifdef IPC_STAT
st = semctl(sem, 0, IPC_STAT, &arg);
if (st == 0)
printf("semid_ds\n");
else
# endif /* IPC_STAT */
printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
if (semctl(sem, 0, IPC_RMID, &arg) != 0)
# endif /* IPC_RMID */
printf("semctl IPC_RMID failed​: errno = %d\n", errno);
} else
#endif /* IPC_PRIVATE && ... */
printf("semget failed​: errno = %d\n", errno);

return 0;

}

This fails on ppc32 with​:
semctl IPC_STAT failed​: errno = 14
because the test is flawed. The semctl() test must be like so​:

union semun \{
  void \*buf;
\} semopts;
semopts\.buf = &arg;

..
st = semctl(sem, 0, IPC_STAT, semopts);
..
if (semctl(sem, 0, IPC_RMID, semopts) != 0) /* semopts not really needed */

Now the test works.

If I read the rest of the unit, combined with your rem,arks, that makes
me think this ought to fix it​:

--8<---
diff --git a/U/modified/d_union_semun.U b/U/modified/d_union_semun.U
index 55f224f..6ddad1a 100644
--- a/U/modified/d_union_semun.U
+++ b/U/modified/d_union_semun.U
@​@​ -184,21 +184,31 @​@​ END
extern int errno;
#endif
int main() {
- struct semid_ds arg;
+ union semun
+#ifndef HAS_UNION_SEMUN
+ {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+ }
+#endif
+ arg;
+ struct semid_ds argbuf;
int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
if (sem > -1) {
+ arg.buf = &argbuf;
# ifdef IPC_STAT
- st = semctl(sem, 0, IPC_STAT, &arg);
+ st = semctl(sem, 0, IPC_STAT, arg);
if (st == 0)
printf("semid_ds\n");
else
# endif /* IPC_STAT */
printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
- if (semctl(sem, 0, IPC_RMID, &arg) != 0)
+ if (semctl(sem, 0, IPC_RMID, arg) != 0)
# endif /* IPC_RMID */
printf("semctl IPC_RMID failed​: errno = %d\n", errno);
} else
-->8---

Do people with more knowledge on semctl agree?

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using perl5.00307 .. 5.27 porting perl5 on HP-UX, AIX, and openSUSE
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/
http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

@p5pRT
Copy link
Author

p5pRT commented Apr 13, 2018

From @Leont

On Thu, Mar 29, 2018 at 4​:23 PM, H.Merijn Brand <h.m.brand@​xs4all.nl> wrote​:

Added James and Leon to To​: as my mails do not seem to arrive in p5p

On Sun, 10 Dec 2017 09​:19​:47 -0800, (via RT) <perlbug-followup@​perl.org> wrote​:

# Please include the string​: [perl #132560]
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=132560 >
-----------------------------------------------------------------
in perl Configure script there is this test for IPC_STAT​:

That is unit U/modified/d_union_semun.U, which you can find here​:
https://github.com/perl5-metaconfig/metaconfig/blob/master/U/modified/d_union_semun.U#L176

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include "tryh.h"
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
int main() {
struct semid_ds arg;
int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
printf("size​:%d\n", sizeof(semopts));
sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
if (sem > -1) {
# ifdef IPC_STAT
st = semctl(sem, 0, IPC_STAT, &arg);
if (st == 0)
printf("semid_ds\n");
else
# endif /* IPC_STAT */
printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
if (semctl(sem, 0, IPC_RMID, &arg) != 0)
# endif /* IPC_RMID */
printf("semctl IPC_RMID failed​: errno = %d\n", errno);
} else
#endif /* IPC_PRIVATE && ... */
printf("semget failed​: errno = %d\n", errno);

return 0;

}

This fails on ppc32 with​:
semctl IPC_STAT failed​: errno = 14
because the test is flawed. The semctl() test must be like so​:

union semun \{
  void \*buf;
\} semopts;
semopts\.buf = &arg;

..
st = semctl(sem, 0, IPC_STAT, semopts);
..
if (semctl(sem, 0, IPC_RMID, semopts) != 0) /* semopts not really needed */

Now the test works.

If I read the rest of the unit, combined with your rem,arks, that makes
me think this ought to fix it​:

--8<---
diff --git a/U/modified/d_union_semun.U b/U/modified/d_union_semun.U
index 55f224f..6ddad1a 100644
--- a/U/modified/d_union_semun.U
+++ b/U/modified/d_union_semun.U
@​@​ -184,21 +184,31 @​@​ END
extern int errno;
#endif
int main() {
- struct semid_ds arg;
+ union semun
+#ifndef HAS_UNION_SEMUN
+ {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+ }
+#endif
+ arg;
+ struct semid_ds argbuf;
int sem, st;

#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
if (sem > -1) {
+ arg.buf = &argbuf;
# ifdef IPC_STAT
- st = semctl(sem, 0, IPC_STAT, &arg);
+ st = semctl(sem, 0, IPC_STAT, arg);
if (st == 0)
printf("semid_ds\n");
else
# endif /* IPC_STAT */
printf("semctl IPC_STAT failed​: errno = %d\n", errno);
# ifdef IPC_RMID
- if (semctl(sem, 0, IPC_RMID, &arg) != 0)
+ if (semctl(sem, 0, IPC_RMID, arg) != 0)
# endif /* IPC_RMID */
printf("semctl IPC_RMID failed​: errno = %d\n", errno);
} else
-->8---

Do people with more knowledge on semctl agree?

Yeah, this looks sensible, as far as anything dealing with semctl can
ever look sensible. The old code takes a shortcut by assuming a
pointer type and a union containing that pointer type (and nothing
bigger) are equivalent when passed as an argument to a varargs
function. I'm not sure why they're apparently not on ppc32, but the C
standard defines rather little about unions anyway.

Leon

@p5pRT
Copy link
Author

p5pRT commented Apr 19, 2018

@arc - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Jun 23, 2018

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release yesterday of Perl 5.28.0, this and 185 other issues have been
resolved.

Perl 5.28.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.28.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT p5pRT closed this as completed Jun 23, 2018
@p5pRT
Copy link
Author

p5pRT commented Jun 23, 2018

@khwilliamson - Status changed from 'pending release' 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