https://bugs.winehq.org/show_bug.cgi?id=36606
Bug ID: 36606 Summary: valgrind shows uninitialized memory use in ws2_32/tests/protocol.c Product: Wine Version: 1.7.19 Hardware: x86 OS: Linux Status: NEW Keywords: download, source, testcase Severity: normal Priority: P2 Component: winsock Assignee: wine-bugs@winehq.org Reporter: austinenglish@gmail.com
==21539== Invalid write of size 4 ==21539== at 0x402F31D: memset (vg_replace_strmem.c:1087) ==21539== by 0x4E1CFD5: WS_EnterSingleProtocolA (socket.c:1778) ==21539== by 0x4E1D22C: WS_EnumProtocols (socket.c:1832) ==21539== by 0x4E2CC95: WSAEnumProtocolsA (socket.c:7483) ==21539== by 0x4CA2650: test_WSAEnumProtocolsA (protocol.c:110) ==21539== by 0x4CA2D46: func_protocol (protocol.c:202) ==21539== by 0x4CCAD54: run_test (test.h:584) ==21539== by 0x4CCB143: main (test.h:654) ==21539== Address 0x499bf18 is 0 bytes after a block of size 744 alloc'd ==21539== at 0x7BC4C6DF: notify_alloc (heap.c:255) ==21539== by 0x7BC50F23: RtlAllocateHeap (heap.c:1716) ==21539== by 0x4CA2624: test_WSAEnumProtocolsA (protocol.c:106) ==21539== by 0x4CA2D46: func_protocol (protocol.c:202) ==21539== by 0x4CCAD54: run_test (test.h:584) ==21539== by 0x4CCB143: main (test.h:654) ==21539==
https://bugs.winehq.org/show_bug.cgi?id=36606
--- Comment #1 from Bruno Jesus 00cpxxx@gmail.com --- I can't find this issue... The buffer is 744 bytes long and the memset writes 744 bytes, I don't see this invalid write anywhere =/
https://bugs.winehq.org/show_bug.cgi?id=36606
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |valgrind
https://bugs.winehq.org/show_bug.cgi?id=36606
--- Comment #2 from Austin English austinenglish@gmail.com --- austin@aw25 ~/wine-valgrind/dlls/ws2_32/tests $ make protocol.ok gcc -m32 -c -o sock.o sock.c -I. -I../../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers \ -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith \ -Wlogical-op -gdwarf-2 -gstrict-dwarf -fno-omit-frame-pointer -g -O0 -fno-inline ../../../tools/winegcc/winegcc -o ws2_32_test.exe.so -B../../../tools/winebuild -m32 -fasynchronous-unwind-tables \ protocol.o sock.o testlist.o -lws2_32 -luser32 -lm ../../../tools/runtest -q -P wine -T ../../.. -M ws2_32.dll -p ws2_32_test.exe.so protocol && touch protocol.ok preloader: Warning: failed to reserve range 00110000-68000000 preloader: Warning: failed to reserve range 7f000000-82000000 fixme:winsock:WS_EnterSingleProtocolW unknown Protocol <0x0000dead> fixme:winsock:WS_EnterSingleProtocolW unknown Protocol <0x0000cafe> ==18265== Invalid write of size 4 ==18265== at 0x402E46B: memset (mc_replace_strmem.c:1055) ==18265== by 0x50A8FD5: WS_EnterSingleProtocolA (socket.c:1778) ==18265== by 0x50A922C: WS_EnumProtocols (socket.c:1832) ==18265== by 0x50B8C95: WSAEnumProtocolsA (socket.c:7483) ==18265== by 0x4F596A8: test_WSAEnumProtocolsA (protocol.c:110) ==18265== by 0x4F59D9E: func_protocol (protocol.c:202) ==18265== by 0x4F80BB1: run_test (test.h:584) ==18265== by 0x4F80FA0: main (test.h:654) ==18265== Address 0x4a9d5c0 is 0 bytes after a block of size 744 alloc'd ==18265== at 0x7BC4C6EB: notify_alloc (heap.c:255) ==18265== by 0x7BC50F2F: RtlAllocateHeap (heap.c:1716) ==18265== by 0x4F5967C: test_WSAEnumProtocolsA (protocol.c:106) ==18265== by 0x4F59D9E: func_protocol (protocol.c:202) ==18265== by 0x4F80BB1: run_test (test.h:584) ==18265== by 0x4F80FA0: main (test.h:654) ==18265==
austin@aw25 ~/wine-valgrind/dlls/ws2_32/tests $ uname -a Linux aw25 3.13.3-gentoo-devlight-1 #1 SMP Thu Feb 20 00:10:55 Local time zone must be set--see zic x86_64 Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz GenuineIntel GNU/Linux
is there some logs you'd like?
https://bugs.winehq.org/show_bug.cgi?id=36606
--- Comment #3 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Austin English from comment #2)
is there some logs you'd like?
No, thanks. I think I've found it using a lot of printf.
https://bugs.winehq.org/show_bug.cgi?id=36606
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com
--- Comment #4 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 48790 --> https://bugs.winehq.org/attachment.cgi?id=48790 patch
Please try the attached patch.
https://bugs.winehq.org/show_bug.cgi?id=36606
--- Comment #5 from Austin English austinenglish@gmail.com --- (In reply to Bruno Jesus from comment #4)
Created attachment 48790 [details] patch
Please try the attached patch.
Works for me, thanks.
https://bugs.winehq.org/show_bug.cgi?id=36606
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |6f47a9d9d83ff53d486cf3c163f | |eb7df7f4bfcd0 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #6 from Bruno Jesus 00cpxxx@gmail.com --- Patch commited.
https://bugs.winehq.org/show_bug.cgi?id=36606
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.21.