http://bugs.winehq.org/show_bug.cgi?id=24270
Summary: kernel32/time.c tests fail under clang, but not gcc Product: Wine Version: 1.3.2 Platform: x86-64 OS/Version: Linux Status: NEW Keywords: download, source Severity: trivial Priority: P2 Component: kernel32 AssignedTo: wine-bugs@winehq.org ReportedBy: austinenglish@gmail.com
There are some other failures, but they are mostly timeouts or otherwise hard to diagnose. This one is pretty interesting though...: time.c:592: Test failed: Test SystemTimeToTzSpecificLocalTime #399. Got 2020-03-02 02:00. Expect hour = 03 time.c:592: Test failed: Test SystemTimeToTzSpecificLocalTime #403. Got 2020-03-02 02:00. Expect hour = 01 time.c:592: Test failed: Test SystemTimeToTzSpecificLocalTime #404. Got 2020-03-02 02:00. Expect hour = 01 time.c:592: Test failed: Test SystemTimeToTzSpecificLocalTime #405. Got 2020-03-02 02:00. Expect hour = 03 time.c:592: Test failed: Test SystemTimeToTzSpecificLocalTime #406. Got 2020-03-02 02:00. Expect hour = 01 time.c:592: Test failed: Test SystemTimeToTzSpecificLocalTime #407. Got 2020-03-02 02:00. Expect hour = 01 ... seems clang doesn't like that code. Doesn't give any compiler warnings/errors though: clang -m32 -c -I. -I. -I../../../include -I../../../include -DWINE_STRICT_PROTOTYPES -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -std=gnu89 -o time.o time.c ../../../tools/winegcc/winegcc -m32 -B../../../tools/winebuild --sysroot=../../.. -fasynchronous-unwind-tables actctx.o alloc.o atom.o change.o codepage.o comm.o console.o debugger.o directory.o drive.o environ.o fiber.o file.o format_msg.o generated.o heap.o loader.o locale.o mailslot.o module.o path.o pipe.o process.o profile.o resource.o sync.o thread.o time.o timer.o toolhelp.o version.o virtual.o volume.o resource.res testlist.o -o kernel32_test.exe.so ../../../libs/port/libwine_port.a -luser32 -ladvapi32
http://bugs.winehq.org/show_bug.cgi?id=24270
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #1 from Dan Kegel dank@kegel.com 2010-09-04 19:19:48 CDT --- First thing to do is figure out if it's wine itself or the test that is being miscompiled. Try building the test as a plain win32 executable and running that with the clang-built wine. If that succeeds, you know the test is what was miscompiled, and you can go to town on it.
If you're sure wine is fine and the test is correct, and the fault is the compiler, http://delta.tigris.org/ is a great way to extract a minimal test case for compiler developers. Hard to use on dlls, though.
http://bugs.winehq.org/show_bug.cgi?id=24270
--- Comment #2 from Austin English austinenglish@gmail.com 2010-09-04 22:14:01 CDT --- using a winetest.exe from test.winehq.org: austin@midna:~/wine-git$ ./wine winetest-latest.exe -o foo kernel32:time ; tail foo Dll info: kernel32=5.1.2600.2180 Test output: kernel32:time start dlls/kernel32/tests/time.c - time.c:256: tz_id 2 (TIME_ZONE_ID_DAYLIGHT) time.c:264: bias 360, Central Standard Time - Central Daylight Time time.c:265: standard (d/m/y): 1/11/0000 day of week 0 2:00:00.000 bias 0 time.c:271: daylight (d/m/y): 2/03/0000 day of week 0 2:00:00.000 bias -60 time: 804 tests executed (0 marked as todo, 0 failures), 0 skipped. kernel32:time done (0)
so yeah, seems clang is mis-compiling it. I'm not sure that the code is correct though (probably is, but I don't know that code well enough to say). I'll probably file a clang bug soon-ish.
http://bugs.winehq.org/show_bug.cgi?id=24270
--- Comment #3 from Dmitry Timoshkov dmitry@codeweavers.com 2010-09-05 00:44:43 CDT --- Does it help if you compile Wine with gcc and the test with clang, or vice versa?
http://bugs.winehq.org/show_bug.cgi?id=24270
--- Comment #4 from Austin English austinenglish@gmail.com 2010-09-05 01:13:31 CDT --- (In reply to comment #3)
Does it help if you compile Wine with gcc and the test with clang, or vice versa?
gcc-wine and clang-test fails clang-wine and gcc-test passes
http://bugs.winehq.org/show_bug.cgi?id=24270
--- Comment #5 from Dan Kegel dank@kegel.com 2010-09-05 01:23:06 CDT --- Before you file that clang test, do try using Delta to find a true minimal test case. You'd be surprised how much more attention compiler developers pay to those.
http://bugs.winehq.org/show_bug.cgi?id=24270
--- Comment #6 from Dan Kegel dank@kegel.com 2010-09-05 01:23:56 CDT --- Er, I meant before you file that clang *bug*.
http://bugs.winehq.org/show_bug.cgi?id=24270
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|kernel32/time.c tests fail |kernel32/time.c tests fail |under clang, but not gcc |due to being miscompiled by | |clang, but not gcc (not a | |Wine bug)
http://bugs.winehq.org/show_bug.cgi?id=24270
--- Comment #7 from Luca Bennati lucak3@gmail.com 2010-09-05 04:37:40 CDT --- Can confirm the test failures.
But I get 1 warning here: clang -c -I. -I. -I../../../include -I../../../include -DWINE_STRICT_PROTOTYPES -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -std=gnu89 -O0 -Wall -Wextra -Wsign-compare -o time.o time.c time.c:286:12: warning: comparison of integers of different signs: 'BOOL' (aka 'int') and 'DWORD' (aka 'unsigned int') [-Wsign-compare] ok(res != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n"); ~~~ ^ ~~~~~~~~~~~~~~~~~~~~ 1 diagnostic generated.
http://bugs.winehq.org/show_bug.cgi?id=24270
--- Comment #8 from Austin English austinenglish@gmail.com 2010-09-06 01:47:27 CDT --- Clang bug: http://llvm.org/bugs/show_bug.cgi?id=8083
http://bugs.winehq.org/show_bug.cgi?id=24270
--- Comment #9 from Austin English austinenglish@gmail.com 2010-09-06 10:57:14 CDT --- Created an attachment (id=30606) --> (http://bugs.winehq.org/attachment.cgi?id=30606) patch
Actually, it may be a gcc bug that clang exposes. This patch fixes it on clang.
Notice that there are two similar tests (for TzSpecificLocalTimeToSystemTime and SystemTimeToTzSpecificLocalTime). The SystemTimeToTzSpecificLocalTime currently fails on clang, and the yeardays[] array is missing a final {0} entry. On gcc this passes, but clang fails (perhaps rightly?).
http://bugs.winehq.org/show_bug.cgi?id=24270
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Summary|kernel32/time.c tests fail |kernel32/time.c tests fail |due to being miscompiled by |due to being miscompiled by |clang, but not gcc (not a |clang, but not gcc |Wine bug) |
--- Comment #10 from Austin English austinenglish@gmail.com 2010-09-06 13:55:22 CDT --- Patch committed:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7f30ae6349e01095823e6f...
http://bugs.winehq.org/show_bug.cgi?id=24270
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org 2010-09-18 13:06:47 CDT --- Closing bugs fixed in 1.3.3.