Subject: Re: bug#19180: vacuum_weak_hash_table error

From: Linas Vepstas <[email-masked]>
Date: Wed, 3 Dec 2014 22:46:25 +0000 (UTC)

Anand Mohanadoss <anand108 <at> gmail.com> writes:

> 
> Hi,We have observed the following error a few times with guile 2.0.11 
(32-bit) on x86_64 Linux while processing large binary files (1.5GB+) and 
comparing messages contained therein.  fish: hashtab.c:137: 
vacuum_weak_hash_table: Assertion `removed <= len' failed.  

I'm seeing the same bug, intermittently, in a unit test.  The unit test 
creates a dozen c++ threads, tries to enter guile in each, and then tries 
to do racey things. It pounds away at it for 50 seconds, passes, and then 
maybe 1-of-5 times crashes when calling destructors to shut everything 
down, including guile.

fwiw, this is with stock unmodified guile-2.0.9 as shipped with linux mint 
qiana 17 (same as ubuntu 14.04)

I'm attaching a stack trace here.  Ludovic, I will try your patch, might 
take me a few days.

-- Linas

#0  0x00007ffff69a7bb9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff69aafc8 in __GI_abort () at abort.c:89
#2  0x00007ffff69a0a76 in __assert_fail_base (
    fmt=0x7ffff6af2370 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x7ffff50e0482 "removed <= len", 
    file=file@entry=0x7ffff50e0478 "hashtab.c", line=line@entry=137, 
    function=function@entry=0x7ffff50e0ba0 "vacuum_weak_hash_table")
    at assert.c:92
#3  0x00007ffff69a0b22 in __GI___assert_fail (
    assertion=0x7ffff50e0482 "removed <= len", file=0x7ffff50e0478 
"hashtab.c", 
    line=137, function=0x7ffff50e0ba0 "vacuum_weak_hash_table") at 
assert.c:101
#4  0x00007ffff504dd4f in ?? () from /usr/lib/libguile-2.0.so.22
#5  0x00007ffff504de02 in ?? () from /usr/lib/libguile-2.0.so.22
#6  0x00007ffff505056c in scm_c_hook_run () from /usr/lib/libguile-
2.0.so.22
#7  0x00007ffff3dcfc65 in GC_try_to_collect_inner ()
   from /usr/lib/x86_64-linux-gnu/libgc.so.1
#8  0x00007ffff3dcfedc in GC_try_to_collect_general ()
   from /usr/lib/x86_64-linux-gnu/libgc.so.1
#9  0x00007ffff3dcffad in GC_gcollect () from /usr/lib/x86_64-linux-
gnu/libgc.so.1
#10 0x00007ffff50440c9 in scm_gc () from /usr/lib/libguile-2.0.so.22

#11 0x00007ffff76be8c9 in opencog::SchemeEval::c_wrap_finish (p=0x80abe0)
    at /home/linas/src/novamente/src/opencog-
git/opencog/guile/SchemeEval.cc:119
#12 0x00007ffff502d2ca in ?? () from /usr/lib/libguile-2.0.so.22
#13 0x00007ffff50bec00 in ?? () from /usr/lib/libguile-2.0.so.22
#14 0x00007ffff5036863 in scm_call_4 () from /usr/lib/libguile-2.0.so.22
#15 0x00007ffff502d9ff in ?? () from /usr/lib/libguile-2.0.so.22
#16 0x00007ffff502da95 in scm_c_with_continuation_barrier ()
   from /usr/lib/libguile-2.0.so.22
#17 0x00007ffff3ddf950 in GC_call_with_gc_active ()
   from /usr/lib/x86_64-linux-gnu/libgc.so.1
#18 0x00007ffff50a67d1 in ?? () from /usr/lib/libguile-2.0.so.22
#19 0x00007ffff3dd9fe2 in GC_call_with_stack_base ()
   from /usr/lib/x86_64-linux-gnu/libgc.so.1
#20 0x00007ffff50a6b48 in scm_with_guile () from /usr/lib/libguile-
2.0.so.22
#21 0x00007ffff76be568 in opencog::SchemeEval::~SchemeEval (this=0x80abe0, 
    __in_chrg=<optimized out>)
    at /home/linas/src/novamente/src/opencog-
git/opencog/guile/SchemeEval.cc:273