-
Notifications
You must be signed in to change notification settings - Fork 41
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
LinkamCMS segfaults in Linux #273
Comments
Here's a minimal code example showing the issue:
Looking at
And indeed that's we are doing in:
|
This issue is happening when setting the callback for status events:
We can't pass unions and structures and bit-fields by value. But that's the interface for the callback so we can't just change it pointer. But I think we can drop the bit-fields ourselves.
If the problem is the bit-field, we should be able to remove the Unfortunately, the Linkam API does this a lot so we probably need to do the same in a bunch of other places I do not have access the hardware to do this though. |
Test fix in my |
Any real hardware tests will need either Tom or Jingyu to contribute. However I'm not sure either of them runs Linux anywhere. Do you think this is limited to Linux or will it also be an issue on Windows? |
I will try it as soon as I get access to the stage again and will keep you posted |
Hi there, this is a little complex but:
|
Starting again from the 0.6.0 tag, and applying your changes we definitely get further, but we're getting a segfault in
...with both versions of the .so file. |
Before fixing that, I'd prefer we fix the reason why you can't use the current development version (otherwise I will need to fix the segfault in 0.6.0 and then "forwardport" it to the development). From the error message, I think the error comes because you don't specify the Can you try to construct it with |
Yes, will do as soon as I can access the linkam stage again! |
OK the We're hacking the paths to the .so file and the .lsk file but this is fine for testing. Now we're able to get further, and run your script, but the status we get back from the stage seems to say "connected=False", what could that be a symptom of? |
guys? |
Can we help? |
|
Adding to what @mickp said: we're redirect the logs to |
Are we sure this isn't a license issue? The SDK does require a license file to work. |
It's not a license issue, this we've checked carefully. |
Is there any way to borrow a windows machine and test on that. The system is usb so a loan of a laptop might help. I suggest this as the current code works well on the Diamond system and was definitely working on the Oxford one when I left 18 months ago. These both use windows and that dll. I know this may not suit your purposes but should so that the firmware etc are genarlaly working. |
I have borrowed a windows machine and confirmed that I can drive the stage. The state of affairs is as follows:
Is this normal? |
The UID being required is normal. in the case of Ubuntu we don't know whether that is normal since we never tested in Linux: microscope/microscope/stages/linkam.py Line 979 in a921847
However, it is certainly not the desired outcome. I do not have access to a Linkam stage to fix that. Now do you know it should work in Windows, if you could fix it to work in Linux too that would be great. |
sure, but debugging a segfault like this is quite hard, I don't know where to start... |
I recommend creating a minimal example using ctypes only and without Python-Microscope. The script shouldn't be too long since there's a lot of stuff you won't need (such as setting all the callbacks and adding device settings) and you can mostly copy and paste from Python-Microscope. I would work from there to identify what it is that we're doing wrong. |
As reported in https://forum.image.sc/t/driving-a-linkam-cms196-with-python-microscope/78773/2 LinkamCMS fails to initialize in Linux:
I've tried in Linux, even without hardware, and can reproduce the issue so the problem is not on the SDK.
The text was updated successfully, but these errors were encountered: