Dear Ludovic,
Given your recommendation to use the 'stable-2.0' branch, we tried to create a fix for the issue with our limited knowledge (assuming that the size of the hash is getting corrupted by multiple threads). The process ran to completion, but, we got different results compared to what we get with threading disabled. So, it didn't really help and our assumption appears to be incorrect. Is there something else we can try, to help you with creating a proper patch for this issue?
Here is what we changed in hashtab.c -
130a131
> size_t orig_len = len;
137,138c138,144
< assert (removed <= len);
< len -= removed;
---
> if (removed <= len)
> len -= removed;
> else
> {
> printf ("Vacuum weak hash table assert Table=%p len=%zi removed=%zi orig_len=%zi n_items=%zi\n", table, len, removed, orig_len, SCM_HASHTABLE_N_ITEMS (table));
> len = 0;
> }
With this change, we got lines similar to the following printed periodically -
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=2 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=2 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=3 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=2 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=4 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=2 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2321 n_items=2321
......
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=205 n_items=205
.......
Vacuum weak hash table assert Table=0x9bdb840 len=1 removed=2 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=2 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274
Vacuum weak hash table assert Table=0x9bdb840 len=0 removed=1 orig_len=2274 n_items=2274