From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#19180: vacuum_weak_hash_table error Date: Tue, 02 Dec 2014 20:47:22 +0100 Message-ID: <87zjb5bzqt.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1417549715 2625 80.91.229.3 (2 Dec 2014 19:48:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Dec 2014 19:48:35 +0000 (UTC) Cc: 19180@debbugs.gnu.org To: Anand Mohanadoss Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Dec 02 20:48:27 2014 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XvtQu-0005ba-Ty for guile-bugs@m.gmane.org; Tue, 02 Dec 2014 20:48:25 +0100 Original-Received: from localhost ([::1]:38592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvtQu-0002iu-Ic for guile-bugs@m.gmane.org; Tue, 02 Dec 2014 14:48:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvtQj-0002ie-B5 for bug-guile@gnu.org; Tue, 02 Dec 2014 14:48:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvtQY-00083h-Tn for bug-guile@gnu.org; Tue, 02 Dec 2014 14:48:13 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvtQY-00083T-QA for bug-guile@gnu.org; Tue, 02 Dec 2014 14:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XvtQY-0006na-B3 for bug-guile@gnu.org; Tue, 02 Dec 2014 14:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 02 Dec 2014 19:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19180 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 19180-submit@debbugs.gnu.org id=B19180.141754965026092 (code B ref 19180); Tue, 02 Dec 2014 19:48:02 +0000 Original-Received: (at 19180) by debbugs.gnu.org; 2 Dec 2014 19:47:30 +0000 Original-Received: from localhost ([127.0.0.1]:52069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XvtQ1-0006ml-QF for submit@debbugs.gnu.org; Tue, 02 Dec 2014 14:47:30 -0500 Original-Received: from hera.aquilenet.fr ([141.255.128.1]:37929) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XvtPx-0006mb-Tv for 19180@debbugs.gnu.org; Tue, 02 Dec 2014 14:47:27 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 5F38D40FC; Tue, 2 Dec 2014 20:47:24 +0100 (CET) Original-Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pZ0bICYYCX2I; Tue, 2 Dec 2014 20:47:24 +0100 (CET) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id F1C90151A; Tue, 2 Dec 2014 20:47:23 +0100 (CET) In-Reply-To: (Anand Mohanadoss's message of "Tue, 25 Nov 2014 16:53:28 +0530") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7656 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Anand Mohanadoss skribis: > #4 0x003b8e96 in __assert_fail () from /lib/libc.so.6 > #5 0x080e93d7 in vacuum_weak_hash_table (table=3D0x97f8b10) at hashtab.c= :137 > #6 0x080e9857 in weak_gc_callback (hook_data=3D0x0, fn_data=3D0x6, data= =3D0x0) > at hashtab.c:437 > #7 weak_gc_hook (hook_data=3D0x0, fn_data=3D0x6, data=3D0x0) at hashtab.= c:446 > #8 0x080eaa2d in scm_c_hook_run (hook=3D0x895acc0, data=3D0x0) at hooks.= c:103 > #9 0x080dfda6 in run_before_gc_c_hook () at gc.c:240 > #10 0x08187719 in GC_notify_full_gc (stop_func=3D0x81868e0 > ) at alloc.c:334 > #11 GC_try_to_collect_inner (stop_func=3D0x81868e0 ) = at > alloc.c:429 > #12 0x08187d1b in GC_collect_or_expand (needed_blocks=3D4, ignore_off_pag= e=3D0, > retry=3D0) at alloc.c:1242 > #13 0x0818a64f in GC_alloc_large (lb=3D14080, k=3D1, flags=3D0) at malloc= .c:63 > #14 0x0818a9c2 in GC_generic_malloc (lb=3D14076, k=3D1) at malloc.c:175 > #15 0x0818ace7 in GC_core_malloc (lb=3D14076) at malloc.c:263 > #16 0x080df572 in do_gc_malloc (size=3D0, what=3D0x6
bounds>) at gc-malloc.c:100 > #17 0x0813a565 in scm_c_make_vector (k=3D3517, fill=3D0x304) at vectors.c= :408 > #18 0x080e9471 in scm_i_rehash (table=3D0x97f8b10, hash_fn=3D0x816c1d0 > , closure=3D0x0, func_name=3D0x854f8bd > "scm_hash_fn_create_handle_x") at hashtab.c:344 Looking at this stack trace, it seems =E2=80=98table=E2=80=99 is being conc= urrently modified: a GC occurs while it is being rehashed. Could you apply with attached patch (with =E2=80=9Cpatch -p1 < the-patch=E2= =80=9D run from the top of the source tree), and report the lines that are printed before the assertion failure? Also, please report the corresponding backtrace, as you did above (just to make sure this is the same scenario.) Thanks in advance, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/libguile/hashtab.c b/libguile/hashtab.c index 44db051..8e7c9bc 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -1,5 +1,5 @@ /* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2003, 2004, 2006, - * 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + * 2008, 2009, 2010, 2011, 2012, 2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -134,6 +134,7 @@ vacuum_weak_hash_table (SCM table) size_t removed; SCM alist = SCM_SIMPLE_VECTOR_REF (buckets, k); alist = scm_fixup_weak_alist (alist, &removed); + printf ("%i %p l=%zi r=%zi\n", __LINE__, table, len, removed); assert (removed <= len); len -= removed; SCM_SIMPLE_VECTOR_SET (buckets, k, alist); @@ -341,7 +342,9 @@ scm_i_rehash (SCM table, SCM_HASHTABLE (table)->upper = 9 * new_size / 10; buckets = SCM_HASHTABLE_VECTOR (table); + printf ("%i %p l=%zi\n", __LINE__, table, SCM_HASHTABLE_N_ITEMS (table)); new_buckets = scm_c_make_vector (new_size, SCM_EOL); + printf ("%i %p l=%zi\n", __LINE__, table, SCM_HASHTABLE_N_ITEMS (table)); /* When this is a weak hashtable, running the GC might change it. We need to cope with this while rehashing its elements. We do --=-=-=--