Bump libusb to fix Windows segfault #154
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When using
iceprog.exe
from theoss-cad-suite-windows-x64-20250506.exe
release asset on a Windows 11 Professional machine at version 10.0.26100 Build 26100, I was unable to successfully program my board despite having correctly configured the driver to use libusbK (v3.1.0.0).Instead of printing any error message, it would show the following output:
Echoing the
%ERRORLEVEL%
return code gave me a value of -1073741819 which isC000 0005
, the standard code for an access violation.Solution
Bumped the libusb dependency from v1.0.24 to v1.0.28. This specifically incorporates a change in libusb made in 1.0.25 which states "Windows: Fix segfault with libusbk driver".
Debugging Performed
I found the following in the event log while debugging the issue.
Building the iceprog code from in MSYS2 with the
mingw-w64-ucrt-x86_64
toolchain proved successful; however, dropping that newly compiled version into my oss-cad-suite installation continued to fail. Copying over the libftdi1.dll did not yield success; however, copying over the libusb-1.0.dll from my MSYS2 environment to the oss-cad-suite install caused the existing iceprog.exe in the oss-cad-suite code to work again.Inspecting the version that was copied from my MYSY2 install, I found that it was using a newer version (1.0.27 vs 1.0.24 as in the current code).