use after free in python notmuch2 bindings

Subject:use after free in python notmuch2 bindings

Date:Sun, 02 Jan 2022 09:51:55 -0400

To:notmuch@notmuchmail.org

Cc:

From:David Bremner


I've been attempting to port nmweb to the new bindings, but I got stuck
on a bug that segfaults python. I attached a reduced version that
reproduces the problem for me. It uses recent messages from the notmuch
list; it others can't reproduce let me know and I will try to make
something more self contained including a message set.

It's a bit tricky to get ASAN working but I managed with

% env ASAN_OPTIONS=alloc_dealloc_mismatch=0 LD_PRELOAD="libasan.so.6 libstdc++.so.6" LD_LIBRARY_PATH=../../lib python3 ~/test.py

You can see in the attached output that one of the notmuch messages
structs is used after being freed. I suspect it has something to do with
the iterator code in the bindings, but I have not examined it in detail.

asan.out (application/octet-stream)
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: