Re: ctypes stack corruption [SEC=UNOFFICIAL]

Daniel Holden <[email protected]> Fri, 9 Nov 2012 15:15:59 +0000
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
Actually It turned out I was using the library incorrectly. The newest 
version of libffi called my function correctly.

Is there a way for me to find out what version of libffi my version of 
ctypes is using?

Thanks,

Dan

On 09/11/2012 12:50, Daniel Holden wrote:
> So I went and setup a small test program using libffi and managed to
> recreate the erroneous behavior so it seems likely that this is an issue
> with libffi rather than ctypes. Time to head over to their mailing list
> and bother them there.
>
> Many thanks guys,
>
> - Dan
>
> On 08/11/2012 23:58, Andrew MacIntyre wrote:
>> [apologies for top post]
>>
>> Just to suggest, as Diez alluded to, that this might be an alignment issue between the libffi configuration that ctypes is using and the alignment that your C library routine is expecting.  This possibly could be related to structure definitions.
>>
>> You might be able to test this with C test code that calls your C routine via libffi (make sure its the version used by Python, in case there are multiple versions).
>>
>> -------------------------> "These thoughts are mine alone!" <---------
>> Andrew MacIntyre           Operations Branch
>> tel:   +61 2 6219 5356     Communications Infrastructure Division
>> fax:   +61 2 6253 3277     Australian Communications & Media Authority
>> email: [email protected]            http://www.acma.gov.au/
>>
>>
>>> -----Original Message-----
>>> From: Daniel Holden [mailto:[email protected]]
>>> Sent: Friday, 9 November 2012 12:06 AM
>>> To: [email protected]
>>> Subject: [ctypes-users] ctypes stack corruption
>>>
>>> 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.
>>>
>>> Thanks,
>>>
>>> Dan
>>>
>>> ------------------------------------------------------------------------------
>>> 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
>>> _______________________________________________
>>> ctypes-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/ctypes-users
>> NOTICE: This email message is for the sole use of the intended recipient(s)
>>    and may contain confidential and privileged information. Any unauthorized
>>    review, use, disclosure or distribution is prohibited. If you are not the
>>    intended recipient, please contact the sender by reply email and destroy all
>>    copies of the original message.
>>
>>
>
> ------------------------------------------------------------------------------
> 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
> _______________________________________________
> ctypes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ctypes-users
>
>

------------------------------------------------------------------------------
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

_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users