-
Notifications
You must be signed in to change notification settings - Fork 614
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
Loading onnxruntime.dll from path crashes on Windows build 19025 #932
Comments
Hi @conatsera : thanks for reporting this issue. k4abt.dll uses a standard way to delay load onnxruntime.dll. Have you tried it before your OS got updated to the latest one? Did it work before? |
@conatsera Based on this thread, loading onnxruntime.dll from path seemed to work before: |
That's correct, the same setup was working in build 19013. I have actually noticed some strange behavior of LoadLibraryW in another project that also had functioned before and I will investigate further. A new slow ring build has been released today, I will check for changes. |
@conatsera Thanks for your confirmation! I got a repro of this issue on our latest internal build. It fails in the delayhlp.cpp file (the file is included in the Windows SDK): The error code 182 means "ERROR_INVALID_ORDINAL". I am not an expert on dll loading in Windows... Any help from you to debug this issue would be welcomed :) |
Sorry, I'm not expert in that either. That error doesn't make sense to me in this context, but the bug appears to have been fixed in 19037 anyways. |
It appears to have only temporarily worked until after a rebuild with 0.9.5. I suppose I now have something to work off of for debugging this issue. |
@conatsera , thanks for checking and verifying this issue. For the 0.9.5 release, we didn't change anything related to the dll loading. Do you happen to get a new windows update in between? If you go back to the 0.9.4 version, do you still see this problem? |
I got in touch with the OS team about this issue. The latest windows includes an onnxruntime.dll in the system32 path. However, the onnxruntime.dll we are using in the body tracking SDK is not the same one the windows system is using. Unfortunately they are sharing the same name now. Then it depends on from which folder the executable loads the dll first. Normally, it loads dll first at the same folder as the executable. That is why you see the Body Tracking Viewer works without problem if you put onnxruntime.dll at the same folder as the exe. If the dll is not there, then it normally start to search from system32 path. In this case, it found the wrong system onnxruntime.dll and started to load from there. Since it is the wrong one, it failed to load correctly and then crash. (For your reference, you can find the dll search order here ) |
Hi, |
We are working on a fix for the problem. |
Hi @mromeolisten , could you clarify a bit on your "One solution"? The sentence sounds confusing to me... What do you mean by saying "when running the app that utilizes the Body Tracking SDK it looks to be that it replaces the onnxruntime.dll with a new version." What does "it" refer to? |
@yijiew Apologies. I meant to say that I had attempted to find a working solution by replacing the onnxruntime.dll files with older onnxruntime.dll files I had backed up. This revealed something interesting that could be useful in finding a fix. It appears that the onnxruntime.dll files get updated when running our app that utilizes the Body Tracking SDK, although I'm just making an observation I don't have any debug info to describe what I'm seeing. |
@mromeolisten I see. Thanks for trying to debug this issue. I think we have a good understanding of the problem now. The issue is the naming conflict between our onnxruntime.dll and the onnxruntime.dll that located in system32 folder. We will launch a fix that tries to dynamically load the onnxruntime.dll in the SDK folder first. Please stay tuned. If you want some quick workaround, you will need to delete the onnxruntime.dll in the system32 folder (C:\Windows\System32). I have confirmed with Windows team that this dll is not used in any system process yet. It is safe to delete for now. |
The latest 1.0.1 release has addressed this issue. |
@yijiew Is v1.0.1 already released? If yes, could you please provide a link. |
@yijiew Thank you! |
Describe the bug
On windows insider build 19025 (slow ring), tests fail if loading
onnxruntime.dll
from the path. This bug is very likely in Windows and not the body tracking SDK, but I don't see any other way to report this without knowing how k4abt.dll is loading onnxruntime.dll. Other applications and even Cuda/CuDNN loaded by k4abt.dll do not seem to be affected when loaded from the path.To Reproduce
Run any of the body tracking samples on build 19025 with
onnxruntime.dll
in the path but not the application directory.Expected behavior
onnxruntime.dll
should load correctly wherever it is located.Logs
Trace level logging does not provide any useful info.
Stack trace:
KernelBase.dll!RaiseException() (Code= 0xC06D007F: Procedure not found)
k4abt.dll@0x18025AFEB
k4abt.dll@0x1802583A6
k4abt.dll@0x180248AE5
k4abt.dll@0x180240D28
k4abt.dll@0x1800BC265
k4abt.dll@0x1800C7F19
k4abt.dll@0x18008C0F2
Desktop (please complete the following information):
Additional context
None needed.
The text was updated successfully, but these errors were encountered: