Debian Bug report logs - #628493
perl 5.14 FTBFS on kfreebsd-i386: t/op/threads failed

version graph

Package: src:eglibc; Maintainer for src:eglibc is GNU Libc Maintainers <debian-glibc@lists.debian.org>;

Reported by: Dominic Hargreaves <dom@earth.li>

Date: Sun, 29 May 2011 15:03:02 UTC

Severity: important

Found in version eglibc/2.13-21

Fixed in version eglibc/2.13-22

Done: Steven Chamberlain <steven@pyro.eu.org>

Bug is archived. No further changes may be made.

Forwarded to http://rt.perl.org/rt3/Ticket/Display.html?id=96272

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#628493; Package src:perl. (Sun, 29 May 2011 15:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dominic Hargreaves <dom@earth.li>:
New Bug report received and forwarded. Copy sent to Niko Tyni <ntyni@debian.org>. (Sun, 29 May 2011 15:03:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Dominic Hargreaves <dom@earth.li>
To: submit@bugs.debian.org
Subject: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Sun, 29 May 2011 16:01:48 +0100
Source: perl
Version: 5.14.0-1
Severity: important

perl 5.14 failed to build on kfreebsd-i386:

<https://buildd.debian.org/status/fetch.php?pkg=perl&arch=kfreebsd-i386&ver=5.14.0-1&stamp=1306233511>

t/op/threads...................................................FAILED--expected 24 tests, saw 23

I don't think that this is a failure we've seen before, so filing a
bug report. Will try reproducing on io.debian.net next.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)




Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#628493; Package src:perl. (Mon, 30 May 2011 19:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dominic Hargreaves <dom@earth.li>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Mon, 30 May 2011 19:21:03 GMT) Full text and rfc822 format available.

Message #10 received at 628493@bugs.debian.org (full text, mbox):

From: Dominic Hargreaves <dom@earth.li>
To: 628493@bugs.debian.org
Cc: kfreebsd-i386@buildd.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Mon, 30 May 2011 20:17:22 +0100
On Sun, May 29, 2011 at 04:01:48PM +0100, Dominic Hargreaves wrote:
> Source: perl
> Version: 5.14.0-1
> Severity: important
> 
> perl 5.14 failed to build on kfreebsd-i386:
> 
> <https://buildd.debian.org/status/fetch.php?pkg=perl&arch=kfreebsd-i386&ver=5.14.0-1&stamp=1306233511>
> 
> t/op/threads...................................................FAILED--expected 24 tests, saw 23
> 
> I don't think that this is a failure we've seen before, so filing a
> bug report. Will try reproducing on io.debian.net next.

io.debian.net built 5.14.0-1 successfully, so we're no further forward
on this one.

Buildd admins: could you retry this on another buildd for now
(this is in experimental) or you have any ideas?

Thanks,
Dominic.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)




Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#628493; Package src:perl. (Mon, 30 May 2011 20:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Egger <christoph@christoph-egger.org>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Mon, 30 May 2011 20:42:03 GMT) Full text and rfc822 format available.

Message #15 received at 628493@bugs.debian.org (full text, mbox):

From: Christoph Egger <christoph@christoph-egger.org>
To: Dominic Hargreaves <dom@earth.li>
Cc: 628493@bugs.debian.org, kfreebsd-i386@buildd.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Mon, 30 May 2011 22:39:42 +0200
Dominic Hargreaves <dom@earth.li> writes:
> On Sun, May 29, 2011 at 04:01:48PM +0100, Dominic Hargreaves wrote:
>> Source: perl
>> Version: 5.14.0-1
>> Severity: important
>> 
>> perl 5.14 failed to build on kfreebsd-i386:
>> 
>> <https://buildd.debian.org/status/fetch.php?pkg=perl&arch=kfreebsd-i386&ver=5.14.0-1&stamp=1306233511>
>> 
>> t/op/threads...................................................FAILED--expected 24 tests, saw 23
>> 
>> I don't think that this is a failure we've seen before, so filing a
>> bug report. Will try reproducing on io.debian.net next.
>
> io.debian.net built 5.14.0-1 successfully, so we're no further forward
> on this one.
>
> Buildd admins: could you retry this on another buildd for now
> (this is in experimental) or you have any ideas?

Resheduled .. let's see where it gets taken (I don't have any influence
on that).

Regards

    Christoph




Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#628493; Package src:perl. (Tue, 31 May 2011 19:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dominic Hargreaves <dom@earth.li>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Tue, 31 May 2011 19:03:03 GMT) Full text and rfc822 format available.

Message #20 received at 628493@bugs.debian.org (full text, mbox):

From: Dominic Hargreaves <dom@earth.li>
To: Christoph Egger <christoph@christoph-egger.org>, 628493@bugs.debian.org
Cc: kfreebsd-i386@buildd.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Tue, 31 May 2011 19:59:26 +0100
On Mon, May 30, 2011 at 10:39:42PM +0200, Christoph Egger wrote:
> Dominic Hargreaves <dom@earth.li> writes:

> > io.debian.net built 5.14.0-1 successfully, so we're no further forward
> > on this one.
> >
> > Buildd admins: could you retry this on another buildd for now
> > (this is in experimental) or you have any ideas?
> 
> Resheduled .. let's see where it gets taken (I don't have any influence
> on that).

Thanks. I notice it eventually got rebuilt on finzi. Are there any
likely looking differences between field and finzi to help us track
down this problem?

Dominic.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)




Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#628493; Package src:perl. (Tue, 31 May 2011 19:57:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Egger <christoph@debian.org>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Tue, 31 May 2011 19:57:06 GMT) Full text and rfc822 format available.

Message #25 received at 628493@bugs.debian.org (full text, mbox):

From: Christoph Egger <christoph@debian.org>
To: Dominic Hargreaves <dom@earth.li>
Cc: 628493@bugs.debian.org, kfreebsd-i386@buildd.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Tue, 31 May 2011 21:56:11 +0200
[Message part 1 (text/plain, inline)]
Dominic Hargreaves <dom@earth.li> writes:
> On Mon, May 30, 2011 at 10:39:42PM +0200, Christoph Egger wrote:
>> Dominic Hargreaves <dom@earth.li> writes:
>> > io.debian.net built 5.14.0-1 successfully, so we're no further forward
>> > on this one.
>> >
>> > Buildd admins: could you retry this on another buildd for now
>> > (this is in experimental) or you have any ideas?
>> 
>> Resheduled .. let's see where it gets taken (I don't have any influence
>> on that).
>
> Thanks. I notice it eventually got rebuilt on finzi. Are there any
> likely looking differences between field and finzi to help us track
> down this problem?

    Well the obvious difference is finzi being a virtual machine while
field is real hardware. It's however a bit strange as the perl 5.14
build on kfreebsd-amd64 failed on the virtual machine (fano) while
building fine on fasch. fasch and field being nearly identical machines
as well as finzi and fano.

    Might as well be some minor difference in software configuration but
I don"t have anything I could tell you there.

Regards

    Christoph

-- 
9FED 5C6C E206 B70A 5857  70CA 9655 22B9 D49A E731
Debian Developer | Lisp Hacker | CaCert Assurer

A. Because it breaks the logical sequence of discussion
Q. Why is top posting bad?
[Message part 2 (application/pgp-signature, inline)]

