-
Notifications
You must be signed in to change notification settings - Fork 56
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
Python demo script causes segfault with Python2 #19
Comments
This is really weird. I expanded line 4051, which was triggering the segfault:
to the following 4 lines:
Now the segfault happens at the very first line, when attempting to read the value of
GDB is also unable to read it. Here is the attempt to read
|
Hi! Courtarro! worked ? Thanks For the patience! :-) []'s Dani. |
I finally got around to trying this. I replaced the above listed mentions of |
If it's segfaulting probably the best way to debug is to build in debug mode and attach a debugger to it. Probably some input is invalid to the C++ code. |
I'm not an expert at ctypes. Python thinks the With Python 2.7 going away, I'm not that worried about whether it works with Python 2.7 in the long term. My original motivation was to use this with GnuRadio 3.7, which is P2.7-based, and GR has since moved to Python 3. However, I'd like to better understand the problem in case it's actually just revealing a more serious underlying issue and P3 happens not to trigger it, but could end up failing later. |
I read some ctypes docs. I think what might be missing is this: wirehair.wirehair_encoder_create.restype = ctypes.c_void_p Maybe also need to wrap it like this: c_void_p(wirehair.wirehair_encoder_create(...)) What may be happening is the default type is a 32-bit integer, which truncated the 64-bit pointer from the library. Passing it back in would lead to invalid memory access as you described... |
Running on 12-thread i7 in 64-bit Linux (Ubuntu Bionic). Compiled and installed libwirehair-shared.so and ran
python2 whirehair.py
:GDB stack trace:
Works fine in Python 3. I am currently debugging.
The text was updated successfully, but these errors were encountered: