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

test t/lib/ipc_sysv.t failing under irix 6.4 #436

Closed
p5pRT opened this issue Aug 25, 1999 · 7 comments
Closed

test t/lib/ipc_sysv.t failing under irix 6.4 #436

p5pRT opened this issue Aug 25, 1999 · 7 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Aug 25, 1999

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

Searchable as RT1277$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Aug 25, 1999

From young@dutchdraft.larc.nasa.gov

  I am trying to build perl 5.005_03 under Irix 6.4. The
configure part goes fine, and perl compiles fine, but during
the test phase, it is failing the lib/ipc_sysv.t test and
I can't figure out why... Here are the configuration details​:

Script started on Wed Aug 25 16​:34​:13 1999
charm{root}% uname -a
IRIX64 charm 6.4 02121744 IP27

charm{root}% ../myconfig
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration​:
  Platform​:
  osname=irix, osvers=6.4, archname=IP27-irix
  uname='irix64 charm 6.4 02121744 ip27 '
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef useperlio=undef d_sfio=undef
  Compiler​:
  cc='gcc', optimize='-O3', gccversion=2.95.1 19990816 (release)
  cppflags='-D_BSD_TYPES -D_BSD_TIME -I/usr/local/include -DLANGUAGE_C'
  ccflags ='-D_BSD_TYPES -D_BSD_TIME -I/usr/local/include -DLANGUAGE_C'
  stdchar='unsigned char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
  alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries​:
  ld='gcc', ldflags =' -L/usr/local/lib32 -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib32 /lib32 /lib /usr/lib
  libs=-lm -lc
  libc=/usr/lib32/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags='-n32 -shared -L/usr/local/lib32 -L/usr/local/lib'

