unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* Re: possible gc/weak hash table bug
@ 2011-03-25 21:48 michaelawells
  2011-03-26  1:15 ` michaelawells
  2011-04-28  9:52 ` Andy Wingo
  0 siblings, 2 replies; 7+ messages in thread
From: michaelawells @ 2011-03-25 21:48 UTC (permalink / raw)
  To: Andy Wingo, bug-guile

[-- Attachment #1: Type: text/plain, Size: 1741 bytes --]

> On Fri 18 Mar 2011 12:51, address@hidden (Ludovic CourtÃs) writes:
> 
> > michaelawells <address@hidden> writes:
> >
> >>>   size_t len = SCM_HASHTABLE_N_ITEMS (table);
> >>> 
> >>>   while (k--)
> >>>     {
> >>>       size_t removed;
> >>>       SCM alist = SCM_SIMPLE_VECTOR_REF (buckets, k);
> >>>       alist = scm_fixup_weak_alist (alist, &removed);  <<<**** FAILS HERE
> >>>       assert (removed <= len);
> >
> > Andy, isnât this assertion bogus since N_ITEMS is updated lazily and
> > thus may not correspond to the current number of items?
> 
> I don't think so; this is the procedure that is doing that lazy sweep.
> 
> Michael, how are you using this hash table?  Are you accessing it from
> different pthreads?  What version of libgc are you using?  (Did you
> enable parallel collection?)
Sorry, the "<<<*** FAILS here" note should have been placed after the assert, not the call to "scm_fixup_weak_alist".

I'm not using weak hash tables in my code.   Weak hash tables are used in modules such as (ice-9 boot-9) and (ice-9 popen), and from C code, such as libguile/symbols.c.  

I'm using gc-7.1.  I didn't use any special options when building libgc.  I'll try rebuilding libgc using the "--enable-threads=posix" configure option and see if I still see the problem.  (Is that what you meant by enabling parallel collection?  If so, perhaps the README file should updated to say this is necessary.)

I'm not using guile from multiple threads, but I am running guile from a thread in a multi-threaded program.  (I've been using guile since before it had support for multiple threads.  So, I constructed the test harness so that guile is called from a single thread.)

Thanks,

Michael Wells


[-- Attachment #2: Type: text/html, Size: 2329 bytes --]

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

end of thread, other threads:[~2011-04-28  9:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <A7D64DB3-0467-49D7-9D4E-6E9634782F90@gmail.com>
     [not found] ` <m3mxku13rd.fsf@unquote.localdomain>
2011-03-18  0:09   ` possible gc/weak hash table bug michaelawells
2011-03-18  3:31     ` michaelawells
2011-03-18 11:51     ` Ludovic Courtès
2011-03-25  9:23       ` Andy Wingo
2011-03-25 21:48 michaelawells
2011-03-26  1:15 ` michaelawells
2011-04-28  9:52 ` Andy Wingo

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).