-
Notifications
You must be signed in to change notification settings - Fork 318
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
Segfault when passing a DAC channel to a function as argument #1168
Comments
Can you provide details on the commits/versions of the python bindings and c library you are using? |
I am not sure I got the versions right... Here you are:
Could you tell me the name of the relevant packages? Thanks! |
I need to know the libiio version/commit including its python bindings. If you don't know, how did you install both? |
Ok, thanks for the patience. Here it is, I hope:
|
My guess is you are running into some weak ref issues we had in python years back. For channel attributes it was related to this fix f2ebf4b I would upgrade to v0.25 for both the library and bindings |
I am controlling an AD5370 evaluation board from Python 3.9.2 using IIO from an Olimex A64-OLinuXino-2Ge8G-IND single board computer running Debian Bullseye 11 (oldstable, aarch64) using its SPI port (exposed in its UEXT connector).
I compiled the kernel (Olimex ships Debian with kernel 5.10.180, so I compiled that one with their patches) to include the ad5360 module.
The board works perfectly when I write to the file interface (writing to the files in
/sys/bus/iio/devices
) or when I control it from Python.The problem arises when I pass the channel object from a function to another, or I create it in the init of a class and I try to access it from one of its methods.
Here you are a minimal non-working example:
And here you have its output, with the content of the coredump:
Testing different environments I also observed bus_error instead of segfault.
The work around I found is to pass from function to function only the context manager, then find the device and find the channel and set the calibration values every time I want to operate the DAC.
This is the example with the ugly fix and its output:
The text was updated successfully, but these errors were encountered: