HWI
HWI copied to clipboard
Failure to cleanup temporary directory on crash
When HWI experiences a crash (which can happen for example when Ledger Live is also running), pyinstaller fails to delete the temporary directory it creates when expanding hwi
into a directly executable form. A couple of Sparrow users have reported that if executed multiple times in this situation, the tmp
directory gradually fills up with 50Mb folders that look like _MEIxxxxxx
.
As I noted in https://github.com/sparrowwallet/sparrow/issues/629, this is a known (and old) issue in pyinstaller that has only very recently been fixed. I'm opening this issue to track an update to the pyinstaller dependency in HWI.
Fwiw, I still believe that a --onedir
build for HWI makes more sense however, particularly wrt MacOS (see #327) but also in general since expanding 50Mb folders on every invocation does not seem very efficient :) I have been using this approach for some years now on MacOS and it has proven to be preferable IMHO, at least for application developers.
issue in pyinstaller that has only very recently been fixed.
It seems the issue was fixed in a PR that was merged 7 days ago, while the latest pyinstaller 5.2 release is 10 days old. I guess we need to wait for 5.3 release of pyinstaller?
Pyinstaller 5.3 has now been released, and includes fixes for this issue on both POSIX and Windows platforms: https://pyinstaller.org/en/v5.3/CHANGES.html#id1
I have this issue with a lot of crash in my syslog:
Aug 1 11:27:31 oliver kernel: [138055.861548] hwi-2.1.1286541[60762]: segfault at 200 ip 00007fd4f320a28b sp 00007fd4ef1fdd20 error 4 in libusb-1-150b88da.0.so.0.1.0[7fd4f3200000+17000]
Aug 1 11:27:31 oliver kernel: [138055.861561] Code: 56 41 55 41 54 49 89 f4 55 53 48 89 fb 48 83 ec 20 64 48 8b 04 25 28 00 00 00 48 89 44 24 18 31 c0 48 85 ff 0f 84 75 01 00 00 <8b> 83 00 02 00 00 3>
It seems that pyinstaller 5.3 requires python 3.7. We could bump pyinstaller to ^5.3
in pyproject.toml
, but we'd need to bump python from ^3.6
to ^3.7
. What do you think @achow101?