-
Notifications
You must be signed in to change notification settings - Fork 23
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
onlykey-cli segfaults in libusb-1.0.so.0.2.0 at the end of execution #44
Comments
I've removed solo-python and installed onlykey-solo-python instead [main] branch. No difference. The GDB output is as follows:
|
We recommend to install OnlyKey CLI via the docs here, $ pip3 install onlykey https://docs.crp.to/command-line.html#linuxbsd-install-with-dependencies |
Thanks, but I am running a source based distribution here, this deviates heavily from the way we manage our packages in Gentoo, thus I walk the next mile to make it work as close to the Gentoo philosophy as possible. Now, if I upgrade libusb to: The failure has changed a bit, instead of segmentation fault, now I get Abort:
Which is way more graceful than before. I have also upgraded: to the latest version from their git repositories, master branches. However, if I run the utility without any parameters, ie:
There are no issues, as it seems. What I have observed is, something very similar to the challenge response bug of keepassxc from before, which unbinds one of the required rawhid or just hid devices and then, perhaps because of the Abort or anything else it does not reattach the HID device back to the kernel. So the Onlykey-App thinks that there is no onlykey connected, where in reality it is. To workaround this, I have re-enabled my additional udev rules to readd the device after some time and then the Onlykey-App picks it up successfully, something similar to: If this is hard to troubleshoot and you think there is no point in it, I am happy to close as I have a workaround and I have automated the 'settime'. Thanks |
Hi Tim, See attached log file. Let me know if you need anything else to troubleshoot this further. |
Thanks for the information, I will check the source and see if there are any cases where we open a device but do not close it. |
@nkichukov Can you test this fix? It should now in all cases at exit close USB in case program exits with device open.
|
It works, thank you Tim! |
I have very similar symptoms with onlykey-cli v1.2.6
It works in "interactive mode", i.e. by simply running onlykey-cli in console.
But segfaults when executing with arguments. For example
Not sure if this is also because of libusb as mentioned earlier in the very beginning topic (because I don't know how to check/verify this) Not to mention app was installed as was said in here https://docs.crp.to/command-line.html#linuxbsd-install-with-dependencies |
@halt-avmc Can you try installing from release here - https://github.com/trustcrypto/python-onlykey/releases/tag/v1.2.8 |
Looks like it works, no more segfaults. Thanks! I have to admit I am not that python guru, so my "installation" was like simply download src archive, unpack it and replace "onlykey" dir under my local python's site-packages. That are only this files:
I am pretty sure this is not the right way to update. First I tried to UPD: found more correct way of updating: |
Hello team,
I am running onlykey-cli version 1.2.4 here under python 3.8 on GNU/Gentoo Linux amd64 kernel 5.11.7.
Execution of commands work, however, instead of graceful exit I am getting segmentation faults in the end. Seems like they are related to libusb.so:
versions of additional packages that are used by onlykey-cli:
dev-libs/libusb-1.0.23-r1:1
sys-auth/solo-python-0.0.27:0
dev-libs/hidapi-0.10.1:0
dev-python/hidapi-0.10.1_p20210303:0
dev-python/aenum-2.2.4:0
dev-python/six-1.15.0-r1:0
dev-python/prompt_toolkit-3.0.16:0
I have checked a 'strace -f' execution to try to figure out what goes wrong but nothing obvious in there. Any pointers?
Here is example execution with the segfault failure in the end:
The text was updated successfully, but these errors were encountered: