http://bugs.winehq.org/show_bug.cgi?id=20315
Summary: PEB not fully initialized, causes valgrind warnings during thread initialization? 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
Running wine's tests under valgrind yields warnings of the sort (after applying the patch in bug 20303):
Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to uninitialised byte(s) at: sendmsg (socket.S:64) by: server_init_thread (server.c:1061) by: thread_init (thread.c:325) by: __wine_process_init (loader.c:2695) by: wine_init (loader.c:711) by: main (main.c:218) Address 0xfe924c48 is on thread 1's stack Uninitialised value was created by a client request at: inform_valgrind_of_new_virtual_memory_block (virtual.c:1725) by: NtAllocateVirtualMemory (virtual.c:1878) by: thread_init (thread.c:307) by: __wine_process_init (loader.c:2695) by: wine_init (loader.c:711) by: main (main.c:218)
and
Conditional jump or move depends on uninitialised value(s) at: get_modref (loader.c:293) by: load_dll (loader.c:1944) by: LdrLoadDll (loader.c:2025) by: load_library (module.c:890) by: LoadLibraryExW (module.c:947) by: __wine_kernel_init (process.c:1087) by: wine_init (loader.c:711) by: main (main.c:218) Uninitialised value was created by a client request at: inform_valgrind_of_new_virtual_memory_block (virtual.c:1725) by: NtAllocateVirtualMemory (virtual.c:1878) by: thread_init (thread.c:276) by: __wine_process_init (loader.c:2695) by: wine_init (loader.c:711) by: main (main.c:218)
I didn't look too far, but it seems that the PEB isn't fully initialized and/or has holes that might need a valgrind annotation. Memsetting them to zero right after allocation makes the warnings go away. (The right fix would be to figure out which fields still need initialization.)
http://bugs.winehq.org/show_bug.cgi?id=20315
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|PEB not fully initialized, |PEB and TEB not fully |causes valgrind warnings |initialized, causes |during thread |valgrind warnings during |initialization? |thread initialization?
--- Comment #1 from Dan Kegel dank@kegel.com 2009-10-10 21:38:30 --- (meant to say PEB and TEB. The patch memsets them both.)
http://bugs.winehq.org/show_bug.cgi?id=20315
--- Comment #2 from Dan Kegel dank@kegel.com 2009-10-10 21:39:21 --- Created an attachment (id=24021) --> (http://bugs.winehq.org/attachment.cgi?id=24021) Quick patch to work around missing initialization
http://bugs.winehq.org/show_bug.cgi?id=20315
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID
--- Comment #3 from Alexandre Julliard julliard@winehq.org 2009-10-11 03:55:05 --- mmap initializes to zero, your annotations are broken.
http://bugs.winehq.org/show_bug.cgi?id=20315
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Dmitry Timoshkov dmitry@codeweavers.com 2009-10-11 07:49:37 --- Closing invalid.