Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Konrad Hinsen <konrad.hinsen-97jfqw80gc7k1uMJSBkQmQ <at> public.gmane.org>
Subject: Crash with Python bindings
Newsgroups: gmane.mail.notmuch.general
Date: Tuesday 12th January 2016 09:41:57 UTC (about 1 year ago)
Hi everyone,

I have been writing quite a few Python scripts for notmuch before 
running into a strange bug. Here is a minimal script producing it:

--------------------------------------------------
from notmuch import Query, Database

def foo(bar):
     pass

db = Database()
q = Query(db, "*")
db.close()
--------------------------------------------------

Running this script (Python 3.5, MacOS X) yields:

[1]    22478 abort      pydev3 Temp/notmuch_test.py

The crash actually happens *after* db.close(), when the Python 
interpreter exists, and therefore I suspect that no data is lost, but I 
hesitate to use scripts with that behavior in production use.

The strange part is that what causes the crash is the presence of the 
function foo(), even though it is never called. Remove foo and the 
script runs fine. It is also necessary to create a Query object. The 
combination of a function definition (any) and the creation of a Query 
object yields the crash. This looks like a memory management issue, but 
I didn't explore it any further.

Cheers,
   Konrad.
_______________________________________________
notmuch mailing list
[email protected]
https://notmuchmail.org/mailman/listinfo/notmuch
 
CD: 3ms