-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Crash on Windows 64bit with Msys2 #97
Comments
I can't reproduce it here. Can you share the binary and unicorn.dll file that crashes? UPDATE: nevermind. I reproduced it |
The actual crash happens in a different thread. And it happens here: Line 36 in bea73ef
|
I have a crash at this location with Python Usercorn on OS X that depends on something weird like the amount of memory allocated by Python before Unicorn is invoked. It's crazy hard to debug and I haven't found a minimal reproduction case yet. I believe the siglongjump() here is returning into the TCG generated static code buffer. |
It's not actually unicorn bug. It is known issue for QEMU 2.4: This code has no effect: https://github.com/unicorn-engine/unicorn/blob/master/qemu/include/sysemu/os-win32.h#L64 And here is explanation why: Fix published here: |
seems to get fixed, thanks! |
@cherepanov74, i can confirm that can you try to reproduce it? |
I tried to reproduce it on Win 7 and Win 8.1 - no success so far (no crash). I'm going to try it on Win10 soon |
I cannot reproduce it on Windows 10 64-bit |
@aquynh your problem might be due to having a 32bit version of libglib-2.0-0.dll in your dll search path which is being incorrectly loaded. (Especially since you say it worked from msys but not the command prompt) I just built the latest unicorn code from github using 64bit mingw-w64 on windows 10 64bit. When I first ran it it also crashed for me. Then I ran mem_apis.exe through dependency walker and I could see it was importing a 32bit version of libglib-2.0-0.dll. For me it was importing it from "C:\Program Files (x86)\Graphviz2.38\bin\libglib-2.0-0.dll". I then copied all of the 64bit dlls mentioned in the COMPILE.TXT file into the samples dir and I no longer got any crashes. |
this is interesting! so the crash is due to loading the (wrong) DLL from other unrelated app? how to prevent this problem then? |
For me that was the cause of the crash. To fix this I just copied the correct versions of the dlls into the same directory as the sample exe files I was running. So this includes the unicorn.dll as well as the libglib etc dlls. If copying these dlls in doesn't fix the crash for you, then your crash might be caused by something else. So you should copy them in and see if it works. |
I compiled latest code on Windows 64bit using Msys2 (as described in https://github.com/unicorn-engine/unicorn/blob/master/COMPILE.TXT, section 7)
After that, I run
samples/sample_x83.exe -32
, and this crashes immediately.With some investigation, I found that the crash happens inside
uc_emu_start()
, when executingqemu_thread_join()
, and the exact place is at https://github.com/unicorn-engine/unicorn/blob/master/qemu/util/qemu-thread-win32.c#L319I searched around a bit, and think perhaps this is due to some bugs in
WaitForSingleObject()
of Msys2, but not entirely sure, or how to fix this.Note that this does not happen with Windows 32bit + Msys2. Only Windows 64bit + Msys2 has this issue.
Any Windows experts can help? Thanks.
The text was updated successfully, but these errors were encountered: