-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Clang doesn't like ZeroMemory, causes crash in Wine #10202
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
Comments
ZeroMemory is a macro which is why I can't find any reference to it in the .i file. Instead, ZeroMemory(x, y) expands to "memset(x,0,y)", which occurs two places in that file. You said it can be avoided by not using ZeroMemory. Do you need to remove all uses of ZeroMemory? Does it always crash the first the time ZeroMemory-using the function is called, or does it work successfully sometimes? |
There are two uses of ZeroMemory in the original file (lines 906 and 1140). The problem is the second use. Removing the first makes no difference. I've never had it successfully work when the second ZeroMemory is left in. |
Where does it actually crash? At the memset? Somewhere in ImageList_DrawIndirect? In the caller? |
Backtrace is at http://bugs2.winehq.org/attachment.cgi?id=34075 (I'll attach in a sec). Crashes at the memset: |
This appears to be a stack alignment issue, since adding force_align_arg_pointer fixes it. I don't know what you guys want to do at this point, so I'll leave this bug open for now. |
It also doesn't crash with optimizers active (though the test fails), in either trunk or 2.9. |
Still present, as of and wine-1.4-rc3-23-gd548af4. Using the following Wine patch works around it: ifdef i386ifdef GNUC-# ifdef APPLE /* Mac OS X uses a 16-byte aligned stack and not a 4-byte one */ define __stdcall attribute((stdcall)) attribute((force_align_arg_pointer))-# else elif defined(_MSC_VER)
else |
…b-Fix-build-TypeSystemSwiftTypeRef.cpp-with-NDEBUG [Cherry-pick into next] [lldb] Fix build TypeSystemSwiftTypeRef.cpp with NDEBUG
Extended Description
See: http://bugs.winehq.org/show_bug.cgi?id=26754
likely a regression, though haven't retested with an older Clang yet. Compiling Wine with clang from trunk (clang version 3.0 (trunk 130453)), and running wine's builtin 'regedit' program causes a crash. The crash can be avoided by not using ZeroMemory, or compiling the particular file with gcc instead of clang.
Occurs with/without integrated assembler.
clang -E -I. -I. -I../../include -I../../include -D__WINESRC__ -D_COMCTL32_ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -std=gnu89 -g -O0 -o imagelist.i imagelist.c
preprocessed .i file attached (for Clang and gcc).attached
The text was updated successfully, but these errors were encountered: