NetBSD Problem Report #48314

From martin@duskware.de  Wed Oct 16 07:24:14 2013
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B3358726E4
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 16 Oct 2013 07:24:14 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: libevent test failures are real
X-Send-Pr-Version: 3.95

>Number:         48314
>Category:       lib
>Synopsis:       libevent test failures are real
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 16 07:25:00 +0000 2013
>Closed-Date:    Wed Nov 22 10:13:12 +0000 2017
>Last-Modified:  Wed Nov 22 10:13:12 +0000 2017
>Originator:     Martin Husemann
>Release:        NetBSD 6.1_STABLE (but the same effect is visible in -current)
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD night-porter.duskware.de 6.1_STABLE NetBSD 6.1_STABLE (PORTER) #6: Wed May 29 21:38:20 CEST 2013 martin@night-porter.duskware.de:/usr/src-6/sys/arch/i386/compile/PORTER i386
Architecture: i386
Machine: i386
>Description:

A bit of background: I have a JavaScript/html5 application [which I 
unfortunately can not disclose here], that heavily relies on javasript timers
(lots of them) and is slightly critical in getting those fired at the
expected times. This web page works on anything, all browsers tested so far,
even mobile ones on pretty slow devices.

However, it consistently fails on Firefox on NetBSD.

If I read the firefox code correctly, it heavily relies on libevent and its
timeouts to organize its internal queue of future events and callbacks to
fire. This now leads to the main point of this PR:

In pkgsrc/devel/libevent an "make test" fails spectactularily. Basically all
timing related tests plain fail.

Compare to that our ATF tests for it and then see the difference:

src/external/bsd/libevent/dist/test/regress_thread.c has this log:
----------------------------
revision 1.4
date: 2013-04-12 22:00:21 +0200;  author: christos;  state: Exp;  lines: +5 -3;
branches:  1.4.4;
#if 0 more
----------------------------
revision 1.3
date: 2013-04-12 21:59:26 +0200;  author: christos;  state: Exp;  lines: +7 -3;
XXX: disable the simple conditions test right now because it depends on
thread scheduling timings and we don't seem to schedule threads the way
it assumes.
----------------------------

I think this XXX statement points to a real bug, either in libpthread or
the kernel.

>How-To-Repeat:
Run pkgsrc libevent tests.

>Fix:
no idea yet

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/48314: libevent test failures are real
Date: Wed, 16 Oct 2013 15:44:31 +0200

 Just to make sure it isn't a bug already fixed upstream in libevent: I tried
 2.1.3-alpha and get (besides a libz related failure) exactly two timing
 based ones:

   FAIL test/regress_thread.c:379: assert(abs(timeval_msec_diff((&target_time), (&alerted[i].alerted_at)) - 0) <= 50): 128 vs 50thread/conditions_simple: 
   [conditions_simple FAILED]

   FAIL test/regress_thread.c:379: assert(abs(timeval_msec_diff((&target_time), (&alerted[i].alerted_at)) - 0) <= 50): 128 vs 50thread/conditions_simple: 
   [conditions_simple FAILED]


 Martin

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Wed, 22 Nov 2017 10:13:12 +0000
State-Changed-Why:
Old libevent state does not matter any more


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.