http://bugs.winehq.org/show_bug.cgi?id=20316
Summary: init_user_process_params() forgets to initialize CurrentDirectory.Handle, causing uninitialized memory reference in init_current_directory() Product: Wine Version: 1.1.31 Platform: PC OS/Version: Linux Status: NEW Keywords: download, patch, source Severity: normal Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com
Once you are past bug 20303 and bug 20315, the commands
cd dlls/advapi32/tests /usr/local/valgrind-10896/bin/valgrind --trace-children=yes --track-origins=yes --workaround-gcc296-bugs=yes ~/wine-git/wine advapi32_test.exe.so security.c
produce the valgrind warning
Conditional jump or move depends on uninitialised value(s) at RtlSetCurrentDirectory_U (path.c:992) by init_current_directory (process.c:769) by __wine_kernel_init (process.c:1036) by __wine_process_init (loader.c:2719) Uninitialised value was created by a client request at inform_valgrind_of_new_virtual_memory_block (virtual.c:1724) by NtAllocateVirtualMemory (virtual.c:1870) by init_user_process_params (thread.c:186) by thread_init (thread.c:340) by __wine_process_init (loader.c:2695)
It seems the field CurrentDirectory.Handle is not initialized in init_user_process_params(). Adding the line params->CurrentDirectory.Handle = INVALID_HANDLE_VALUE; around line 200 of dlls/ntdll/thread.c works and is probably even the right fix.
http://bugs.winehq.org/show_bug.cgi?id=20316
--- Comment #1 from Dan Kegel dank@kegel.com 2009-10-10 22:06:04 --- Created an attachment (id=24022) --> (http://bugs.winehq.org/attachment.cgi?id=24022) Initialize CurrentDirectory.Handle to avoid valgrind warning
http://bugs.winehq.org/show_bug.cgi?id=20316
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID
--- Comment #2 from Alexandre Julliard julliard@winehq.org 2009-10-11 03:56:45 --- Broken annotations again.
http://bugs.winehq.org/show_bug.cgi?id=20316
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Dmitry Timoshkov dmitry@codeweavers.com 2009-10-11 07:49:25 --- Closing invalid.