https://bugs.winehq.org/show_bug.cgi?id=36640
Bug ID: 36640 Summary: valgrind shows lots of uninitialized reads/writes in twain_32/tests/dsm.c Product: Wine Version: 1.7.19 Hardware: x86 OS: Linux Status: NEW Keywords: download, source, testcase Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: austinenglish@gmail.com
Created attachment 48679 --> https://bugs.winehq.org/attachment.cgi?id=48679 valgrind log
../../../tools/runtest -q -P wine -T ../../.. -M twain_32.dll -p twain_32_test.exe.so dsm && touch dsm.ok preloader: Warning: failed to reserve range 00110000-68000000 preloader: Warning: failed to reserve range 7f000000-82000000 c==31984== Find PDB file: /tmp/valgrind_petmp31984_87f2d3fc is empty ==31984== Warning: Missing or un-stat-able /home/austin/.wine/drive_c/windows/system32/comctl32.pdb ==31984== Syscall param ioctl(generic) points to uninitialised byte(s) ==31984== at 0x4E9566E7: syscall (in /usr/lib/libc-2.18.so) ==31984== by 0x660FF43: ??? (in /usr/lib/libv4lconvert.so.0.0.0) ==31984== by 0x6627E50: ??? (in /usr/lib/libv4lconvert.so.0.0.0) ==31984== by 0x661081C: v4lconvert_create_with_dev_ops (in /usr/lib/libv4lconvert.so.0.0.0) ==31984== by 0x64C4C1F: v4l2_fd_open (in /usr/lib/libv4l2.so.0.0.0) ==31984== by 0x61DD25C: v4l1_open (in /usr/lib/libv4l1.so.0.0.0) ==31984== by 0x7152059: ??? (in /usr/lib/sane/libsane-v4l.so.1.0.24) ==31984== by 0x7152368: sane_v4l_init (in /usr/lib/sane/libsane-v4l.so.1.0.24) ==31984== by 0x61C56A0: ??? (in /usr/lib/libsane.so.1.0.24) ==31984== by 0x61C6069: sane_dll_get_devices (in /usr/lib/libsane.so.1.0.24) ==31984== by 0x61AE343: sane_get_devices (in /usr/lib/libsane.so.1.0.24) ==31984== by 0x59E8129: detect_sane_devices (sane_main.c:422) ==31984== by 0x59E814B: SANE_GetIdentity (sane_main.c:430) ==31984== by 0x59E7830: SANE_SourceControlHandler (sane_main.c:147) ==31984== by 0x59E7EE5: DS_Entry (sane_main.c:365) ==31984== by 0x55A2921: twain_add_onedriver (dsm_ctrl.c:75) ==31984== by 0x55A2CA2: twain_autodetect (dsm_ctrl.c:110) ==31984== by 0x55A2F7C: TWAIN_IdentityGetFirst (dsm_ctrl.c:174) ==31984== by 0x55A39FF: TWAIN_SourceManagerHandler (twain32_main.c:68) ==31984== by 0x55A3E75: DSM_Entry (twain32_main.c:164) ==31984== Address 0x4d0d0a4 is on thread 1's stack ==31984== Uninitialised value was created by a stack allocation ==31984== at 0x66273EF: ??? (in /usr/lib/libv4lconvert.so.0.0.0) ==31984==
==32109== Syscall param ioctl(generic) points to uninitialised byte(s) ==32109== at 0x4E9566E7: syscall (in /usr/lib/libc-2.18.so) ==32109== by 0x660FF43: ??? (in /usr/lib/libv4lconvert.so.0.0.0) ==32109== by 0x64C55D5: v4l2_ioctl (in /usr/lib/libv4l2.so.0.0.0) ==32109== by 0x61DD54F: v4l1_open (in /usr/lib/libv4l1.so.0.0.0) ==32109== by 0x7152059: ??? (in /usr/lib/sane/libsane-v4l.so.1.0.24) ==32109== by 0x7152368: sane_v4l_init (in /usr/lib/sane/libsane-v4l.so.1.0.24) ==32109== by 0x61C56A0: ??? (in /usr/lib/libsane.so.1.0.24) ==32109== by 0x61C6069: sane_dll_get_devices (in /usr/lib/libsane.so.1.0.24) ==32109== by 0x61AE343: sane_get_devices (in /usr/lib/libsane.so.1.0.24) ==32109== by 0x59E8129: detect_sane_devices (sane_main.c:422) ==32109== by 0x59E814B: SANE_GetIdentity (sane_main.c:430) ==32109== by 0x59E7830: SANE_SourceControlHandler (sane_main.c:147) ==32109== by 0x59E7EE5: DS_Entry (sane_main.c:365) ==32109== by 0x55A2921: twain_add_onedriver (dsm_ctrl.c:75) ==32109== by 0x55A2CA2: twain_autodetect (dsm_ctrl.c:110) ==32109== by 0x55A2F7C: TWAIN_IdentityGetFirst (dsm_ctrl.c:174) ==32109== by 0x55A39FF: TWAIN_SourceManagerHandler (twain32_main.c:68) ==32109== by 0x55A3E75: DSM_Entry (twain32_main.c:164) ==32109== by 0x4958025: test_sources (dsm.c:765) ==32109== by 0x4958934: func_dsm (dsm.c:870) ==32109== Address 0x4d0e3ec is on thread 1's stack ==32109== Uninitialised value was created by a stack allocation ==32109== at 0x61DD124: v4l1_open (in /usr/lib/libv4l1.so.0.0.0) ==32109==
etc., I'll attach a log
https://bugs.winehq.org/show_bug.cgi?id=36640
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |valgrind
https://bugs.winehq.org/show_bug.cgi?id=36640
Vincent Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com
--- Comment #1 from Vincent Povirk madewokherd@gmail.com --- Best I can tell, this error has nothing to do with Wine except that it uses sane.
It also appears to be a false positive. Valgrind doesn't have any way of knowing the requirements for initializing ioctl data. Looking up source code for v4lconvert_create_with_dev_ops, it appears to correctly initialize the required fields for the operations it uses.
https://bugs.winehq.org/show_bug.cgi?id=36640
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #2 from Austin English austinenglish@gmail.com --- (In reply to Vincent Povirk from comment #1)
Best I can tell, this error has nothing to do with Wine except that it uses sane.
It also appears to be a false positive. Valgrind doesn't have any way of knowing the requirements for initializing ioctl data. Looking up source code for v4lconvert_create_with_dev_ops, it appears to correctly initialize the required fields for the operations it uses.
Thanks Vincent, I marked it as a false positive: https://github.com/austin987/wine-valgrind-scripts/commit/bcc8c57bc4ba3b0cb8...
https://bugs.winehq.org/show_bug.cgi?id=36640
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |INVALID
https://bugs.winehq.org/show_bug.cgi?id=36640
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Austin English austinenglish@gmail.com --- Closing, not a bug.