From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Newsgroups: gmane.lisp.guile.bugs Subject: [bug #29616] Hang waiting for the GC lock while traversing a weak hash table [1.9.10] Date: Tue, 20 Apr 2010 09:02:08 +0000 Message-ID: <20100420-090208.sv15145.82198@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Trace: dough.gmane.org 1271754183 20359 80.91.229.12 (20 Apr 2010 09:03:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Apr 2010 09:03:03 +0000 (UTC) To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Apr 20 11:02:56 2010 connect(): No such file or directory 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 1O49M7-0005z8-9C for guile-bugs@m.gmane.org; Tue, 20 Apr 2010 11:02:55 +0200 Original-Received: from localhost ([127.0.0.1]:52407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O49M6-0003Ax-U0 for guile-bugs@m.gmane.org; Tue, 20 Apr 2010 05:02:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O49LS-00034s-Sw for bug-guile@gnu.org; Tue, 20 Apr 2010 05:02:14 -0400 Original-Received: from [140.186.70.92] (port=39052 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O49LQ-00034e-2V for bug-guile@gnu.org; Tue, 20 Apr 2010 05:02:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O49LO-0005Ib-LS for bug-guile@gnu.org; Tue, 20 Apr 2010 05:02:11 -0400 Original-Received: from colonialone.fsf.org ([140.186.70.51]:59730 helo=internal.in.savannah.gnu.org) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O49LN-0005I8-55; Tue, 20 Apr 2010 05:02:09 -0400 Original-Received: from [10.1.0.103] (helo=frontend.in.savannah.gnu.org) by internal.in.savannah.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O49LM-0006cl-QY; Tue, 20 Apr 2010 09:02:08 +0000 Original-Received: from www-data by frontend.in.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1O49LM-0001zJ-O3; Tue, 20 Apr 2010 09:02:08 +0000 X-Savane-Server: savannah.gnu.org:443 [10.1.0.103] X-Savane-Project: guile X-Savane-Tracker: bugs X-Savane-Item-ID: 29616 User-Agent: Mozilla/5.0 (GNU; rv:1.9.1.7) Gecko/20100107 IceCat/3.6 (like Firefox/3.6) X-Apparently-From: 147.210.128.170 (Savane authenticated user civodul) Original-References: In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:4584 Archived-At: URL: Summary: Hang waiting for the GC lock while traversing a weak hash table [1.9.10] Project: Guile Submitted by: civodul Submitted on: Tue 20 Apr 2010 09:02:07 AM GMT Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: Buckets of weak hash tables are traversed with the GC allocation lock held. However, the `assoc' and `hash' function can be used defined and they can be Scheme procedures. When these Scheme procedures invoke the GC, they hang waiting for the allocation lock: #v+ #0 0x00007fada32eb114 in __lll_lock_wait () from /nix/store/4jl83jgzaacf519h3wczgbjvqi91hfk6-glibc-2.11.1/lib/libpthread.so.0 #1 0x00007fada32e6349 in _L_lock_1004 () from /nix/store/4jl83jgzaacf519h3wczgbjvqi91hfk6-glibc-2.11.1/lib/libpthread.so.0 #2 0x00007fada32e615e in pthread_mutex_lock () from /nix/store/4jl83jgzaacf519h3wczgbjvqi91hfk6-glibc-2.11.1/lib/libpthread.so.0 #3 0x00007fada350eea9 in GC_generic_malloc_many (lb=48, k=, result=0x7fada3732bc0) at mallocx.c:284 #4 0x00007fada3517fd8 in GC_malloc_atomic (bytes=48) at thread_local_alloc.c:195 #5 0x00007fada3c37465 in make_hash_table (flags=0, k=, func_name=) at hashtab.c:240 #6 0x00007fada3c9f0f0 in vm_debug_engine (vm=, program=0x0, argv=, nargs=) at vm-i-system.c:856 #7 0x00007fada3c37e26 in scm_c_run_hookn (hook=, argv=0x7fff6703dc90, nargs=1) at hooks.c:285 #8 0x00007fada3c95f0b in vm_dispatch_hook (vm=, hook_num=) at vm.c:210 #9 0x00007fada3ca1ae2 in vm_debug_engine (vm=, program=0x356c8280, argv=, nargs=) at vm-i-system.c:781 #10 0x00007fada3c24f59 in scm_call_2 (proc=0x356c8180, arg1=, arg2=) at eval.c:580 #11 0x00007fada3c35575 in do_weak_bucket_assoc (data=) at hashtab.c:170 #12 0x00007fada350b271 in GC_call_with_alloc_lock (fn=0x7fada3c35540 , client_data=0x7fff6703de50) at finalize.c:925 #13 0x00007fada3c3691a in weak_bucket_assoc (table=0x356c8580, buckets=, bucket_index=0, hash_fn=0xffffffffffffffff, assoc=0x7fada3732300 , object=0xe8c, closure=0x7fff6703df20) at hashtab.c:201 #14 0x00007fada3c36ae5 in scm_hash_fn_get_handle (table=0x356c8580, obj=0x358b2f60, hash_fn=0x7fada3c36670 , assoc_fn=0x7fada3c36630 , closure=0x7fff6703df20) at hashtab.c:503 #15 0x00007fada3c36baf in scm_hashx_get_handle (hash=0xfffffffffffffe00, assoc=, table=0x7fada3732300, key=0x80) at hashtab.c:974 #v- Reproduce with: #v+ scheme@(guile-user)> (define t (make-doubly-weak-hash-table 12)) scheme@(guile-user)> (hashx-ref (lambda (obj n) (gc) (hash obj n)) (lambda (obj alist) (gc) (assoc obj alist)) t 'foo) #v- Ludo'. _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/