charm{root}% ./TEST
base/cond..........ok
base/if............ok
base/lex...........ok
base/pat...........ok
base/rs............ok
base/term..........ok
comp/cmdopt........ok
comp/colon.........ok
comp/cpp...........ok
comp/decl..........ok
comp/multiline.....ok
comp/package.......ok
comp/proto.........ok
comp/redef.........ok
comp/require.......ok
comp/script........ok
comp/term..........ok
comp/use...........ok
cmd/elsif..........ok
cmd/for............ok
cmd/mod............ok
cmd/subval.........ok
cmd/switch.........ok
cmd/while..........ok
io/argv............ok
io/dup.............ok
io/fs..............ok
io/inplace.........ok
io/iprefix.........ok
io/pipe............ok
io/print...........ok
io/read............ok
io/tell............ok
op/append..........ok
op/arith...........ok
op/array...........ok
op/assignwarn......ok
op/auto............ok
op/avhv............ok
op/bop.............ok
op/chop............ok
op/closure.........ok
op/cmp.............ok
op/cond............ok
op/context.........ok
op/defins..........ok
op/delete..........ok
op/die.............ok
op/die_exit........ok
op/do..............ok
op/each............ok
op/eval............ok
op/exec............ok
op/exp.............ok
op/flip............ok
op/fork............ok
op/glob............ok
op/goto............ok
op/goto_xs.........ok
op/grep............ok
op/groups..........ok
op/gv..............ok
op/hashwarn........ok
op/inc.............ok
op/index...........ok
op/int.............ok
op/join............ok
op/list............ok
op/local...........ok
op/magic...........ok
op/method..........ok
op/misc............ok
op/mkdir...........ok
op/my..............ok
op/nothread........ok
op/oct.............ok
op/ord.............ok
op/pack............ok
op/pat.............ok
op/pos.............ok
op/push............ok
op/quotemeta.......ok
op/rand............ok
op/range...........ok
op/read............ok
op/readdir.........ok
op/recurse.........ok
op/ref.............ok
op/regexp..........ok
op/regexp_noamp....ok
op/repeat..........ok
op/runlevel........ok
op/sleep...........ok
op/sort............ok
op/splice..........ok
op/split...........ok
op/sprintf.........ok
op/stat............ok
op/study...........ok
op/subst...........ok
op/substr..........ok
op/sysio...........ok
op/taint...........ok
op/tie.............ok
op/tiearray........ok
op/tiehandle.......ok
op/time............ok
op/tr..............ok
op/undef...........ok
op/universal.......ok
op/unshift.........ok
op/vec.............ok
op/wantarray.......ok
op/write...........ok
pragma/constant....ok
pragma/locale......ok
pragma/overload....ok
pragma/strict......ok
pragma/subs........ok
pragma/warning.....ok
lib/abbrev.........ok
lib/anydbm.........ok
lib/autoloader.....ok
lib/basename.......ok
lib/bigint.........ok
lib/bigintpm.......ok
lib/cgi-form.......ok
lib/cgi-function...ok
lib/cgi-html.......ok
lib/cgi-request....ok
lib/checktree......ok
lib/complex........ok
lib/db-btree.......skipping test on this platform
lib/db-hash........skipping test on this platform
lib/db-recno.......skipping test on this platform
lib/dirhand........ok
lib/dosglob........ok
lib/dumper-ovl.....ok
lib/dumper.........ok
lib/english........ok
lib/env............ok
lib/errno..........ok
lib/fatal..........ok
lib/fields.........ok
lib/filecache......ok
lib/filecopy.......ok
lib/filefind.......ok
lib/filehand.......ok
lib/filepath.......ok
lib/filespec.......ok
lib/findbin........ok
lib/gdbm...........skipping test on this platform
lib/getopt.........ok
lib/h2ph...........ok
lib/hostname.......ok
lib/io_dup.........ok
lib/io_pipe........ok
lib/io_sel.........ok
lib/io_sock........ok
lib/io_taint.......ok
lib/io_tell........ok
lib/io_udp.........ok
lib/io_xs..........ok
lib/ipc_sysv.......FAILED at test 8
lib/ndbm...........ok
lib/odbm...........ok
lib/opcode.........ok
lib/open2..........ok
lib/open3..........ok
lib/ops............ok
lib/parsewords.....ok
lib/ph.............ok
lib/posix..........ok
lib/safe1..........ok
lib/safe2..........ok
lib/sdbm...........ok
lib/searchdict.....ok
lib/selectsaver....ok
lib/socket.........ok
lib/soundex........ok
lib/symbol.........ok
lib/textfill.......ok
lib/texttabs.......ok
lib/textwrap.......ok
lib/thread.........skipping test on this platform
lib/tie-push.......ok
lib/tie-stdarray...ok
lib/tie-stdpush....ok
lib/timelocal......ok
lib/trig...........ok
Failed 1 test script out of 190, 96.84% okay.
  ### Since not all tests were successful, you may want to run some
  ### of them individually and examine any diagnostic messages they
  ### produce. See the INSTALL document's section on "make test".
  ### If you are testing the compiler, then ignore this message
  ### and run
  ### ./perl harness
  ### in the directory ./t.
  ###
  ### Since most tests were successful, you have a good chance to
  ### get information with better granularity by running
  ### ./perl harness
  ### in directory ./t.
u=0.44 s=0.68 cu=19.3 cs=7.14 scripts=185 tests=6506

charm{root}% ./perl lib/ipc_sysv.t
1..16
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
not ok 8
not ok 9
not ok 10
not ok 11
not ok 12
not ok 13
not ok 14
not ok 15
not ok 16
charm{root}% exit
exit

script done on Wed Aug 25 16​:37​:15 1999

Any ideas?
  JY


John E. Young 864-8659
CSC/SCOMAC B1268C/R1326E

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Sep 1, 1999

From @jhi

John Young writes​:

Folks,

I am trying to build perl 5\.005\_03 under Irix 6\.4\.  The 

