Quient valgrind warnings in SELECTOR_SetEntries

Dan Kegel dank at kegel.com
Sat May 13 16:57:31 CDT 2006


Another probably spurious warning from valgrind with an
obvious(?) cause and remedy.

Running valgrind 3.1.1 on OpenOffice 2.0.2 with the command

/usr/local/valgrind-3.1.1/bin/valgrind  --workaround-gcc296-bugs=yes
--trace-children=yes ~/wine/wine soffice.exe

eventually complains

==14051== Conditional jump or move depends on uninitialised value(s)
==14051==    at 0x45FE5A9: SELECTOR_SetEntries
(../../include/wine/library.h:130)
==14051==    by 0x45FE7C7: SELECTOR_AllocBlock (selector.c:140)
==14051==    by 0x45C991C: GLOBAL_CreateBlock (global16.c:146)
==14051==    by 0x45CAD83: GLOBAL_Alloc (global16.c:245)
==14051==    by 0x45CAEAF: GlobalAlloc16 (global16.c:274)
==14051==    by 0x46145B3: K32WOWGlobalAlloc16 (wowthunk.c:394)
==14051==    by 0x45CFC83: thread_attach (in
/home/dank/wine/dlls/kernel/kernel32.dll.so)
==14051==    by 0x45CFDC4: DllMain (kernel_main.c:159)
==14051==    by 0x46164B1: __wine_spec_dll_entry (dll_entry.c:40)
==14051==    by 0x42C2ED4: (within /home/dank/wine/dlls/ntdll/ntdll.dll.so)
==14051==    by 0x42C43C7: MODULE_InitDLL (loader.c:826)
==14051==    by 0x42C4C5E: MODULE_DllThreadAttach (loader.c:1028)
...
==14032== Conditional jump or move depends on uninitialised value(s)
==14032==    at 0x205ED5A9: SELECTOR_SetEntries
(../../include/wine/library.h:130)
==14032== Conditional jump or move depends on uninitialised value(s)
==14032==    at 0x206043AC: WOWTHUNK_Init (../../include/wine/library.h:130

all of which are the same problem as in init_current_teb that I just
posted about.

OK, so this time I fixed all the code that declares an LDT_ENTRY on
the stack and then initializes it.  (This replaces my previous patch.)
It seems safe to me, and it gets rid of the warnings.
A wine guru will have to decide whether it's the right thing to do,
but I bet it is.

(I'm attaching 'cause I'm still unable to send inline patches with gmail.)
- Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldtzero.patch
Type: text/x-patch
Size: 6412 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060513/2ac40d3a/ldtzero-0001.patch


More information about the wine-patches mailing list