Project

Profile

Help

Bug #4351

Updated by O'Neil Delpratt about 5 years ago

Reported by user in the forum post: 

 https://saxonica.plan.io/boards/4/topics/7621 

 Python script: 

 ~~~ python 
 import saxonc 

 s1 = 'This is a test.' 

 with saxonc.PySaxonProcessor(license=False) as proc: 
     print(proc.version) 

     xdm_string_value = proc.make_string_value(s1) 

     print(xdm_string_value) 

     xpath_processor = proc.new_xpath_processor() 

     xpath_processor.set_parameter('s1', xdm_string_value) 

     result = xpath_processor.evaluate('$s1') 

     print(result) 

     print(result.get_atomic_value().string_value) 
 ~~~ 


 I ran the same sample python script under linux with gdb command: 

 ~~~ 
 Thread 1 "python3" received signal SIGSEGV, Segmentation fault. 
 0x00007ffff005117d in ?? () from /usr/lib//libsaxoneec.so 
 (gdb) bt 
 #0    0x00007ffff005117d in ?? () from /usr/lib//libsaxoneec.so 
 #1    0x00007ffaf5906341 in ?? () 
 #2    0x00007ffaf5906341 in ?? () 
 #3    0x00007ffff69c4308 in SaxonProcessor::refCount () 
    from /home/ond1/work/svn/latest9.9-saxonc/Saxon.C.API/python-saxon/saxonc.cpython-35m-x86_64-linux-gnu.so 
 #4    0x00007ffff6799490 in JNIEnv_::GetArrayLength (array=0x0, this=<optimised out>) at ../jni/jni.h:1624 
 #5    XPathProcessor::evaluate (this=0x1150d30, xpathStr=0x7ffff7eab8c0 "$s1") at ../XPathProcessor.cpp:92 
 #6    0x00007ffff675614e in __pyx_pf_6saxonc_16PyXPathProcessor_6evaluate (__pyx_v_self=<optimised out>,  
     __pyx_v_xpath_str=<optimised out>) at saxonc.cpp:25091 
 #7    __pyx_pw_6saxonc_16PyXPathProcessor_7evaluate (__pyx_v_self=<optimised out>, __pyx_v_xpath_str=<optimised out>) 
     at saxonc.cpp:25007 
 #8    0x000000000053b486 in PyEval_EvalFrameEx () 
 #9    0x000000000053fc97 in ?? () 
 #10 0x00000000005409bf in PyEval_EvalCode () 
 #11 0x000000000060cb42 in ?? () 
 #12 0x000000000060efea in PyRun_FileExFlags () 
 #13 0x000000000060f7dc in PyRun_SimpleFileExFlags () 
 #14 0x0000000000640256 in Py_Main () 
 #15 0x00000000004d0001 in main () 
 ~~~ 

 There seems to be a memory handling issue. Investigating now.

Back