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

parallel make on NetBSD occasionally fails or corrupts #12147

Closed
p5pRT opened this issue May 30, 2012 · 5 comments
Closed

parallel make on NetBSD occasionally fails or corrupts #12147

p5pRT opened this issue May 30, 2012 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented May 30, 2012

Migrated from rt.perl.org#113430 (status was 'open')

Searchable as RT113430$

@p5pRT
Copy link
Author

p5pRT commented May 30, 2012

From @tonycoz

Created by @tonycoz

Parallel builds on NetBSD occasionally either fail, or produce an
invalid SDBM_File.so.

A failing build​:

cp via.bs ../../lib/auto/PerlIO/via/via.bs
--- lib/auto/SDBM_File/SDBM_File.so ---
--- subdirs ---
cc -c -I../../.. -fno-strict-aliasing -pipe -fstack-protector -I/usr/pkg/include -O -DVERSION=\"\" -DXS_VERSION=\"\" -DPIC -fPIC "-I../../.." -DSDBM -DDUFF sdbm.c
--- lib/auto/PerlIO/via/via.so ---
chmod 644 ../../lib/auto/PerlIO/via/via.bs
--- lib/auto/SDBM_File/SDBM_File.so ---
--- pair.o ---
cc -c -I../../.. -fno-strict-aliasing -pipe -fstack-protector -I/usr/pkg/include -O -DVERSION=\"\" -DXS_VERSION=\"\" -DPIC -fPIC "-I../../.." -DSDBM -DDUFF pair.c
--- lib/auto/PerlIO/via/via.so ---
--- ../../lib/auto/PerlIO/via/via.so ---
rm -f ../../lib/auto/PerlIO/via/via.so
cc --whole-archive -shared -L/usr/pkg/lib -fstack-protector via.o -o ../../lib/auto/PerlIO/via/via.so
--- lib/auto/Socket/Socket.so ---
--- blibdirs ---
--- lib/auto/PerlIO/via/via.so ---
chmod 755 ../../lib/auto/PerlIO/via/via.so
--- lib/auto/Socket/Socket.so ---
--- config ---
--- lib/auto/PerlIO/via/via.so ---
--- dynamic ---
--- lib/auto/Socket/Socket.so ---
Making all in cpan/Socket
make all PERL_CORE=1 LIBPERL_A=libperl.a LINKTYPE=dynamic
--- lib/auto/PerlIO/via/via.so ---
--- linkext ---
--- pure_all ---
--- manifypods ---
--- all ---
--- lib/auto/Socket/Socket.so ---
--- subdirs ---
--- blibdirs ---
--- lib/auto/Storable/Storable.so ---
--- config ---
--- Storable.bs ---
--- lib/auto/Socket/Socket.so ---
--- Socket.c ---
--- lib/auto/Storable/Storable.so ---
Running Mkbootstrap for Storable ()
--- lib/auto/PerlIO/scalar/scalar.so ---
--- ../../lib/auto/PerlIO/scalar/scalar.so ---
--- lib/auto/Socket/Socket.so ---
../../miniperl "-I../../lib" "-I../../lib" ../../lib/ExtUtils/xsubpp -noprototypes -typemap ../../lib/ExtUtils/typemap -typemap typemap Socket.xs > Socket.xsc && mv Socket.xsc Socket.c
--- lib/auto/PerlIO/scalar/scalar.so ---
rm -f ../../lib/auto/PerlIO/scalar/scalar.so
cc --whole-archive -shared -L/usr/pkg/lib -fstack-protector scalar.o -o ../../lib/auto/PerlIO/scalar/scalar.so
chmod 755 ../../lib/auto/PerlIO/scalar/scalar.so
--- lib/auto/Storable/Storable.so ---
chmod 644 Storable.bs
--- lib/auto/PerlIO/scalar/scalar.so ---
--- dynamic ---
--- lib/auto/Text/Soundex/Soundex.so ---
--- lib/auto/PerlIO/scalar/scalar.so ---
--- linkext ---
--- lib/auto/Sys/Syslog/Syslog.so ---
Writing Makefile for Sys​::Syslog
--- lib/auto/SDBM_File/SDBM_File.so ---
--- sdbm/libsdbm.a ---
cd sdbm && make all
--- lib/auto/Storable/Storable.so ---
--- pm_to_blib ---
--- lib/auto/Text/Soundex/Soundex.so ---
./miniperl -Ilib make_ext.pl lib/auto/Text/Soundex/Soundex.so MAKE=make LIBPERL_A=libperl.a LINKTYPE=dynamic
  Making Text​::Soundex (all)

Creating Makefile.PL in cpan/Text-Soundex for Text​::Soundex

