Project

General

Profile

Bug #1709

Segv in API

Added by Rogers, Chris about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Python API
Target version:
Start date:
13 July 2015
Due date:
% Done:

100%

Estimated time:
Workflow:
New Issue

Description

I think that the container for the Data object has its reference count decremented to 0 by the call to TPyReturn in the code snippet below, even though references still existed in the python code. Valgrind is no use because the bug was caused by python reading a deleted block of PyROOT's memory. This can cause a segmentation fault. Applying the patch (insert line marked with +) fixes the issue. I am trying to push various bits and pieces at the moment, let's see if I can bring this one across as well.

=== modified file 'src/py_cpp/PyConverter.cc'
--- src/py_cpp/PyConverter.cc   2015-05-12 13:08:46 +0000
+++ src/py_cpp/PyConverter.cc   2015-07-10 08:52:42 +0000
@@ -89,6 +89,7 @@
     if (c_string == NULL || strcmp(c_string, "MAUS::Data") != 0) {
         PyErr_SetString(PyExc_TypeError, "Could not resolve object as a MAUS::Data type");
     }
+    py_data_in->ob_refcnt++;
     void * vptr = static_cast<void*>(TPyReturn(py_data_in));
     Data* data = static_cast<Data*>(vptr);
     delete data;
#1

Updated by Rogers, Chris about 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Should be fixed in latest merge revision 889

#2

Updated by Rajaram, Durga about 6 years ago

  • Target version changed from Future MAUS release to MAUS-v1.0.0

Also available in: Atom PDF