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

Time::HiRes test failure on threaded darwin build #15401

Open
p5pRT opened this issue Jun 21, 2016 · 9 comments
Open

Time::HiRes test failure on threaded darwin build #15401

p5pRT opened this issue Jun 21, 2016 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 21, 2016

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

Searchable as RT128445$

@p5pRT
Copy link
Author

p5pRT commented Jun 21, 2016

From @dur-randir

Created by @dur-randir

The following test consistently fails on threaded build (and passes on non-threaded)​:

./perl -Ilib -Idist/Time-HiRes dist/Time-HiRes/t/clock.t
1..5
# I am the main process 52997, starting the watchdog process...
# The watchdog process 52998 launched, continuing testing...
# I am the watchdog process 52998, sleeping for 360 seconds...
ok 1 - require Time​::HiRes;
# have_clock_gettime = 1
# have_clock_getres = 1
# have_clock_nanosleep = 1
# have_clock = 1
# CLOCK_REALTIME​: try = 1
panic​: MUTEX_LOCK (22) [HiRes.xs​:773] at dist/Time-HiRes/t/clock.t line 40.
# I am the main process 52997, terminating the watchdog process 52998 before it terminates me in 360 seconds (testing took 0 seconds).
# kill KILL 52998 = 1
# All done.
# Looks like your test exited with 255 just after 1.

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl 5.25.3:

Configured by dur-randir at Tue Jun 21 14:51:01 MSK 2016.

Summary of my perl5 (revision 5 version 25 subversion 3) configuration:
  Snapshot of: 143048c08af5307d9b4ff95c3322a6c67cff93cd
  Platform:
    osname=darwin
    osvers=13.4.0
    archname=darwin-thread-multi-2level
    uname='darwin isengard.local 13.4.0 darwin kernel version 13.4.0: wed mar 18 16:20:14 pdt 2015; root:xnu-2422.115.14~1release_x86_64 x86_64 '
    config_args='-de -Dprefix=/Users/dur-randir/perlbrew/perls/perl-blead-thr-dbg -Dusethreads -DDEBUGGING -Dusedevel -Aeval:scriptdir=/Users/dur-randir/perlbrew/perls/perl-blead-thr-dbg/bin'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fno-common -DPERL_DARWIN -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    optimize='-O3 -g'
    cppflags='-fno-common -DPERL_DARWIN -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion=''
    gccversion='4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)'
    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='env MACOSX_DEPLOYMENT_TARGET=10.3 cc'
    ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib /usr/local/lib /usr/lib
    libs=-lpthread -lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-lpthread -ldl -lm -lutil -lc
    libc=
    so=dylib
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=bundle
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'



@INC for perl 5.25.3:
    lib
    /Users/dur-randir/perlbrew/perls/perl-blead-thr-dbg/lib/site_perl/5.25.3/darwin-thread-multi-2level
    /Users/dur-randir/perlbrew/perls/perl-blead-thr-dbg/lib/site_perl/5.25.3
    /Users/dur-randir/perlbrew/perls/perl-blead-thr-dbg/lib/5.25.3/darwin-thread-multi-2level
    /Users/dur-randir/perlbrew/perls/perl-blead-thr-dbg/lib/5.25.3
    .


Environment for perl 5.25.3:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/dur-randir
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/Users/dur-randir/perlbrew/bin:/Users/dur-randir/perlbrew/perls/perl-5.20.2/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin
    PERLBREW_BASHRC_VERSION=0.69
    PERLBREW_HOME=/Users/dur-randir/.perlbrew
    PERLBREW_MANPATH=/Users/dur-randir/perlbrew/perls/perl-5.20.2/man
    PERLBREW_PATH=/Users/dur-randir/perlbrew/bin:/Users/dur-randir/perlbrew/perls/perl-5.20.2/bin
    PERLBREW_PERL=perl-5.20.2
    PERLBREW_ROOT=/Users/dur-randir/perlbrew
    PERLBREW_VERSION=0.69
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/zsh

@p5pRT
Copy link
Author

p5pRT commented Jul 20, 2016

From @tonycoz

On Tue Jun 21 05​:31​:08 2016, randir wrote​:

The following test consistently fails on threaded build (and passes on
non-threaded)​:

./perl -Ilib -Idist/Time-HiRes dist/Time-HiRes/t/clock.t
1..5
# I am the main process 52997, starting the watchdog process...
# The watchdog process 52998 launched, continuing testing...
# I am the watchdog process 52998, sleeping for 360 seconds...
ok 1 - require Time​::HiRes;
# have_clock_gettime = 1
# have_clock_getres = 1
# have_clock_nanosleep = 1
# have_clock = 1
# CLOCK_REALTIME​: try = 1
panic​: MUTEX_LOCK (22) [HiRes.xs​:773] at dist/Time-HiRes/t/clock.t
line 40.
# I am the main process 52997, terminating the watchdog process 52998
before it terminates me in 360 seconds (testing took 0 seconds).
# kill KILL 52998 = 1
# All done.
# Looks like your test exited with 255 just after 1.

This appears to have been fixed in blead, probably by