Running Makefile.PL in cpan/Text-Soundex
../../miniperl -I../../lib Makefile.PL INSTALLDIRS=perl INSTALLMAN1DIR=none INSTALLMAN3DIR=none PERL_CORE=1 LIBPERL_A=libperl.a LINKTYPE=dynamic
--- lib/auto/PerlIO/scalar/scalar.so ---
--- pure_all ---
--- manifypods ---
--- all ---
--- lib/auto/Sys/Hostname/Hostname.so ---
Writing Makefile for Sys​::Hostname
--- lib/auto/Sys/Syslog/Syslog.so ---
--- ../../lib/Sys/.exists ---
--- lib/auto/SDBM_File/SDBM_File.so ---
--- SDBM_File.c ---
--- subdirs ---
--- hash.o ---
--- SDBM_File.c ---
../../miniperl "-I../../lib" "-I../../lib" ../../lib/ExtUtils/xsubpp -noprototypes -typemap ../../lib/ExtUtils/typemap -typemap typemap SDBM_File.xs > SDBM_File.xsc && mv SDBM_File.xsc SDBM_File.c
--- subdirs ---
cc -c -I../../.. -fno-strict-aliasing -pipe -fstack-protector -I/usr/pkg/include -O -DVERSION=\"\" -DXS_VERSION=\"\" -DPIC -fPIC "-I../../.." -DSDBM -DDUFF hash.c
--- lib/auto/Sys/Hostname/Hostname.so ---
--- ../../lib/Sys/.exists ---
--- lib/auto/SDBM_File/SDBM_File.so ---
--- sdbm/libsdbm.a ---
--- hash.o ---
--- lib/auto/Storable/Storable.so ---
cp Storable.pm ../../lib/Storable.pm
--- lib/auto/SDBM_File/SDBM_File.so ---
cc -c -I../../.. -fno-strict-aliasing -pipe -fstack-protector -I/usr/pkg/include -O -DVERSION=\"\" -DXS_VERSION=\"\" -DPIC -fPIC "-I../../.." -DSDBM -DDUFF hash.c
--- subdirs ---
--- libsdbm.a ---
rm -rf libsdbm.a
/usr/bin/ar cr libsdbm.a sdbm.o pair.o hash.o && : libsdbm.a
--- lib/auto/Storable/Storable.so ---
--- ../../lib/auto/Storable/Storable.bs ---
--- lib/auto/Sys/Hostname/Hostname.so ---
--- ../../lib/auto/Sys/Hostname/.exists ---
--- lib/auto/Sys/Syslog/Syslog.so ---
--- ../../lib/auto/Sys/Syslog/.exists ---
--- lib/auto/Storable/Storable.so ---
cp Storable.bs ../../lib/auto/Storable/Storable.bs
--- lib/auto/SDBM_File/SDBM_File.so ---
/usr/bin/ar​: hash.o​: No such file or directory
--- lib/auto/Storable/Storable.so ---
chmod 644 ../../lib/auto/Storable/Storable.bs
--- lib/auto/SDBM_File/SDBM_File.so ---
*** [libsdbm.a] Error code 1
1 error

Another build apparently succeeds, but fails to run sdbm.t​:

cd t && (rm -f perl; /bin/ln -s ../perl perl)
./runtests choose
t/../ext/SDBM_File/t/sdbm ... # Failed test 'use SDBM_File;'
# at ../../t/lib/dbmt_common.pl line 20.
# Tried to use 'SDBM_File'.
# Error​: Can't load '../../lib/auto/SDBM_File/SDBM_File.so' for module SDBM_File​: /home/tony/dev/perl/git/perl/ext/SDBM_File/../../lib/auto/SDBM_File/SDBM_File.so​: Undefined PLT symbol "sdbm_hash" (symnum = 19) at ../../lib/XSLoader.pm line 68.
# at ../../lib/SDBM_File.pm line 12.
# Compilation failed in require at (eval 4) line 2.
# BEGIN failed--compilation aborted at (eval 4) line 2.
FAILED at test 1
Failed 1 test out of 0, 0.00% okay.
  ../ext/SDBM_File/t/sdbm.t

This one I ran with make's job tracing, an extract​:

1338366321.673164 1 JOB 7484 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm hash.o 15865 0 b000001
1338366321.722132 1 DON 4242 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm sdbm.o 15313 0 b000001
1338366321.722907 1 JOB 4242 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm libsdbm.a 11046 0 2b000001
1338366321.728995 1 DON 4242 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm libsdbm.a 11046 0 2b000001
1338366321.729643 1 JOB 4242 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm static 587 0 9010004
1338366321.730677 1 DON 4242 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm static 587 0 9010004
1338366321.731260 1 JOB 4242 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm all 23867 0 8010004
1338366321.732245 1 DON 4242 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm all 23867 0 8010004
1338366321.732750 0 END 4242 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm
1338366321.783131 1 DON 7484 /home/tony/dev/perl/git/perl/ext/SDBM_File/sdbm hash.o 15865 0 b000001

