Re: ctypes stack corruption

Diez Roggisch <[email protected]> Thu, 08 Nov 2012 18:17:49 +0100
Newsgroups gmane.comp.python.ctypes
Message-ID <CCC1A777.2DF99%[email protected]>
On 11/8/12 2:06 PM, "Daniel Holden" <[email protected]>
wrote:

>Hi all,
>
>I was wondering if anyone could help me with a ctypes stack corruption
>issue I'm having. The details are posted in this stack overflow question:
>
>http://stackoverflow.com/questions/13275211/python-ctypes-stack-corruption
>
>I've been battling this bug for a while now and am at a bit of a dead
>end. I was basically wondering if anyone had any more suggestions for
>debugging techniques. I also don't want to out-rule that it might be a
>bug in ctypes but needed a sanity check first.
>
>Certainly ctypes seems to believe `skel` is a pointer of some sort but
>somehow it is getting put on the stack incorrectly. If anyone believes
>it is a bug in ctypes I'll upload the code somewhere so that it can be
>attempted to be reproduced.

What do the sizeof of qfsm_node_t in C and ctypes return you? If those are
mis-aligned, ctypes will probably call the C-function with a stack-frame
that's not laid out properly.

Diez



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov