Open infosecCLI opened 1 month ago
Please note, I uninstalled the port of yubikey-manager. I installed yubikey-manager-5.4.0-mac.pkg.
I did not have the same problem. There was no "quit unexpectedly."
The commands I mentioned previously did not abort.
Thank you.
I am a maintainer of the MacPorts port.
This is almost certainly a MacPorts-specific problem, though I have been unsuccessful in debugging it.
I note that installing yubikey_manager via pip instead of via MacPorts still has the same problem, but only if using the MacPorts python3:
% /opt/local/bin/python3 -m venv mpenv
% . ./mpenv/bin/activate
% pip install yubikey_manager
% ./mpenv/bin/ykman -h
# ...
zsh: abort ykman -h
% /usr/bin/python3 -m venv applenv
% . ./applenv/bin/activate
% pip install yubikey_manager
% ./applenv/bin/ykman -h
# no abort
The MacPorts Python crashes even when built without the +lto or +optimizations variants enabled.
I pared down ykman/_cli/__main__.py
until ykman -h
stopped aborting, and I found that I had to get rid of basically everything, including imports from './util'. So I think the proximate cause is a side effect somewhere else in the program, perhaps a resource that is not cleaned up appropriately.
I'm at a loss as to how to debug this further.
Based on the presence of ctypes in the trace I suspect the problem is related to the HID communication layer. Can you try running the following command to see if that alone triggers the abort?
python3 -c "import ykman.hid.macos"
Based on the presence of ctypes in the trace I suspect the problem is related to the HID communication layer. Can you try running the following command to see if that alone triggers the abort?
python3 -c "import ykman.hid.macos"
Yes, that does trigger the abort!
Oh I should note that the problem only seems to happen on x86_64, not on arm.
Steps to reproduce
[Please explain what you did when the bug appeared, and if and how you have been able to reproduce it.] hit the return key after typing in a command
Expected result i.e. list connected YubiKeys
[What did you expect to happen when you did the above?] i,e, list connected YubiKeys
Actual results and logs
[What actually happened?] zsh: abort ykman -h
Other info
[Anything else you would like to add?] thank you for looking into this