Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#168 closed defect (released)

Possible thread related problem with Xapian bindings

Reported by: Richard Boulton Owned by: Richard Boulton
Priority: normal Milestone:
Component: Xapian-bindings Version: SVN trunk
Severity: normal Keywords:
Cc: Sidnei da Silva, Mark Hammond Blocked By:
Blocking: Operating System: All

Description

I have a test case which repeatedly tries to open (the same) xapian database from multiple threads, checking for thread related problems. It usually fails with a segmentation fault. Occasionally, this failure is preceded by an error message stating "Fatal Python error: GC object already tracked". Occasionally, it completes successfully.

Attachments (1)

threadtest.py (2.2 KB ) - added by Richard Boulton 18 years ago.
Sample script demonstrating the failure

Download all attachments as: .zip

Change History (5)

by Richard Boulton, 18 years ago

Attachment: threadtest.py added

Sample script demonstrating the failure

comment:1 by Sidnei da Silva, 18 years ago

Cc: sidnei@… added

comment:2 by Sidnei da Silva, 18 years ago

Cc: mhammond@… added

comment:3 by Richard Boulton, 18 years ago

Resolution: fixed
Status: newclosed

I believe that this is fixed in revision 8920. There was a problem in the Python bindings - specifically, the GIL was not being re-acquired when an exception was thrown before setting the Python exception state. This was causing various memory corruption symptoms. Fixed by explicitly calling SWIG_PYTHON_THREAD_END_ALLOW() in the catch() clause (except for directory classes); this is a bit ugly, but I can't see how SWIG could be fixed to do this automatically, since it doesn't know what's going on in the "exception" clause.

comment:4 by Richard Boulton, 17 years ago

Operating System: All
Resolution: fixedreleased

Fix is in upcoming 1.0.2 release.

Note: See TracTickets for help on using tickets.