Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9007

PyROOT segfault in MethodProxy.cxx for ROOT 6.10/02

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • High
    • Resolution: Fixed
    • 6.10/02
    • 6.12/00, 6.10/08
    • PyROOT
    • None
    • GNU/Linux x86_64

    Description

      I'm somehow segfaulting at line 217 in MethodProxy.cxx below. methods.size() must be 0 in this case. Maybe a dummy empty string should be returned if methods is empty? I'm trying to trace down exactly which _doc_ is being accessed. In generating rootpy's docs the system automatically scrapes _doc_ from all required ROOT classes/methods and fails here. It didn't fail previously with older ROOT versions so something related to _doc_ in PyROOT must have changed.

      208 ////////////////////////////////////////////////////////////////////////////////
      209 /// Build python document string ('__doc__') from all C++-side overloads.       
      210                                                                                 
      211    PyObject* mp_doc( MethodProxy* pymeth, void* )                               
      212    {                                                                            
      213       MethodProxy::Methods_t& methods = pymeth->fMethodInfo->fMethods;          
      214                                                                                 
      215    // collect doc strings                                                       
      216       Int_t nMethods = methods.size();                                          
      217       PyObject* doc = methods[0]->GetDocString();                               
      218                                                                                 
      219    // simple case                                                               
      220       if ( nMethods == 1 )                                                      
      221          return doc;                                                            
      222                                                                                 
      223    // overloaded method                                                         
      224       PyObject* separator = PyROOT_PyUnicode_FromString( "\n" );                
      225       for ( Int_t i = 1; i < nMethods; ++i ) {                                  
      226          PyROOT_PyUnicode_Append( &doc, separator );                            
      227          PyROOT_PyUnicode_AppendAndDel( &doc, methods[i]->GetDocString() );     
      228       }                                                                         
      229       Py_DECREF( separator );                                                   
      230                                                                                 
      231       return doc;                                                               
      232    }

      Attachments

        Activity

          People

            mato Pere Mato Vila
            end Noel Dawe (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Actual End: