Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Python

Segmentation fault with Py_Finalize()

 
Jump to:  
 
Gal Aviel
PostPosted: Sun Aug 10, 2008 8:08 am    Post subject: Segmentation fault with Py_Finalize()
       
Hello All,

I Need some tips/help/ideas debugging segmentation fault ...

I'm trying to debug Python running embedded inside a Verilog
Simulator (as a SystemVerilog DPI application). (on SUSE LINUX
Enterprise Server 9 (i586))

The Embedded python loads two SWIG wrapped modules (written in C and C++).

All goes well until finally I try to destroy the interpreter using
Py_Finalize(). Seems like Python's garbage collection is trying to
free something it's not suppose to free (thinks it owns it
but has been freed already? Python/SWIG ownership issues?)

MY question: how can tell the name of the object that visit_decref()
below is trying to free? or at least, when/where it was allocated
in my code?

I'm not really a Software guy, but I have TotalView Enterprise
at my disposal and I noticed it has memory debugging capabilities.

Can I somehow know when the pointer/object that is trying to be freed was
allocated and where? what it is?

Many many thanks in advance,

Gal.

The details..

The stack trace:

Stack Trace
C visit_decref, FP=bfff9258
C dict_traverse, FP=bfff9298
C collect, FP=bfff9368
C PyGC_Collect, FP=bfff9378
C Py_Finalize, FP=bfff9398
C destroy_python, FP=bfff93b8


The stack frame for visit_decref():

Stack Frame
Function "dict_traverse":
op: 0x50de3934 (Allocated Interior) -> (PyObject)
visit: 0x4e81a600 : visit_decref
arg: 0x00000000
Block "$b1":
vret (%eax): 0x00000000 (0)
Local variables:
i: 0x00000001 (1)
pk: 0x5092e320 (Allocated Interior) -> (PyObject)
pv: 0x094dfc98 (Allocated Interior) -> (PyObject)
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Baterie do kuchni geze gadżety sztuka starożytna grecja