configure part goes fine, and perl compiles fine, but during
the test phase, it is failing the lib/ipc_sysv.t test and
I can't figure out why... Here are the configuration details​:

charm{root}% ./perl lib/ipc_sysv.t
1..16
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
not ok 8
not ok 9
not ok 10
not ok 11
not ok 12
not ok 13
not ok 14
not ok 15
not ok 16
charm{root}% exit
exit

script done on Wed Aug 25 16​:37​:15 1999

Any ideas?

One possible reason is that you are running out of semaphores either
in your machine or in your account. Some applications such as
databases reserve semaphores for their own uses; and because SysV IPC
structs are not garbage-collected (they are in effect a curious
pseudo-filesystem living only in memory) when their creator program
exits/crashes, one may slowly run out of them. Check what ipcs says.
If it lists a lot of semaphores (what is "a lot" depends on your
particular configuration, unfortunately), you may need to clear the
unused ones (again, your configuration) with ipcrm.

--
$jhi++; # http​://www.iki.fi/jhi/
  # There is this special biologist word we use for 'stable'.
  # It is 'dead'. -- Jack Cohen

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Oct 5, 1999

From [Unknown Contact. See original ticket]

Same problem here, but on IRIX 6.5​:

tom@​dilbert​:~/tmp/perl5.005_03/t$ uname -a
IRIX dilbert 6.5 05190004 IP32

tom@​dilbert​:~/tmp/perl5.005_03/t$ diff lib/ipc_sysv.t /tmp/toto
99c99
< print "ok 7\n";


print "ok 7 \# $sem\\n";

103c103
< print "ok 8\n";


print "ok 8 \# $\!\\n";

106c106
< print "ok 9\n";


print "ok 9 \# $\!\\n";

135c135
< print "ok 10\n";


print "ok 10 \# $\!\\n";

tom@​dilbert​:~/tmp/perl5.005_03/t$ ./perl /tmp/toto
1..16
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7 # 28
not ok 8 # Bad address
not ok 9 # Bad address
not ok 10 # Bad address
not ok 11
not ok 12
not ok 13
not ok 14
not ok 15
not ok 16

Still the "bad address" error in the semctl() calls... I think someone asked
about that a while ago.

The problem is almost certainly with gcc's crazy alignment bug, see this
excerpt from
http​://freeware.sgi.com/1999May/Installable/gcc-2.8.1-sgipl1.html​:

[From Jim Wilson] Gcc does not correctly pass/return structures which are
smaller than 16 bytes and which are not 8 bytes. The problem is very
involved and difficult to fix. It affects a number of other targets also,
but irix6 is affected the most, because it is a 64 bit target, and 4 byte
structures are common. The exact problem is that structures are being padded
at the wrong end, e.g. a 4 byte structure is loaded into the lower 4 bytes
of the register when it should be loaded into the upper 4 bytes of the
register.
Gcc is consistent with itself, but not consistent with the SGI C compiler
[and the SGI supplied runtime libraries], so the only failures that can
happen are when there are library functions that take/return such
structures. There are very few such library functions. I can only recall
seeing a few of them​: inet_ntoa, inet_aton, inet_lnaof, inet_netof, and
semctl.
A possible workaround​: if you have a program that calls inet_ntoa and
friends or semctl, and your kernel supports 64-bit binaries (i.e. uname -a
prints IRIX64 rather than just IRIX), then you may compile with gcc -mabi=64
to workaround this problem.

I used gcc 2.95.1, but the problem is still there. And I have no money to
purchase a SGI compiler. :)

Anyone got a magic patch to work around this?

--
Thomas Conté, Global Engineering
tom@​fr.uu.net - tel​: +33 156 382 200 - cell​: +33 610 683 687
UUNET, an MCI WorldCom Company

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Oct 5, 1999

From @jhi

Thomas Conté writes​:

Same problem here, but on IRIX 6.5​:

tom@​dilbert​:~/tmp/perl5.005_03/t$ uname -a
IRIX dilbert 6.5 05190004 IP32
[snip]
friends or semctl, and your kernel supports 64-bit binaries (i.e. uname -a
prints IRIX64 rather than just IRIX), then you may compile with gcc -mabi=64
to workaround this problem.

I used gcc 2.95.1, but the problem is still there. And I have no money to
purchase a SGI compiler. :)

Anyone got a magic patch to work around this?

As you have a 32-bit IRIX box I know of no magic tricks that would help you.

--
$jhi++; # http​://www.iki.fi/jhi/
  # There is this special biologist word we use for 'stable'.
  # It is 'dead'. -- Jack Cohen

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Oct 6, 1999

From [Unknown Contact. See original ticket]

Just FYI, I finally found an ugly kludge to work around the semctl()
problem... Applying this patch to perl.h makes the lib/ipc_sysv.t test
succeed, even when building using gcc, on my O2 with IRIX 6.5.

It's not pretty but it may be useful to record it here...

Cheers!

*** perl.h.orig Sun Mar 28 09​:57​:16 1999
--- perl.h Wed Oct 6 18​:53​:50 1999
***************
*** 2550,2555 ****
--- 2550,2562 ----
  };
  # endif
  # ifdef USE_SEMCTL_SEMUN
+ union gccbug_semun {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+ char __dummy[5];
+ };
+ # define semun gccbug_semun
  # define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
  # else
  # ifdef USE_SEMCTL_SEMID_DS

--
Thomas Conté, Global Engineering
tom@​fr.uu.net - tel​: +33 156 382 200 - cell​: +33 610 683 687
UUNET, an MCI WorldCom Company

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Oct 6, 1999

From @jhi

Thomas Conté writes​:

Just FYI, I finally found an ugly kludge to work around the semctl()
problem... Applying this patch to perl.h makes the lib/ipc_sysv.t test
succeed, even when building using gcc, on my O2 with IRIX 6.5.

It's not pretty but it may be useful to record it here...

That has some promise, actually... could you perhaps construct a
small test program that exercizes the alignment problem? What I need
is a test program for the alignment problem, *not* a test program for
the semctl() proble (because the aligment problem affects not only
semctl(), but also for example inet_aton().

If you could prepare such a program I could then integrate that into
Configure. The below patch then is the particular fix for union semun.

In other words​: I want to be able to use #ifdef XXX to start using
the below "fix"-- and I do not want the XXX to be gcc anything, or
IRIX anything, or semun anything.

Cheers!

*** perl.h.orig Sun Mar 28 09​:57​:16 1999
--- perl.h Wed Oct 6 18​:53​:50 1999
***************
*** 2550,2555 ****
--- 2550,2562 ----
};
# endif
# ifdef USE_SEMCTL_SEMUN
+ union gccbug_semun {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+ char __dummy[5];
+ };
+ # define semun gccbug_semun
# define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
# else
# ifdef USE_SEMCTL_SEMID_DS

--
Thomas Conté, Global Engineering
tom@​fr.uu.net - tel​: +33 156 382 200 - cell​: +33 610 683 687
UUNET, an MCI WorldCom Company

--
$jhi++; # http​://www.iki.fi/jhi/
  # There is this special biologist word we use for 'stable'.
  # It is 'dead'. -- Jack Cohen

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Oct 6, 1999

From @jhi

On the other hand, we do have rather many

#ifdef ...a broken os and compiler combination ...
do something
#endif

fixes scattered around the Perl source code, so one more won't be that
deadly. Of course we should always strive for a clean fix (for
example something along the lines I just described), but I guess the
suggested "quick fix" can go in already almost as-is, maybe just
adding enough defined()s will be enough for now.

--
$jhi++; # http​://www.iki.fi/jhi/
  # There is this special biologist word we use for 'stable'.
  # It is 'dead'. -- Jack Cohen

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

Successfully merging a pull request may close this issue.

None yet
1 participant