Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNINITs in NtUserTests.ClipboardPutGet on win7 #734

Open
derekbruening opened this issue Nov 28, 2014 · 4 comments
Open

UNINITs in NtUserTests.ClipboardPutGet on win7 #734

derekbruening opened this issue Nov 28, 2014 · 4 comments

Comments

@derekbruening
Copy link
Contributor

From bruen...@google.com on January 06, 2012 10:25:09

this seems to happen one in three runs on win7 bot http://build.chromium.org/p/client.drmemory/builders/win-7_x64-drm/builds/1853/steps/app_suite_tests_2/logs/stdio [ RUN ] NtUserTests.ClipboardPutGet
Dr.M
Dr.M Error #1: UNINITIALIZED READ: reading register eax
Dr.M # 0 USER32.dll!GetClipboardData +0x2a (0x772a9f47 <USER32.dll+0x59f47>)
Dr.M # 1 Clipboard_Tests::ReadAsciiStringFromClipboard [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\tests\app_suite\ntuser_tests_win.cpp:77]
Dr.M # 2 Clipboard_Tests::NtUserTests_ClipboardPutGet_Test::TestBody [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\tests\app_suite\ntuser_tests_win.cpp:90]
Dr.M # 3 testing::internal::HandleSehExceptionsInMethodIfSupportedtesting::Test,void [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2075]
Dr.M # 4 testing::internal::HandleExceptionsInMethodIfSupportedtesting::Test,void [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2126]
Dr.M # 5 testing::Test::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2162]
Dr.M # 6 testing::TestInfo::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2338]
Dr.M # 7 testing::TestCase::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2445]
Dr.M # 8 testing::internal::UnitTestImpl::RunAllTests [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:4237]
Dr.M # 9 testing::internal::HandleSehExceptionsInMethodIfSupportedtesting::internal::UnitTestImpl,bool [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2075]
Dr.M #10 testing::internal::HandleExceptionsInMethodIfSupportedtesting::internal::UnitTestImpl,bool [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2126]
Dr.M #11 testing::UnitTest::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:3874]
Dr.M Note: @0:00:07.421 in thread 3696
Dr.M Note: instruction: cmp 0x08(%ebp) %eax
Dr.M
Dr.M Error #2: UNINITIALIZED READ: reading register esi
Dr.M # 0 KERNELBASE.dll!GlobalAlloc +0x4a (0x77424416 <KERNELBASE.dll+0x14416>)
Dr.M # 1 USER32.dll!SetSysColors +0x1c0 (0x772bff21 <USER32.dll+0x6ff21>)
Dr.M # 2 USER32.dll!GetClipboardData +0x39e (0x772aa2bc <USER32.dll+0x5a2bc>)
Dr.M # 3 Clipboard_Tests::ReadAsciiStringFromClipboard [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\tests\app_suite\ntuser_tests_win.cpp:77]
Dr.M # 4 Clipboard_Tests::NtUserTests_ClipboardPutGet_Test::TestBody [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\tests\app_suite\ntuser_tests_win.cpp:90]
Dr.M # 5 testing::internal::HandleSehExceptionsInMethodIfSupportedtesting::Test,void [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2075]
Dr.M # 6 testing::internal::HandleExceptionsInMethodIfSupportedtesting::Test,void [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2126]
Dr.M # 7 testing::Test::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2162]
Dr.M # 8 testing::TestInfo::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2338]
Dr.M # 9 testing::TestCase::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2445]
Dr.M #10 testing::internal::UnitTestImpl::RunAllTests [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:4237]
Dr.M #11 testing::internal::HandleSehExceptionsInMethodIfSupportedtesting::internal::UnitTestImpl,bool [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2075]
Dr.M Note: @0:00:07.421 in thread 3696
Dr.M Note: instruction: cmp %esi %edi
Dr.M
Dr.M Error #3: UNINITIALIZED READ: reading 0x00dbf540-0x00dbf544 4 byte(s) within 0x00dbf540-0x00dbf544
Dr.M # 0 system call NtUserCreateLocalMemHandle parameter value #2
Dr.M # 1 USER32.dll!GetClipboardData
Dr.M # 2 Clipboard_Tests::ReadAsciiStringFromClipboard [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\tests\app_suite\ntuser_tests_win.cpp:77]
Dr.M # 3 Clipboard_Tests::NtUserTests_ClipboardPutGet_Test::TestBody [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\tests\app_suite\ntuser_tests_win.cpp:90]
Dr.M # 4 testing::internal::HandleSehExceptionsInMethodIfSupportedtesting::Test,void [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2075]
Dr.M # 5 testing::internal::HandleExceptionsInMethodIfSupportedtesting::Test,void [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2126]
Dr.M # 6 testing::Test::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2162]
Dr.M # 7 testing::TestInfo::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2338]
Dr.M # 8 testing::TestCase::Run [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2445]
Dr.M # 9 testing::internal::UnitTestImpl::RunAllTests [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:4237]
Dr.M #10 testing::internal::HandleSehExceptionsInMethodIfSupportedtesting::internal::UnitTestImpl,bool [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2075]
Dr.M #11 testing::internal::HandleExceptionsInMethodIfSupportedtesting::internal::UnitTestImpl,bool [e:\b\build\slave\win_7_x64_drm_checkout\drmemory\third_party\googletest\src\gtest.cc:2126]
Dr.M Note: @0:00:07.452 in thread 3696
[ OK ] NtUserTests.ClipboardPutGet (203 ms)

