Skip to content
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

OSError: exception: access violation writing 0x0000000000000000 on Windows #14

Open
mossmann opened this issue Aug 15, 2024 · 0 comments
Labels

Comments

@mossmann
Copy link
Member

Cynthion example copied from greatscottgadgets/cynthion#158 (comment):

C:\Users\Admin\Documents>cynthion update --mcu-firmware
Updating device firmware with 13876 bytes...
Operation complete!
Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\weakref.py", line 666, in _exitfunc
    f()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\weakref.py", line 590, in __call__
    return info.func(*info.args, **(info.kwargs or {}))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\_objfinalizer.py", line 106, in _do_finalize_object_ref
    obj._do_finalize_object()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\_objfinalizer.py", line 73, in _do_finalize_object
    self._finalize_object()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\backend\libusb1.py", line 613, in _finalize_object
    _lib.libusb_unref_device(self.devid)
OSError: exception: access violation writing 0x0000000000000000

This exception is ignored by pyusb, so it actually has no effect other than looking like a failure and confusing the user. The firmware update actually completes. The exception only occurs if the Saturn-V iSerialNumber matches Apollo's iSerialNumber.

It happens after a DFU_DETACH, and it has to do with the defunct Apollo device, not the Saturn-V device that is present after DFU_DETACH. In the case above, the user presumably has Saturn-V 1.0 (with mangled serial number), and that access violation happened when updating from Apollo firmware with mangled serial number to newer Apollo firmware with unmangled serial number. The serial numbers no longer match, so they don't see the error anymore.

This means that anyone with Saturn-V 1.1 introduces the access violation by updating Apollo.

@mossmann mossmann added the bug label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant