Skip to content

LLVM miscompiles Wine's dlls/msvcp90/test/string.c #10122

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

Closed
llvmbot opened this issue Apr 19, 2011 · 3 comments
Closed

LLVM miscompiles Wine's dlls/msvcp90/test/string.c #10122

llvmbot opened this issue Apr 19, 2011 · 3 comments
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category miscompilation

Comments

@llvmbot
Copy link
Member

llvmbot commented Apr 19, 2011

Bugzilla Link 9750
Resolution FIXED
Resolved on Feb 13, 2012 22:21
Version 2.8
OS Linux
Blocks llvm/llvm-bugzilla-archive#10638
Attachments preproccessed file, wine backtrace, preprocessed gcc file
Reporter LLVM Bugzilla Contributor

Extended Description

Compiling wine's msvcp90/test/string.c file with clang causes the string test to crash on running:
austin@midna:~/wine-clang/dlls/msvcp90/tests$ rm string.o ; clang -m32 -c -I. -I. -I../../../include -I../../../include -I../../../include/msvcrt -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -std=gnu89 -g -fno-builtin -o string.o string.c && make && make string.ok:
...
wine: Unhandled page fault on execute access to 0x00000000 at address (nil) (thread 0009), starting debugger...
Unhandled exception: page fault on execute access to 0x00000000 in 32-bit code (0x00000000).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:00000000 ESP:0032fcd8 EBP:68187ff4 EFLAGS:00010202( R- -- I - - - )
EAX:5561cff4 EBX:7b8acf00 ECX:0032fcc4 EDX:0032fcc4
ESI:74736500 EDI:00720020
Stack dump:
0x0032fcd8: 0000000f 0000032d 7b86ec60 68187ff4
0x0032fce8: 0032fd18 6817ed18 00000001 7ffd8000
0x0032fcf8: 7ffd8000 0000032d 0032fd78 68184dd6
0x0032fd08: 68187ff4 0032fe38 7b86ec60 68187ff4
0x0032fd18: 0032fd78 68184364 00110410 0000000c
0x0032fd28: ffffffff 00000000 0132fd58 0032fe38
Backtrace:
=>0 0x00000000 (0x68187ff4)
1 0x00000000 (0x0001bef4)
2 0x00000000 (0x00000000)
0x00000000: addb %al,0x0(%eax)

compiling that file with gcc works fine. I believe this also occurred in trunk, will verify on another machine when time permits.

Attaching the output of clang -m32 -E -I. -I. -I../../../include -I../../../include -I../../../include/msvcrt -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -std=gnu89 -g -fno-builtin -o string.i string.c

@llvmbot
Copy link
Member Author

llvmbot commented May 5, 2011

Created an attachment (id=6539) [details]
preprocessed gcc file

gcc -E -I. -I. -I../../include -I../../include -I../../include/msvcrt -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -std=gnu89 -g -O0 -fno-builtin string.c &> ~/string_gcc.i

gcc (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5

The bug itself occurs in trunk (r130866), and in 2.9, at -O0, -O1, -02, as well as with/without the integrated assembler.

@llvmbot
Copy link
Member Author

llvmbot commented Aug 18, 2011

FWIW, this doesn't occur when compiling Wine with dragonegg, so it's likely in clang specific code rather than in llvm.

@llvmbot
Copy link
Member Author

llvmbot commented Feb 14, 2012

Works, as of
git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@150433 91177308-0d34-0410-b5e6-96231b3b80d8

and wine-1.4-rc3-23-gd548af4. Going back to an older version of wine that was affected (1.3.26), the bug is also fixed, so the fix was on llvm/clang side.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category miscompilation
Projects
None yet
Development

No branches or pull requests

1 participant