From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michaelawells Newsgroups: gmane.lisp.guile.bugs Subject: Re: possible gc/weak hash table bug Date: Thu, 17 Mar 2011 22:31:13 -0500 Message-ID: <492D9465-DCEE-4E47-B642-E000C5D7DCD8@gmail.com> References: <2A90EE37-595C-40D2-9EFC-E4E166F94CE2@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1300432613 17645 80.91.229.12 (18 Mar 2011 07:16:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2011 07:16:53 +0000 (UTC) Cc: bug-guile@gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 18 08:16:49 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q0TvU-0004fU-An for guile-bugs@m.gmane.org; Fri, 18 Mar 2011 08:16:48 +0100 Original-Received: from localhost ([127.0.0.1]:51088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0TvU-00031K-1o for guile-bugs@m.gmane.org; Fri, 18 Mar 2011 03:16:48 -0400 Original-Received: from [140.186.70.92] (port=41485 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0QPG-0000rG-BN for bug-guile@gnu.org; Thu, 17 Mar 2011 23:31:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0QPE-0002Or-Ty for bug-guile@gnu.org; Thu, 17 Mar 2011 23:31:18 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:45117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0QPE-0002On-N1 for bug-guile@gnu.org; Thu, 17 Mar 2011 23:31:16 -0400 Original-Received: by iyf13 with SMTP id 13so4392655iyf.0 for ; Thu, 17 Mar 2011 20:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer; bh=AhfFSpQfiiotsZEvCntFPnuGXGCngg4KP6J82MWuBHk=; b=N/LhfCEK6LnvlgCTZUSVa+QcrALpapnip/5pfQy2cPrIIFpQ0ufh9SvluDGU4VglLr D5y36Dp2oiCAmWMm0qhiGTJFIBLy14m0e9aKzRotDNXZh+7AfhquCmiKehdMiez9JjbF DhqErqkWRHMsBg+jvTofH24uUcMWTx/wmNeC0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=h2aK801hyuG7oF1deXwVV0KrGKiw+naBa8nZUT6O7BZyivgeEeU7qz/d1UDqVj6Grl cr6w20iFD7n4frIlGb9oAvHBdiPOTJT/GVDfWaSmoQdDxPf6nQk/uzNxxMQUZOYeOFkO pF8pYI+yXzcrDaDJzra/h/odiho0Eur3e4I4U= Original-Received: by 10.231.25.137 with SMTP id z9mr526518ibb.53.1300419076087; Thu, 17 Mar 2011 20:31:16 -0700 (PDT) Original-Received: from [192.168.2.104] (adsl-99-11-51-29.dsl.chcgil.sbcglobal.net [99.11.51.29]) by mx.google.com with ESMTPS id d10sm1046541ibb.51.2011.03.17.20.31.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Mar 2011 20:31:15 -0700 (PDT) In-Reply-To: <2A90EE37-595C-40D2-9EFC-E4E166F94CE2@gmail.com> X-Mailer: Apple Mail (2.1082) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-Mailman-Approved-At: Fri, 18 Mar 2011 03:16:36 -0400 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5338 Archived-At: I replaced vacuum_weak_hash_table with the following: > static void > vacuum_weak_hash_table (SCM table) > { > SCM buckets =3D SCM_HASHTABLE_VECTOR (table); > unsigned long k =3D SCM_SIMPLE_VECTOR_LENGTH (buckets); > size_t len =3D SCM_HASHTABLE_N_ITEMS (table); >=20 > unsigned long org_k =3D SCM_SIMPLE_VECTOR_LENGTH (buckets); > size_t org_len =3D SCM_HASHTABLE_N_ITEMS (table); >=20 >=20 > if (len>0) { > while (k--) > { > size_t removed; > SCM alist =3D SCM_SIMPLE_VECTOR_REF (buckets, k); > alist =3D scm_fixup_weak_alist (alist, &removed); > if (! (removed <=3D len)) { > fprintf(stderr,"$$$ k =3D %lu (%lu) removed =3D %i len =3D %i = (%i)\n",k,org_k,removed,len,org_len); > } > assert (removed <=3D len); > len -=3D removed; > SCM_SIMPLE_VECTOR_SET (buckets, k, alist); > } > =20 > SCM_SET_HASHTABLE_N_ITEMS (table, len); > } > } Two failure occurred in two different runs. Each time, the debugging = message was the same: > $$$ k =3D 89 (113) removed =3D 1 len =3D 0 (5) > hashtab.c:145: vacuum_weak_hash_table: Assertion `removed <=3D len' = failed. This happened while vacuuming bucket 89 (of 113). The original length = was 5. Again, this problem occurs both infrequently and intermittently. =20 On Mar 17, 2011, at 7:09 PM, michaelawells wrote: > As requested, I'm posting this to bug-guile@gnu.org. >=20 > I'm now seeing this assertion failure, using a guile development = snapshot (guile-2.0.0.104-f5fc7): >=20 >> dpm.linux: hashtab.c:136: vacuum_weak_hash_table: Assertion `removed = <=3D len' failed. >=20 >=20 >> static void >> vacuum_weak_hash_table (SCM table) >> { >> SCM buckets =3D SCM_HASHTABLE_VECTOR (table); >> unsigned long k =3D SCM_SIMPLE_VECTOR_LENGTH (buckets); >> size_t len =3D SCM_HASHTABLE_N_ITEMS (table); >>=20 >> while (k--) >> { >> size_t removed; >> SCM alist =3D SCM_SIMPLE_VECTOR_REF (buckets, k); >> alist =3D scm_fixup_weak_alist (alist, &removed); <<<**** FAILS = HERE >> assert (removed <=3D len); >> len -=3D removed; >> SCM_SIMPLE_VECTOR_SET (buckets, k, alist); >> } >>=20 >> SCM_SET_HASHTABLE_N_ITEMS (table, len); >> } >>=20 >=20 >=20 > Unfortunately, this problem is infrequent and intermittent. In my = case, it happened in 10 out of 1000 runs. =20 >=20 > Currently, I don't know of a way to reproduce the problem. >=20 >=20 >=20 > On Mar 17, 2011, at 4:43 AM, Andy Wingo wrote: >=20 >> Hi Michael, >>=20 >> Thanks for the report. In the future, please copy bug-guile@gnu.org; = it >> doesn't hurt. >>=20 >> On Thu 17 Mar 2011 00:56, michaelawells = writes: >>=20 >>> hashtab.c:203: weak_bucket_assoc: Assertion `(((scm_t_hashtable *) >>> ((((scm_t_bits) (0? (*(SCM*)0=3D((((SCM *)((scm_t_cell *) = (((scm_t_bits) >>> (0? (*(SCM*)0=3D((((table))))): (((table)))))))) [((2))]))): (((SCM >>> *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=3D((((table))))): >>> (((table)))))))) [((2))]))))))->n_items) >=3D args.removed_items' >>> failed. >>>=20 >>> Did you ever see this assertion fail? =20 >>=20 >> No I didn't, and that bothers me a little. >>=20 >>> I tried using a development snapshot (guile-2.0.0.104-f5fc7). When = I >>> use this snapshot, I do not see this problem. >>=20 >> There were certainly some bugs fixed. Let's assume that it's fixed = in >> git, and in the upcoming 2.0.1 (should be a week or so). There are >> still some lingering issues with weak hash tables, but we are working = on >> them; and certainly no crashes that we know of. >>=20 >> Have fun with Guile, >>=20 >> Andy >> --=20 >> http://wingolog.org/ >=20