Original issue: http://code.google.com/p/drmemory/issues/detail?id=734

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on January 06, 2012 07:34:00

forget the one-in-three: these show up in dbg and rel full mode, since r697 ( issue #732 ) but no clear connection with that. can't repro on my own win7 machines.

@derekbruening
Copy link
Contributor Author

From zhao...@google.com on January 06, 2012 07:50:53

I can reproduce it on my machine.

Owner: zhao...@google.com

@derekbruening
Copy link
Contributor Author

From zhao...@google.com on January 06, 2012 10:58:49

The first error:

Dr.M
Dr.M Error #1: UNINITIALIZED READ: reading register eax
Dr.M # 0 USER32.dll!GetClipboardData +0x2a (0x76c69f47 <USER32.dll+0x59f47>)
...
Dr.M Note: @0:00:12.427 in thread 3728
Dr.M Note: instruction: cmp 0x08(%ebp) %eax

According to the code: the eax was from [ebp-0x2c], which should be initialized in 0x76c87cd7,
which performs a system call with syscall number: 0x10f9.

USER32!GetClipboardData:
...
76c69f26 8d45d4 lea eax,[ebp-0x2c]
76c69f29 50 push eax
76c69f2a ff7508 push dword ptr [ebp+0x8]
76c69f2d e8a5dd0100 call USER32!EmptyClipboard+0x1e (76c87cd7)
...
76c69f42 8b45d4 mov eax,[ebp-0x2c]
76c69f45 53 push ebx
76c69f46 56 push esi
76c69f47 394508 cmp [ebp+0x8],eax

0x76c87cd7:
76c87cd7 b8f9100000 mov eax,0x10f9
76c87cdc b900000000 mov ecx,0x0
76c87ce1 8d542404 lea edx,[esp+0x4]
76c87ce5 64ff15c0000000 call dword ptr fs:[000000c0]
76c87cec 83c404 add esp,0x4
76c87cef c20800 ret 0x8

@derekbruening
Copy link
Contributor Author

From zhao...@google.com on January 06, 2012 11:11:38

Second error:

Dr.M
Dr.M Error #2: UNINITIALIZED READ: reading register ecx
Dr.M # 0 ntdll.dll!RtlAllocateHeap +0xee (0x77dee114 <ntdll.dll+0x2e114>)
Dr.M # 1 ntdll.dll!WinSqmSetIfMaxDWORD +0x74 (0x77e31f0d <ntdll.dll+0x71f0d>)
...
Dr.M Note: instruction: cmp %ecx 0x77ec2088

77dee114 3b0d8820ec77 cmp ecx,[ntdll!NlsAnsiCodePage+0x2078 (77ec2088)]
77dee11a 0f8535ec0700 jne ntdll!CsrVerifyRegion+0xf1 (77e6cd55)
77dee120 c3 ret

77e31ed5 53 push ebx
77e31ed6 8b5d0c mov ebx,[ebp+0xc]
77e31ed9 56 push esi
77e31eda 8b7308 mov esi,[ebx+0x8]
77e31edd 33358820ec77 xor esi,[ntdll!NlsAnsiCodePage+0x2078 (77ec2088)]
77e31ee3 57 push edi
77e31ee4 8b06 mov eax,[esi]
77e31ee6 c645ff00 mov byte ptr [ebp-0x1],0x0
77e31eea c745f801000000 mov dword ptr [ebp-0x8],0x1
77e31ef1 8d7b10 lea edi,[ebx+0x10]
77e31ef4 83f8fe cmp eax,0xfffffffe
77e31ef7 0f854b150200 jne ntdll!RtlUlonglongByteSwap+0x16058 (77e53448)
77e31efd 8b4e0c mov ecx,[esi+0xc]
77e31f00 8b4608 mov eax,[esi+0x8]
77e31f03 03cf add ecx,edi
77e31f05 330c38 xor ecx,[eax+edi]
77e31f08 e807c2fbff call ntdll!RtlAllocateHeap+0xee (77dee114)

The error may come from many places including: [eax+edi], edi, or [esi+0xc]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant