dcharno wrote:
Is it possible to use ctypes with a shared library which uses MMX/SSE
intrinsics? I can load the library and access functions inside it, but
I getting a seg fault when I hit one of the intrinsics. I'm wondering
if there might be some sort of stack alignment problem.
I am using gcc version 4.2.3 and Python 2.5.2 on Ubuntu 8.04.
Any suggestions would be helpful.
Well, stack alignment would be a problem with how the shared library gets
compiled, nothing to do with ctypes (I think). However, if you are passing in
arrays from ctypes, *they* may also be misaligned. Try to check the addresses of
the ctypes values you are passing in. I'm not entirely sure how to do that, though.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco 2 1968
Robert Kern schrieb:
dcharno wrote:
>Is it possible to use ctypes with a shared library which uses MMX/SSE intrinsics? I can load the library and access functions inside it, but I getting a seg fault when I hit one of the intrinsics. I'm wondering if there might be some sort of stack alignment problem.
I am using gcc version 4.2.3 and Python 2.5.2 on Ubuntu 8.04.
Any suggestions would be helpful.
Well, stack alignment would be a problem with how the shared library
gets compiled, nothing to do with ctypes (I think). However, if you are
passing in arrays from ctypes, *they* may also be misaligned. Try to
check the addresses of the ctypes values you are passing in. I'm not
entirely sure how to do that, though.
there is the addressof-function. If this is really the problem, it
should be possible to allocate data + margin (e.g. c_int-arrays), and
cast the proper aligned address via from_address.
Diez
In message <ma**************************************@python.o rg>, Robert
Kern wrote:
Try to check the addresses of the ctypes values you are passing in. I'm
not entirely sure how to do that, though.
Cast the address to an integer and print it out? I think the data needs to
be 16-byte-aligned, so in hex, the units digit of the address should always
be zero. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: zapazap |
last post by:
Dear Snake Charming Gurus,
(Was: http://mail.python.org/pipermail/python-list/2004-January/204454.html)
First, a thank you to Tim Golden, Thomas Heller, and Mark Hammond
for your earlier help...
|
by: sjdevnull |
last post by:
Hey,
I'm trying to wrap GNU readline with ctypes (the Python readline
library doesn't support the callback interface), but I can't figure out
how to set values to a variable inside the library. ...
|
by: p.lavarre |
last post by:
How do I vary the byte offset of a field of a ctypes.Structure?
How do I "use the dynamic nature of Python, and (re-)define the data
type after the required size is already known, on a case by...
|
by: Jack |
last post by:
I'm not able to build IP2Location's Python interface so I'm
trying to use ctypes to call its C interface. The functions
return a pointer to the struct below. I haven't been able to
figure out how...
|
by: moreati |
last post by:
Recently I discovered the re module doesn't support POSIX character
classes:
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
on linux2
Type "help", "copyright", "credits" or "license" for...
|
by: Andrew Lentvorski |
last post by:
Basically, I'd like to use the ctypes module as a much more descriptive
"struct" module.
Is there a way to take a ctypes.Structure-based class and convert it
to/from a binary string?
Thanks,...
|
by: dcharno |
last post by:
Is it possible to use ctypes with a shared library which uses MMX/SSE
intrinsics? I can load the library and access functions inside it, but
I getting a seg fault when I hit one of the intrinsics....
|
by: Robert Kern |
last post by:
dcharno wrote:
Hmm. Okay. Start your program under gdb, find what data it's crashing on, check
the alignment on it, and if it's misaligned, figure out where that data is
coming from.
Is the...
|
by: Anna Smidt |
last post by:
Sorry, I have a question again:
I am trying to debug/ release a CLR application (that uses the
FrameWork). No when I try to compile it, it stops in this line in
-------mmintrin.h--------
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |