server: avoid sending uninitialized bytes in break_thread()

Dan Kegel dank at
Thu Nov 15 00:01:34 CST 2007

In break_thread(), generate_debug_event() seems to
send the entire ExceptionInformation array regardless of how
many entries are used.   The smart thing to do
would be to send only the used elements, but I
couldn't figure out how to do that.  So here's
a quick fix that just zeroes that array before calling
generate_debug_event().  Is there a better way?

Found by running the Word Viewer 97 under valgrind:
000d: wait_debug_event() = 0 { pid=000a, tid=000b, wait=(nil),
 Syscall param writev(vector[1]) points to uninitialised byte(s)
    at 0x40007F2: (within /lib/
    by 0x806AF20: call_req_handler (request.c:249)
    by 0x8056075: main_loop (fd.c:523)
  Address 0x451AAB8 is 24 bytes inside a block of size 88 alloc'd
    by 0x806A167: set_reply_data_size (request.c:200)
    by 0x80510A6: req_wait_debug_event (request.h:96)
    by 0x806AFC7: call_req_handler (request.c:286)
    by 0x8056075: main_loop (fd.c:523)

BTW, here's how I ran word viewer under valgrind:

--trace-children=yes --gen-suppressions=all
--suppressions=$WINEDIR/tools/valgrind-suppressions --leak-check=full
--num-callers=20 "
cp wordview.exe ~/.wine/drive_c/wvinstall.exe
mv ~/.wine/dosdevices/z: ~/.wine/dosdevices/oldz
cd ~/.wine/drive_c
$VALGRIND_CMD $WINE wvinstall.exe /q
cd ../..
mv ~/.wine/dosdevices/oldz ~/.wine/dosdevices/z:

More information about the wine-devel mailing list