segmentation fault while using ctypes

sanket sanket.s.patel at gmail.com
Tue Apr 14 19:05:18 EDT 2009


On Apr 14, 3:56 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> sanket schrieb:
>
> > Hello All,
>
> > I am dealing with this weird bug.
> > I have a function in C and I have written python bindings for it using
> > ctypes.
>
> > I can call this function for couple of times and then suddenly it
> > gives me seg fault.
> > But I can call same function from a C code for any number of times.
>
> > I cannot get what's going on.
>
> Try debugging it. While a python debug-build might help, I have been
> getting good results with a simple
>
> # gdb python
> $ set args testscript.py
> $ run
>
> then when the segfaults hit, get a backtrace. You can also of course set
> a berakpoint to the function in question.
>
> Diez

Thanks Diez,

I used the gdb but it just crashed and kicked my out of gdb prompt.
how can I get a stack trace?

Thanks,
sanket



More information about the Python-list mailing list