friedkeenan/GoldtreePy

GoldTreePy crashes when installing nsp [0.6.1]

juliopw opened this issue · 7 comments

When installing any nsp the app freezes and GoldTreePy returns this error:

Traceback (most recent call last):
  File "./Goldtree.py", line 434, in <module>
    sys.exit(main())
  File "./Goldtree.py", line 429, in main
    c.handler.write_raw(buf)
  File "./Goldtree.py", line 117, in write_raw
    self.ep[0].write(data, timeout=timeout)
  File "/home/julio/.local/lib/python3.6/site-packages/usb/core.py", line 387, in write
    return self.device.write(self, data, timeout)
  File "/home/julio/.local/lib/python3.6/site-packages/usb/core.py", line 948, in write
    self.__get_timeout(timeout)
  File "/home/julio/.local/lib/python3.6/site-packages/usb/backend/libusb1.py", line 824, in bulk_write
    timeout)
  File "/home/julio/.local/lib/python3.6/site-packages/usb/backend/libusb1.py", line 920, in __write
    _check(retval)
  File "/home/julio/.local/lib/python3.6/site-packages/usb/backend/libusb1.py", line 595, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 5] Input/Output Error

I have tested on USB 2.0 and 3.0 ports. The system is running Linux Mint with Python 3.6 installed.

I can confirm this issue. Seems to happen after Goldleaf asks for 16 MB all at once. Doesn't seem to be a problem for smaller (homebrew) NSPs though

This seems to be an issue with libusb vs libusbK. libusb seems to not handle the large transfer the same way libusbK does, no idea why they are different.

Looks like a working fix is to split the transfers into smaller chunks, the client handles it correctly.

Hmm, I'll mess with that soon then. Thanks

Latest commit should install NSPs as well as Goldtree can (I ran into a bug but it was reproducible on Goldtree). Writing big files is still a problem, and reading data in chunks didn't work like writing data in chunks does, but I guess this issue can be closed.

Great! What about making a new release?
BTW, thanks a lot for this tool!

I'm waiting to make a new release just in case XorTroll changes the USB stuff in the near future. We'll see.