Changed Bug title to 'perl 5.14 FTBFS on kfreebsd-i386: t/op/threads failed' from 'perl: FTBFS on kfreebsd-i386: t/op/threads failed' Request was from Dominic Hargreaves <dom@earth.li> to control@bugs.debian.org. (Sun, 31 Jul 2011 15:24:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#628493; Package src:perl. (Tue, 02 Aug 2011 13:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niko Tyni <ntyni@debian.org>:
Extra info received and forwarded to list. (Tue, 02 Aug 2011 13:33:04 GMT) Full text and rfc822 format available.

Message #32 received at 628493@bugs.debian.org (full text, mbox):

From: Niko Tyni <ntyni@debian.org>
To: 628493@bugs.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Tue, 2 Aug 2011 16:31:38 +0300
On Sun, May 29, 2011 at 04:01:48PM +0100, Dominic Hargreaves wrote:
> Source: perl
> Version: 5.14.0-1
> Severity: important
> 
> perl 5.14 failed to build on kfreebsd-i386:
> 
> <https://buildd.debian.org/status/fetch.php?pkg=perl&arch=kfreebsd-i386&ver=5.14.0-1&stamp=1306233511>
> 
> t/op/threads...................................................FAILED--expected 24 tests, saw 23

I'm able to reproduce this on a kvm kfreebsd-i386 virtual machine with
SMP enabled (but not on a non-SMP kernel, where the package builds fine.)

 ./perl.debug -Ilib -Mthreads -e 'threads->create(sub {})->detach; open(my $out, "|$^X") or die $!'; 

crashes non-deterministically more than half of the time for me
(and hangs about 10% of the time.)

The next thing is to try and reproduce it on bleadperl. 

FWIW, the relevant test was introduced as part of the fix for [perl #78494].

Stack trace:

  Core was generated by `perl.debug'.
  Program terminated with signal 11, Segmentation fault.
  #0  0x283a8062 in nanosleep () from /lib/i386-kfreebsd-gnu/i686/cmov/libpthread.so.0
  (gdb) bt
  #0  0x283a8062 in nanosleep () from /lib/i386-kfreebsd-gnu/i686/cmov/libpthread.so.0
  #1  0x283a6358 in T.25 () from /lib/i386-kfreebsd-gnu/i686/cmov/libpthread.so.0
  #2  0x283a64ce in __pthread_alt_unlock () from /lib/i386-kfreebsd-gnu/i686/cmov/libpthread.so.0
  #3  0x283a385f in pthread_mutex_unlock () from /lib/i386-kfreebsd-gnu/i686/cmov/libpthread.so.0
  #4  0x08110f9f in Perl_atfork_unlock () at util.c:2884
  #5  0x283a3b86 in __pthread_fork () from /lib/i386-kfreebsd-gnu/i686/cmov/libpthread.so.0
  #6  0x28445bd1 in fork () from /lib/i386-kfreebsd-gnu/i686/cmov/libc.so.0.1
  #7  0x283a3ab4 in fork () from /lib/i386-kfreebsd-gnu/i686/cmov/libpthread.so.0
  #8  0x081114df in Perl_my_fork (my_perl=0x8350f60, cmd=0x83eef85 "/home/niko/perl/perl.debug", 
      mode=0xbfbfe574 "w") at util.c:2900
  #9  Perl_my_popen (my_perl=0x8350f60, cmd=0x83eef85 "/home/niko/perl/perl.debug", mode=0xbfbfe574 "w")
      at util.c:2695
  #10 0x082203f7 in Perl_do_openn (my_perl=0x8350f60, gv=0x83547b8, 
      oname=0x83eef54 "|/home/niko/perl/perl.debug", len=<value optimized out>, as_raw=0, rawmode=0, 
      rawperm=0, supplied_fp=0x0, svp=0x83565a8, num_svs=0) at doio.c:274
  #11 0x081fa8da in Perl_pp_open (my_perl=0x8350f60) at pp_sys.c:604
  #12 0x0810c58f in Perl_runops_debug (my_perl=0x8350f60) at dump.c:2266
  #13 0x0808d2dd in S_run_body (my_perl=0x8350f60) at perl.c:2350
  #14 perl_run (my_perl=0x8350f60) at perl.c:2268
  #15 0x08061837 in main (argc=5, argv=0xbfbfe788, env=0xbfbfe7a0) at perlmain.c:120
 
-- 
Niko Tyni   ntyni@debian.org




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#628493; Package src:perl. (Thu, 04 Aug 2011 08:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niko Tyni <ntyni@debian.org>:
Extra info received and forwarded to list. (Thu, 04 Aug 2011 08:51:05 GMT) Full text and rfc822 format available.

Message #37 received at 628493@bugs.debian.org (full text, mbox):

From: Niko Tyni <ntyni@debian.org>
To: 628493@bugs.debian.org
Cc: debian-bsd@lists.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Thu, 4 Aug 2011 11:48:27 +0300
On Tue, Aug 02, 2011 at 04:31:38PM +0300, Niko Tyni wrote:
> On Sun, May 29, 2011 at 04:01:48PM +0100, Dominic Hargreaves wrote:
> > Source: perl
> > Version: 5.14.0-1
> > Severity: important
> > 
> > perl 5.14 failed to build on kfreebsd-i386:
> > 
> > <https://buildd.debian.org/status/fetch.php?pkg=perl&arch=kfreebsd-i386&ver=5.14.0-1&stamp=1306233511>
> > 
> > t/op/threads...................................................FAILED--expected 24 tests, saw 23
> 
> I'm able to reproduce this on a kvm kfreebsd-i386 virtual machine with
> SMP enabled (but not on a non-SMP kernel, where the package builds fine.)

Also happens with the perl in sid (5.12.4), reduced down to

 perl -Mthreads -e 'threads->create(sub {})->detach; fork'

which crashes non-deterministically about half the time for me.

I don't see this on a "real" FreeBSD system (8.2-RELEASE), nor on Linux.

I'll report it upstream, but it seems possible that the problem is more
on the libc / kernel side. Cc'ing the kfreebsd porter list. Help would
be appreciated.

Program terminated with signal 11, Segmentation fault.
#0  0x28366062 in nanosleep () at ../sysdeps/unix/syscall-template.S:82
82  ../sysdeps/unix/syscall-template.S: No such file or directory.
    in ../sysdeps/unix/syscall-template.S
(gdb) bt
#0  0x28366062 in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x28364358 in __pthread_acquire (spinlock=<value optimized out>) at spinlock.c:728
#2  0x283644ce in wait_node_free (lock=0x830dc14) at spinlock.c:307
#3  __pthread_alt_unlock (lock=0x830dc14) at spinlock.c:591
#4  0x2836185f in __pthread_mutex_unlock (mutex=0x830dc04) at mutex.c:199
#5  0x08100eff in Perl_atfork_unlock () at util.c:2611
#6  0x28361b86 in __pthread_fork (b=0x284969e0) at ptfork.c:72
#7  0x28402bd1 in __libc_fork () at ../linuxthreads/sysdeps/unix/sysv/linux/fork.c:39
#8  0x28361ab4 in __fork () at ptfork.c:84
#9  0x081e77a0 in Perl_pp_fork (my_perl=0x830dd00) at pp_sys.c:4056
#10 0x080fc6dc in Perl_runops_debug (my_perl=0x830dd00) at dump.c:2049
#11 0x0808eae4 in S_run_body (my_perl=0x830dd00) at perl.c:2308
#12 perl_run (my_perl=0x830dd00) at perl.c:2233
#13 0x08066e97 in main (argc=4, argv=0xbfbfe7b0, env=0xbfbfe7c4) at perlmain.c:117

-- 
Niko Tyni   ntyni@debian.org




Set Bug forwarded-to-address to 'http://rt.perl.org/rt3/Ticket/Display.html?id=96272'. Request was from Niko Tyni <ntyni@debian.org> to control@bugs.debian.org. (Thu, 04 Aug 2011 12:26:37 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#628493; Package src:perl. (Fri, 05 Aug 2011 08:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niko Tyni <ntyni@debian.org>:
Extra info received and forwarded to list. (Fri, 05 Aug 2011 08:21:03 GMT) Full text and rfc822 format available.

Message #44 received at 628493@bugs.debian.org (full text, mbox):

From: Niko Tyni <ntyni@debian.org>
To: 628493@bugs.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Fri, 5 Aug 2011 11:18:36 +0300
[Message part 1 (text/plain, inline)]
On Thu, Aug 04, 2011 at 11:48:27AM +0300, Niko Tyni wrote:
> On Tue, Aug 02, 2011 at 04:31:38PM +0300, Niko Tyni wrote:
> > On Sun, May 29, 2011 at 04:01:48PM +0100, Dominic Hargreaves wrote:
> > > Source: perl
> > > Version: 5.14.0-1
> > > Severity: important
> > > 
> > > perl 5.14 failed to build on kfreebsd-i386:
> > > 
> > > <https://buildd.debian.org/status/fetch.php?pkg=perl&arch=kfreebsd-i386&ver=5.14.0-1&stamp=1306233511>
> > > 
> > > t/op/threads...................................................FAILED--expected 24 tests, saw 23
> > 
> > I'm able to reproduce this on a kvm kfreebsd-i386 virtual machine with
> > SMP enabled (but not on a non-SMP kernel, where the package builds fine.)

>  perl -Mthreads -e 'threads->create(sub {})->detach; fork'

> I'll report it upstream, but it seems possible that the problem is more
> on the libc / kernel side. Cc'ing the kfreebsd porter list. Help would
> be appreciated.

This also crashes on Squeeze, albeit with a SIGBUS instead of SIGSEGV.
IMO that means this bug shouldn't block Perl 5.14 going into wheezy.

I don't think there's much else we can do about this, so I propose we
add the attached patch to skip the crashing test but leave this bug open.
-- 
Niko Tyni   ntyni@debian.org
[0001-Skip-a-crashing-test-case-in-t-op-threads.t-on-GNU-k.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#628493; Package src:perl. (Sat, 06 Aug 2011 15:15:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dominic Hargreaves <dom@earth.li>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Sat, 06 Aug 2011 15:15:05 GMT) Full text and rfc822 format available.

Message #49 received at 628493@bugs.debian.org (full text, mbox):

From: Dominic Hargreaves <dom@earth.li>
To: Niko Tyni <ntyni@debian.org>, 628493@bugs.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Sat, 6 Aug 2011 16:12:41 +0100
On Fri, Aug 05, 2011 at 11:18:36AM +0300, Niko Tyni wrote:
> This also crashes on Squeeze, albeit with a SIGBUS instead of SIGSEGV.
> IMO that means this bug shouldn't block Perl 5.14 going into wheezy.
> 
> I don't think there's much else we can do about this, so I propose we
> add the attached patch to skip the crashing test but leave this bug open.

Agreed, and pushed.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)




Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#628493; Package src:perl. (Mon, 08 Aug 2011 10:30:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petr Salinger <Petr.Salinger@seznam.cz>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Mon, 08 Aug 2011 10:30:13 GMT) Full text and rfc822 format available.

Message #54 received at 628493@bugs.debian.org (full text, mbox):

From: Petr Salinger <Petr.Salinger@seznam.cz>
To: Niko Tyni <ntyni@debian.org>
Cc: 628493@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Mon, 8 Aug 2011 12:36:22 +0200 (CEST)
[Message part 1 (text/plain, inline)]
> perl -Mthreads -e 'threads->create(sub {})->detach; fork'
>
> which crashes non-deterministically about half the time for me.

Thanks for reduced testcase.

The problem might be in usage of "pthread_atfork(lock, unlock, unlock)".
It is perfectly valid to unlock() in parent.
But in child it might be problematic.
There might be congestion of the lock, i.e. some other thread is waiting 
for it. After fork(), there is no such thread in child, which could be waken up.

The POSIX is not clear about it:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_atfork.html

It would be better in child to just reinit the mutex.
The attached code crashes non-deterministically for me with unlock(),
but works at 100% with reinit().

It should suffice to add into util.c

*************
void
Perl_atfork_reinit(void)
{
    dVAR;
#if defined(USE_ITHREADS)
    /* locks must be released in same order as in atfork_lock() */
#  ifdef MYMALLOC
    MUTEX_INIT(&PL_malloc_mutex);
#  endif
    OP_REFCNT_INIT;
#endif
}
************

and

--- miniperlmain.c
+++ miniperlmain.c
@@ -101,7 +101,7 @@
      * --GSAR 2001-07-20 */
     PTHREAD_ATFORK(Perl_atfork_lock,
                    Perl_atfork_unlock,
-                   Perl_atfork_unlock);
+                   Perl_atfork_reinit);
 #endif

     if (!PL_do_undump) {


Untested, though.

Petr
[c.c (text/x-csrc, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#628493; Package src:perl. (Sat, 10 Sep 2011 18:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niko Tyni <ntyni@debian.org>:
Extra info received and forwarded to list. (Sat, 10 Sep 2011 18:45:03 GMT) Full text and rfc822 format available.

Message #59 received at 628493@bugs.debian.org (full text, mbox):

From: Niko Tyni <ntyni@debian.org>
To: 628493@bugs.debian.org
Cc: debian-bsd@lists.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Sat, 10 Sep 2011 21:41:38 +0300
[Message part 1 (text/plain, inline)]
On Mon, Aug 08, 2011 at 12:36:22PM +0200, Petr Salinger wrote:
> >perl -Mthreads -e 'threads->create(sub {})->detach; fork'
> >
> >which crashes non-deterministically about half the time for me.

> The problem might be in usage of "pthread_atfork(lock, unlock, unlock)".

[...]

> It should suffice to add into util.c

> Perl_atfork_reinit(void)

> and

> --- miniperlmain.c
> +++ miniperlmain.c
> @@ -101,7 +101,7 @@
>       * --GSAR 2001-07-20 */
>      PTHREAD_ATFORK(Perl_atfork_lock,
>                     Perl_atfork_unlock,
> -                   Perl_atfork_unlock);
> +                   Perl_atfork_reinit);
>  #endif

Thanks, and sorry for the delay!

I finally found the time to try this out, but unfortunately it does
not seem to fix the problem.  Even the crash trace looks the same.
(I did check that Perl_atfork_reinit() actually gets run.)

I'm attaching the full patch I used based on the above. Most of it is
generated by regen.pl in the source top level directory after editing
embed.fnc.

Running 'debian/rules perl.debug' after applying this should be enough to
do a test build. Alternatively, I'm happy to try out other suggestions,
hopefully with a shorter turnaround time than with this one :)

Thanks again,
-- 
Niko Tyni   ntyni@debian.org
[0001-Reinit-mutex-after-a-fork.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#628493; Package src:perl. (Sun, 10 Jun 2012 22:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dominic Hargreaves <dom@earth.li>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Sun, 10 Jun 2012 22:21:03 GMT) Full text and rfc822 format available.

Message #64 received at 628493@bugs.debian.org (full text, mbox):

From: Dominic Hargreaves <dom@earth.li>
To: Niko Tyni <ntyni@debian.org>, 628493@bugs.debian.org
Cc: debian-bsd@lists.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Sun, 10 Jun 2012 23:18:35 +0100
On Sat, Sep 10, 2011 at 09:41:38PM +0300, Niko Tyni wrote:
> On Mon, Aug 08, 2011 at 12:36:22PM +0200, Petr Salinger wrote:
> > >perl -Mthreads -e 'threads->create(sub {})->detach; fork'
> > >
> > >which crashes non-deterministically about half the time for me.
> 
> > The problem might be in usage of "pthread_atfork(lock, unlock, unlock)".
> 
> [...]
> 
> > It should suffice to add into util.c
> 
> > Perl_atfork_reinit(void)
> 
> > and
> 
> > --- miniperlmain.c
> > +++ miniperlmain.c
> > @@ -101,7 +101,7 @@
> >       * --GSAR 2001-07-20 */
> >      PTHREAD_ATFORK(Perl_atfork_lock,
> >                     Perl_atfork_unlock,
> > -                   Perl_atfork_unlock);
> > +                   Perl_atfork_reinit);
> >  #endif
> 
> Thanks, and sorry for the delay!
> 
> I finally found the time to try this out, but unfortunately it does
> not seem to fix the problem.  Even the crash trace looks the same.
> (I did check that Perl_atfork_reinit() actually gets run.)
> 
> I'm attaching the full patch I used based on the above. Most of it is
> generated by regen.pl in the source top level directory after editing
> embed.fnc.
> 
> Running 'debian/rules perl.debug' after applying this should be enough to
> do a test build. Alternatively, I'm happy to try out other suggestions,
> hopefully with a shorter turnaround time than with this one :)

The test case:

perl -Mthreads -e 'threads->create(sub {})->detach; fork'

ran 10,000 times without crashing on my kfreeBSD KVM (SMP) VM, using
5.14.2-11 and up-to-date sid from today.

Can you reproduce this? If so, perhaps the problem has been solved
by some change in kFreeBSD.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)




Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#628493; Package src:perl. (Sun, 10 Jun 2012 23:09:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Sun, 10 Jun 2012 23:09:06 GMT) Full text and rfc822 format available.

Message #69 received at 628493@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: Dominic Hargreaves <dom@earth.li>
Cc: Niko Tyni <ntyni@debian.org>, 628493@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Mon, 11 Jun 2012 00:06:57 +0100
reassign 628493 src:eglibc
affects 628493 src:perl
found 628493 2.13-21
close 628493 2.13-22
user debian-bsd@lists.debian.org
usertags 628493 kfreebsd
thanks

On 10/06/12 23:18, Dominic Hargreaves wrote:
> perl -Mthreads -e 'threads->create(sub {})->detach; fork'

Hi!

I just bisected on past eglibc versions and this is reproducible for me
(segfault 5% of the time) on kfreebsd-i386, up until this version, with
which I can't reproduce the problem any more (10,000+ test runs) :

>  eglibc  (2.13-22) unstable; urgency=low 
>  -- Aurelien Jarno <aurel32@debian.org>  Sat, 10 Dec 2011 21:49:03 +0100 

The changelog for that version was quite long, but probably these
changes are what fixed this:

>    [ Petr Salinger ]
>    * kfreebsd/local-sysdeps.diff: update to revision 3763 (from glibc-bsd).
>    * add kfreebsd/local-use-thr-primitives.diff to use kernel thr*
>      primitives inside linuxthreads. Closes: #639658.

Therefore I'm marking this as fixed in that eglibc upload and I'll try
to let upstream know.  Thanks!

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org




Bug reassigned from package 'src:perl' to 'src:eglibc'. Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Sun, 10 Jun 2012 23:09:13 GMT) Full text and rfc822 format available.

No longer marked as found in versions perl/5.14.0-1. Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Sun, 10 Jun 2012 23:09:14 GMT) Full text and rfc822 format available.

Added indication that 628493 affects src:perl Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Sun, 10 Jun 2012 23:09:14 GMT) Full text and rfc822 format available.

Marked as found in versions eglibc/2.13-21. Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Sun, 10 Jun 2012 23:09:15 GMT) Full text and rfc822 format available.

Marked as fixed in versions eglibc/2.13-22. Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Sun, 10 Jun 2012 23:09:15 GMT) Full text and rfc822 format available.

Marked Bug as done Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Sun, 10 Jun 2012 23:09:16 GMT) Full text and rfc822 format available.

Notification sent to Dominic Hargreaves <dom@earth.li>:
Bug acknowledged by developer. (Sun, 10 Jun 2012 23:09:17 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#628493; Package src:eglibc. (Mon, 11 Jun 2012 05:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petr Salinger <Petr.Salinger@seznam.cz>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 11 Jun 2012 05:21:03 GMT) Full text and rfc822 format available.

Message #88 received at 628493@bugs.debian.org (full text, mbox):

From: Petr Salinger <Petr.Salinger@seznam.cz>
To: Steven Chamberlain <steven@pyro.eu.org>
Cc: Dominic Hargreaves <dom@earth.li>, Niko Tyni <ntyni@debian.org>, 628493@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Mon, 11 Jun 2012 07:03:57 +0200 (CEST)
> Hi!
>
> I just bisected on past eglibc versions and this is reproducible for me
> (segfault 5% of the time) on kfreebsd-i386, up until this version, with
> which I can't reproduce the problem any more (10,000+ test runs) :
>
>>  eglibc  (2.13-22) unstable; urgency=low
>>  -- Aurelien Jarno <aurel32@debian.org>  Sat, 10 Dec 2011 21:49:03 +0100
>
> The changelog for that version was quite long, but probably these
> changes are what fixed this:
>
>>    [ Petr Salinger ]
>>    * kfreebsd/local-sysdeps.diff: update to revision 3763 (from glibc-bsd).
>>    * add kfreebsd/local-use-thr-primitives.diff to use kernel thr*
>>      primitives inside linuxthreads. Closes: #639658.
>
> Therefore I'm marking this as fixed in that eglibc upload and I'll try
> to let upstream know.  Thanks!


IMO, my suggested change (Perl_atfork_reinit) in "Message #54" [1]
still should be aplied by perl upstream. While it might not be problem 
for this testcase, the unlocking in forked child is fragile.

Petr

[1] http://bugs.debian.org//cgi-bin/bugreport.cgi?bug=628493#54




Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#628493; Package src:eglibc. (Mon, 11 Jun 2012 10:09:20 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dominic Hargreaves <dom@earth.li>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 11 Jun 2012 10:09:26 GMT) Full text and rfc822 format available.

Message #93 received at 628493@bugs.debian.org (full text, mbox):

From: Dominic Hargreaves <dom@earth.li>
To: Petr Salinger <Petr.Salinger@seznam.cz>
Cc: Steven Chamberlain <steven@pyro.eu.org>, Niko Tyni <ntyni@debian.org>, 628493@bugs.debian.org, debian-bsd@lists.debian.org, control@bugs.debian.org
Subject: Re: Bug#628493: perl: FTBFS on kfreebsd-i386: t/op/threads failed
Date: Mon, 11 Jun 2012 10:12:34 +0100
clone 628493 -1 -2
reassign -1 perl
reassign -2 perl
found -1 5.14.2-11
found -2 5.14.2-11
severity -1 important
severity -2 wishlist
retitle -1 Re-enable kFreeBSD threads test
retitle -2 Perl_atfork_reinit change
tags -2 +patch
thanks

On Mon, Jun 11, 2012 at 07:03:57AM +0200, Petr Salinger wrote:
> >Hi!
> >
> >I just bisected on past eglibc versions and this is reproducible for me
> >(segfault 5% of the time) on kfreebsd-i386, up until this version, with
> >which I can't reproduce the problem any more (10,000+ test runs) :
> >
> >> eglibc  (2.13-22) unstable; urgency=low
> >> -- Aurelien Jarno <aurel32@debian.org>  Sat, 10 Dec 2011 21:49:03 +0100
> >
> >The changelog for that version was quite long, but probably these
> >changes are what fixed this:
> >
> >>   [ Petr Salinger ]
> >>   * kfreebsd/local-sysdeps.diff: update to revision 3763 (from glibc-bsd).
> >>   * add kfreebsd/local-use-thr-primitives.diff to use kernel thr*
> >>     primitives inside linuxthreads. Closes: #639658.
> >
> >Therefore I'm marking this as fixed in that eglibc upload and I'll try
> >to let upstream know.  Thanks!
> 
> 
> IMO, my suggested change (Perl_atfork_reinit) in "Message #54" [1]
> still should be aplied by perl upstream. While it might not be
> problem for this testcase, the unlocking in forked child is fragile.
> 
> Petr
> 
> [1] http://bugs.debian.org//cgi-bin/bugreport.cgi?bug=628493#54

Thanks both. Cloning bugs as appropriate.

Dominic.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)




Bug 628493 cloned as bugs 677045, 677046 Request was from Dominic Hargreaves <dom@earth.li> to control@bugs.debian.org. (Mon, 11 Jun 2012 10:09:37 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 10 Jul 2012 07:49:59 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 07:17:38 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.