New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble Importing Z3 in Example #2
Comments
This is an extension of problem #1 mentioned on the page. |
This is an issue with Ctypes and your Python build. @ancat will give us some more details when he can and he should be able to provide a solution. |
Hi Kevin! This is an issue regarding the default builds of python that come with your OS. A lot of core python modules are implemented as shared objects (ctypes for example) without symbols, so resolution fails. You'll need to compile python yourself. First, you'll need to pull down the latest version of the code since I had to modify the makefile to get it working. Here's what I did after downloading and extracting Python 2.7.8 to In In the Python_Pin directory: Unfortunately I could only get it working with those environment variables; I have no idea how to get Python_Pin.so to load the non-system-default
versus
Using this, I was able to get shared object modules working (both ctypes and z3). Let me know if this works for you. |
Ancat, thank you very much for your help. You both have been very helpful. My commands for those that may be interested down the road were:
|
On a 32 and 64 bit Ubuntu images, I am successfully able to import z3 like in the following examples
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from z3 import *
>>>
However, when I try to use z3 in a sample example file on both 64 and 32 bit images, I get the following import error.
student@ubuntu:~/Desktop/pin_dir/source/tools/Python_Pin$ sudo bash ../../../pin.sh -t obj-ia32/Python_Pin.so -m examples/call_chain.py -- /bin/echo "hello"
Traceback (most recent call last):
File "examples/call_chain.py", line 2, in
from z3 import *
File "/usr/lib/python2.7/dist-packages/z3.py", line 43, in
from z3core import *
File "/usr/lib/python2.7/dist-packages/z3core.py", line 3, in
import ctypes
File "/usr/lib/python2.7/ctypes/init.py", line 10, in
from _ctypes import Union, Structure, Array
ImportError: /usr/lib/python2.7/lib-dynload/_ctypes.i386-linux-gnu.so: undefined symbol: PyFloat_Type
hello
Would there be some possible fix for this?
The text was updated successfully, but these errors were encountered: