Apr 21, 2011, 9:20:04 PM (10 years ago)

In mark_memoized_area() on all platforms, don't do any special
processing of weak-on-value hash vectors. (This means that otherwise
unreferenced values in weak-on-value hash tables will only be free
on a full GC.) This seems to fix (at least the symptom of) ticket:817,
or at least allows my test case to run to completion.

The real problem is that sometimes those weak-on-value hash vectors
aren't on GCweakvll; if we don't mark the values in the weak vector
in mark_memoized_area(), nothing deletes unmarked values from the
hash table (or otherwise completes weak processing.) I was unable
to determine why the vectors were sometimes missing from the list;
not dropping them in init_weakvll() didn't seem to fix anything.

One approach to fixing the real problem is to say:

  • we somehow ensure that tenured weak-on-value hash vectors always have refbits set for their headers.
  • on entry to the GC, GCweakvll is empty (or at least contains no hash vectors).
  • mark_memoized_area does weak processing of all tenured weak hash vectors. If it finds that the vector contains intergenerational references to weak elements, it pushes the vector on GCweakvll.
  • if lisp_global(WEAKVLL) and init_weakvll() need to continue to exist, that's only so that weak list headers can be preprocessed. It'd be nice to think of a way of doing that preprocessing via other means.
1 edited


  • trunk/source/lisp-kernel/ppc-gc.c

    r14197 r14723  
    929929     Some headers are "interesting", to the forwarder if not to us.
    931      */
     931  */
    933933  /*
    937937    a time and doing a cntlzw instruction; and don't want to have to
    938938    check for (< memo_dnode num_memo_dnodes) in the loop.
    939     */
     939  */
    941941  {
    10041004        if (hashp) Bug(NULL, "header inside hash vector?");
    10051005        hash_table_vector_header *hp = (hash_table_vector_header *)(p - 2);
    1006         if (hp->flags & nhash_weak_mask) {
    1007           /* If header_count is odd, this cuts off the last header field */
    1008           /* That case is handled specially above */
    1009           hash_dnode_limit = memo_dnode + ((hash_table_vector_header_count) >>1);
    1010           hashp = hp;
    1011           mark_method = 3;
     1006        /* Workaround for ticket:817 */
     1007        if (!(hp->flags & nhash_weak_value_mask)) {
     1008          if (hp->flags & nhash_weak_mask) {
     1009            /* If header_count is odd, this cuts off the last header field */
     1010            /* That case is handled specially above */
     1011            hash_dnode_limit = memo_dnode + ((hash_table_vector_header_count) >>1);
     1012            hashp = hp;
     1013            mark_method = 3;
     1014          }
    10121015        }
    10131016      }
Note: See TracChangeset for help on using the changeset viewer.