[PATCH 2/2] python: annotate all calls into libnotmuch with types
David Bremner
david at tethera.net
Fri Jan 24 17:40:48 PST 2014
Justus Winter <4winter at informatik.uni-hamburg.de> writes:
> #0 0x00007f996ad021d5 in __GI_raise (sig=sig at entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> (gdb) bt
> #0 0x00007f996ad021d5 in __GI_raise (sig=sig at entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1 0x00007f996ad05388 in __GI_abort () at abort.c:90
> #2 0x00007f99699d4486 in talloc_abort (reason=0x7f99699db648 "Bad talloc magic value - access after free") at ../talloc.c:317
> #3 0x00007f99699d8097 in talloc_abort_access_after_free () at ../talloc.c:336
> This is a bit contrived b/c I'm destroying the db object by
> hand. Never the less libnotmuch calls abort, and there is no way to
> contain something like this in the python bindings.
FWIW libnotmuch is not directly calling abort here, talloc is, because
it is detecting illegal memory access patterns. So there could well be a
libnotmuch bug here, but it isn't really related to error handling.
As far as I can tell, the underlying reason for the crash is that that
talloc is a hierarchical memory allocator, and the directory is a child
of the database. This "ownership" should probably be documented in the
header for notmuch_database_get_directory. This won't fix your crash, of
course ;).
d
More information about the notmuch
mailing list