https://bugs.winehq.org/show_bug.cgi?id=36783
Bug ID: 36783 Summary: valgrind shows two invalid writes in kernel32/tests/thread.c Product: Wine Version: 1.7.20 Hardware: x86 OS: Linux Status: NEW Keywords: download, source, testcase, valgrind Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: austinenglish@gmail.com
==27802== Invalid write of size 4 ==27802== at 0x4E34830: test_SetThreadContext (thread.c:988) ==27802== by 0x4E37887: func_thread (thread.c:1763) ==27802== by 0x4E537EE: run_test (test.h:584) ==27802== by 0x4E53BBA: main (test.h:654) ==27802== Address 0x6a8e8d4 is on thread 1's stack ==27802==
==27802== Invalid write of size 4 ==27802== at 0x4E34842: test_SetThreadContext (thread.c:989) ==27802== by 0x4E37887: func_thread (thread.c:1763) ==27802== by 0x4E537EE: run_test (test.h:584) ==27802== by 0x4E53BBA: main (test.h:654) ==27802== Address 0x6a8e8d0 is on thread 1's stack ==27802==
note: I disabled test_thread_fpu_cw() because of a valgrind bug, which you may need to do to see this.
http://bugs.winehq.org/show_bug.cgi?id=36783
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
--- Comment #1 from Sebastian Lackner sebastian@fds-team.de --- I fear we cannot really fix this. For me the corresponding code looks okay:
--- snip --- 986 /* simulate a call to set_test_val(10) */ 987 stack = (int *)ctx.Esp; 988 stack[-1] = 10; // <-- 989 stack[-2] = ctx.Eip; // <-- 990 ctx.Esp -= 2 * sizeof(int *); 991 ctx.Eip = (DWORD)set_test_val; --- snip --- ( http://source.winehq.org/source/dlls/kernel32/tests/thread.c#L986 )
The problem is that Valgrind doesn't understand what we're doing here (manually adjusting the stack pointer and writing values on the stack to simulate a function call).
https://bugs.winehq.org/show_bug.cgi?id=36783
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WONTFIX
--- Comment #2 from Austin English austinenglish@gmail.com --- (In reply to Sebastian Lackner from comment #1)
I fear we cannot really fix this. For me the corresponding code looks okay:
--- snip --- 986 /* simulate a call to set_test_val(10) */ 987 stack = (int *)ctx.Esp; 988 stack[-1] = 10; // <-- 989 stack[-2] = ctx.Eip; // <-- 990 ctx.Esp -= 2 * sizeof(int *); 991 ctx.Eip = (DWORD)set_test_val; --- snip --- ( http://source.winehq.org/source/dlls/kernel32/tests/thread.c#L986 )
The problem is that Valgrind doesn't understand what we're doing here (manually adjusting the stack pointer and writing values on the stack to simulate a function call).
Marked as intentional, thanks.
https://bugs.winehq.org/show_bug.cgi?id=36783
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Austin English austinenglish@gmail.com --- Closing.