commit c4a535a
Author​: Steve Hay <steve.m.hay@​googlemail.com>
Date​: Fri Jul 1 08​:27​:18 2016 +0100

  Upgrade Time​::HiRes from version 1.9734 to 1.9739

which is confusing, since it's blead upstream.

Tony

@p5pRT
Copy link
Author

p5pRT commented Jul 20, 2016

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

@p5pRT
Copy link
Author

p5pRT commented Jul 20, 2016

From @dur-randir

On Tue Jul 19 22​:45​:43 2016, tonyc wrote​:

This appears to have been fixed in blead, probably by

commit c4a535a
Author​: Steve Hay <steve.m.hay@​googlemail.com>
Date​: Fri Jul 1 08​:27​:18 2016 +0100

Upgrade Time&#8203;::HiRes from version 1\.9734 to 1\.9739

Yes, it passes tests now.

@p5pRT
Copy link
Author

p5pRT commented Jan 30, 2017

From mojca.miklavec.lists@gmail.com

Dne Wed, 20 Jul 2016 04​:42​:48 -0700 je randir napisal​:

Yes, it passes tests now.

I'm probably experiencing the same problem with 5.24.1 (on OS X 10.7), but I checked 5.25.9 after finding this thread and all the tests pass on 5.25.9. Is there any chance to backport the fix? Thank you.

Some additional information below.

Just in case here's the relevant chuck from the tests (to make sure it's the same issue?)​:

dist/Time-HiRes/t/clock ....................................... panic​: MUTEX_LOCK (22) [HiRes.xs​:773] at t/clock.t line 40.
# Looks like you planned 5 tests but ran 1.
# Looks like your test exited with 255 just after 1.
FAILED--expected 5 tests, saw 1

This might be related to​:
  https://rt.perl.org/Public/Bug/Display.html?id=128972

Also relevant. I'm using the following patch for 5.24, else the build would fail on Sierra​:

--- dist/Time-HiRes/HiRes.xs.orig
+++ dist/Time-HiRes/HiRes.xs
@​@​ -940,7 +940,7 @​@​ BOOT​:
  }
# endif
#endif
-#if defined(PERL_DARWIN)
+#if defined(PERL_DARWIN) && !defined(CLOCK_REALTIME)
# ifdef USE_ITHREADS
  MUTEX_INIT(&darwin_time_mutex);
# endif

It could also be that the test fails because of this patch.

https://trac.macports.org/ticket/52012
https://trac.macports.org/ticket/53440

@p5pRT
Copy link
Author

p5pRT commented Feb 1, 2017

From mojca.miklavec.lists@gmail.com

The tests succeed with perl5.25.9.

One of our developers says that the problem is in the included version of Time​::HiRes​:

v5.22.3 1.9726
v5.24.1 1.9733
v5.25.9 1.9741

Citing David​:

Versions of OS X prior to Sierra do not provide the functions clock_getres(), clock_gettime(), clock_nanosleep() and consequently versions of Time​::HiRes prior to 1.9729 just disabled this functionality. perl5.22 @​5.22.3 has 1.9726 so passes the test.

Time​::HiRes 1.9729 then implemented emulation of clock_getres(), clock_gettime(), clock_nanosleep() on OS X platforms as an enhancement

Sierra however introduced clock_getres(), clock_gettime() but not clock_nanosleep() which broke the 1.9729 emulation code. This was fixed in Time​::HiRes 1.9739 but perl5.24 @​5.24.1 has 1.9733 so fails on Sierra.

perl5.25 @​5.25.9 has 1.9741 with this Sierra fix (and a few others for Sierra and El Capitan) so passes the test.

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2017

From @Leont

On Mon, Jan 30, 2017 at 12​:59 PM, Mojca Miklavec via RT
<perlbug-followup@​perl.org> wrote​:

Dne Wed, 20 Jul 2016 04​:42​:48 -0700 je randir napisal​:

Yes, it passes tests now.

I'm probably experiencing the same problem with 5.24.1 (on OS X 10.7), but I checked 5.25.9 after finding this thread and all the tests pass on 5.25.9. Is there any chance to backport the fix? Thank you.

Yeah, this does sound like a sensible thing to backport.

Leon

@p5pRT
Copy link
Author

p5pRT commented Feb 24, 2017

From @xsawyerx

On 02/17/2017 11​:15 AM, Leon Timmermans wrote​:

On Mon, Jan 30, 2017 at 12​:59 PM, Mojca Miklavec via RT
<perlbug-followup@​perl.org> wrote​:

Dne Wed, 20 Jul 2016 04​:42​:48 -0700 je randir napisal​:

Yes, it passes tests now.
I'm probably experiencing the same problem with 5.24.1 (on OS X 10.7), but I checked 5.25.9 after finding this thread and all the tests pass on 5.25.9. Is there any chance to backport the fix? Thank you.
Yeah, this does sound like a sensible thing to backport.

I agree.

@p5pRT
Copy link
Author

p5pRT commented Jul 28, 2017

From @steve-m-hay

Note​: Backporting a newer Time​::HiRes for 5.24.3 is under discussion in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=128427.

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