Note the hash.o job finishes after the libsdbm.o job.

Perl Info

Flags:
    category=install
    severity=low

Site configuration information for perl 5.17.0:

Configured by tony at Wed May 30 18:24:37 EST 2012.

Summary of my perl5 (revision 5 version 17 subversion 0) configuration:
  Commit id: 2f8cb65be80b5da49bcc214b85c10b8b1c3a4ff3
  Platform:
    osname=netbsd, osvers=5.1, archname=amd64-netbsd
    uname='netbsd deimos.tony.develop-help.com 5.1 netbsd 5.1 (generic) #0: sat nov 6 13:19:33 utc 2010 builds@b6.netbsd.org:homebuildsabnetbsd-5-1-releaseamd64201011061943z-objhomebuildsabnetbsd-5-1-releasesrcsysarchamd64compilegeneric amd64 '
    config_args='-des -Dusedevel'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/pkg/include',
    optimize='-O',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/pkg/include'
    ccversion='', gccversion='4.1.3 20080704 prerelease (NetBSD nb2 20081120)', 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='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/local/lib -fstack-protector -L/usr/pkg/lib'
    libpth=/usr/pkg/lib /lib /usr/lib
    libs=-lgdbm -lm -lcrypt -lutil -lc -lposix
    perllibs=-lm -lcrypt -lutil -lc -lposix
    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='-Wl,-E '
    cccdlflags='-DPIC -fPIC ', lddlflags='--whole-archive -shared  -L/usr/pkg/lib -fstack-protector'

Locally applied patches:
    


@INC for perl 5.17.0:
    lib
    /opt/lib/perl5/site_perl/5.17.0/amd64-netbsd
    /opt/lib/perl5/site_perl/5.17.0
    /opt/lib/perl5/5.17.0/amd64-netbsd
    /opt/lib/perl5/5.17.0
    .


Environment for perl 5.17.0:
    HOME=/home/tony
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/tony/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R7/bin:/usr/X11R6/bin:/usr/pkg/bin:/usr/pkg/sbin:/usr/games:/usr/local/bin:/usr/local/sbin
    PERL_BADLANG (unset)
    SHELL=/bin/sh

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2013

From @jkeenan

On Wed May 30 04​:01​:26 2012, tonyc wrote​:

This is a bug report for perl from tony@​develop-help.com,
generated with the help of perlbug 1.39 running under perl 5.17.0.

-----------------------------------------------------------------
[Please describe your issue here]

Parallel builds on NetBSD occasionally either fail, or produce an
invalid SDBM_File.so.

At the risk of asking too simplistic questions ...

1) Do all the failures you observe have a "related to SDBM_File" aspect?

2) You say that these failures occur during "parallel builds". Does
that mean 'make -j2'? In there some particular level at which these
failures become manifest, e.g., 'make -j4'?

3) You describe these as "occasional." Have you been able to observe
any pattern to the failures?

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2013

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

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2013

From @tonycoz

On Sat, Jan 26, 2013 at 06​:28​:18PM -0800, James E Keenan via RT wrote​:

On Wed May 30 04​:01​:26 2012, tonyc wrote​:

This is a bug report for perl from tony@​develop-help.com,
generated with the help of perlbug 1.39 running under perl 5.17.0.

-----------------------------------------------------------------
[Please describe your issue here]

Parallel builds on NetBSD occasionally either fail, or produce an
invalid SDBM_File.so.

At the risk of asking too simplistic questions ...

1) Do all the failures you observe have a "related to SDBM_File" aspect?

All of the failures I observed were either errors building
ext/SDBM_File/sdbm/libsdbm.a because an object file was missing or
errors testing SDBM tied hashes because the generated library was
corrupt.

2) You say that these failures occur during "parallel builds". Does
that mean 'make -j2'? In there some particular level at which these
failures become manifest, e.g., 'make -j4'?

The higher the parallelization the higher the chance of failure.

It's rare, but does occur at -j2, and IIRC about a 10% failure rate at
-j6.

3) You describe these as "occasional." Have you been able to observe
any pattern to the failures?

I only saw it happen for libsdbm.a.

The Makefile for libsdbm.a seems sane.

Tony

@tonycoz
Copy link
Contributor

tonycoz commented Jan 30, 2020

This was fixed in 4d106cc.

@tonycoz tonycoz closed this as completed Jan 30, 2020
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

2 participants