unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [bug #29616] Hang waiting for the GC lock while traversing a weak hash table [1.9.10]
@ 2010-04-20  9:02 Ludovic Courtès
  2010-04-20  9:06 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2010-04-20  9:02 UTC (permalink / raw)
  To: Ludovic Courtès, bug-guile


URL:
  <http://savannah.gnu.org/bugs/?29616>

                 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=<value optimized
out>, 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=<value optimized out>,
func_name=<value optimized out>)
    at hashtab.c:240
#6  0x00007fada3c9f0f0 in vm_debug_engine (vm=<value optimized out>,
program=0x0, argv=<value optimized out>, 
    nargs=<value optimized out>) at vm-i-system.c:856
#7  0x00007fada3c37e26 in scm_c_run_hookn (hook=<value optimized out>,
argv=0x7fff6703dc90, nargs=1) at hooks.c:285
#8  0x00007fada3c95f0b in vm_dispatch_hook (vm=<value optimized out>,
hook_num=<value optimized out>) at vm.c:210
#9  0x00007fada3ca1ae2 in vm_debug_engine (vm=<value optimized out>,
program=0x356c8280, argv=<value optimized out>, 
    nargs=<value optimized out>) at vm-i-system.c:781
#10 0x00007fada3c24f59 in scm_call_2 (proc=0x356c8180, arg1=<value optimized
out>, arg2=<value optimized out>)
    at eval.c:580
#11 0x00007fada3c35575 in do_weak_bucket_assoc (data=<value optimized out>)
at hashtab.c:170
#12 0x00007fada350b271 in GC_call_with_alloc_lock (fn=0x7fada3c35540
<do_weak_bucket_assoc>, 
    client_data=0x7fff6703de50) at finalize.c:925
#13 0x00007fada3c3691a in weak_bucket_assoc (table=0x356c8580, buckets=<value
optimized out>, bucket_index=0, 
    hash_fn=0xffffffffffffffff, assoc=0x7fada3732300 <GC_allocate_ml>,
object=0xe8c, closure=0x7fff6703df20)
    at hashtab.c:201
#14 0x00007fada3c36ae5 in scm_hash_fn_get_handle (table=0x356c8580,
obj=0x358b2f60, 
    hash_fn=0x7fada3c36670 <scm_ihashx>, assoc_fn=0x7fada3c36630
<scm_sloppy_assx>, closure=0x7fff6703df20)
    at hashtab.c:503
#15 0x00007fada3c36baf in scm_hashx_get_handle (hash=0xfffffffffffffe00,
assoc=<value optimized out>, 
    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:

  <http://savannah.gnu.org/bugs/?29616>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug #29616] Hang waiting for the GC lock while traversing a weak hash table [1.9.10]
  2010-04-20  9:02 [bug #29616] Hang waiting for the GC lock while traversing a weak hash table [1.9.10] Ludovic Courtès
@ 2010-04-20  9:06 ` Ludovic Courtès
  2010-04-20 11:42   ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2010-04-20  9:06 UTC (permalink / raw)
  To: Ludovic Courtès, bug-guile


Follow-up Comment #1, bug #29616 (project guile):

This should read "the `assoc' and `hash' functions can be user-defined".

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29616>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug #29616] Hang waiting for the GC lock while traversing a weak hash table [1.9.10]
  2010-04-20  9:06 ` Ludovic Courtès
@ 2010-04-20 11:42   ` Ludovic Courtès
  2010-10-11 17:01     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2010-04-20 11:42 UTC (permalink / raw)
  To: Ludovic Courtès, bug-guile


Follow-up Comment #2, bug #29616 (project guile):

For the record, (ice-9 poe) uses this idiom (weak hash table with custom
`assoc' and `hash' functions.)

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29616>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug #29616] Hang waiting for the GC lock while traversing a weak hash table [1.9.10]
  2010-04-20 11:42   ` Ludovic Courtès
@ 2010-10-11 17:01     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2010-10-11 17:01 UTC (permalink / raw)
  To: Ludovic Courtès, bug-guile


Update of bug #29616 (project guile):

                  Status:                    None => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #3:

Fixed by commit e9bac3be613f549b932d58913307ae18c89b9ffe.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29616>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-11 17:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-20  9:02 [bug #29616] Hang waiting for the GC lock while traversing a weak hash table [1.9.10] Ludovic Courtès
2010-04-20  9:06 ` Ludovic Courtès
2010-04-20 11:42   ` Ludovic Courtès
2010-10-11 17:01     ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).