Ticket #168 (closed defect: released)

Opened 19 months ago

Last modified 19 months ago

Possible thread related problem with Xapian bindings

Reported by: richard Owned by: richard
Priority: normal Milestone:
Component: Xapian-bindings Version: SVN trunk
Severity: normal Keywords:
Cc: sidnei, mhammond Blocked By:
Operating System: All Blocking:

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

threadtest.py (2.2 kB) - added by richard 19 months ago.
Sample script demonstrating the failure

Change History

Changed 19 months ago by richard

Sample script demonstrating the failure

Changed 19 months ago by sidnei

  • cc sidnei@… added

Changed 19 months ago by sidnei

  • cc mhammond@… added

Changed 19 months ago by richard

  • status changed from new to closed
  • resolution set to fixed

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.

Changed 19 months ago by richard

  • resolution changed from fixed to released

Fix is in upcoming 1.0.2 release.

Changed 19 months ago by trac

  • platform set to All
Note: See TracTickets for help on using tickets.