DynamoRIO / DynamoRIO/drmemory
System leaks in CreateEnvironmentBlock
- Dominant language
- C
- Stars
- 2.7k
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
_From [rnk@google.com](https://code.google.com/u/rnk@google.com/) on January 19, 2012 12:38:12_
Chromium has the following code in base::LaunchProcess for launching a process as another user:
```
if (!CreateEnvironmentBlock(&enviroment_block, options.as_user, FALSE))
return false;
BOOL launched =
CreateProcessAsUser(options.as_user, NULL,
const_cast(cmdline.c_str()),
NULL, NULL, options.inherit_handles, flags,
enviroment_block, NULL, &startup_info,
&process_info);
DestroyEnvironmentBlock(enviroment_block);
```
IMO it's pretty clear that environment_block is not leaked, yet we get these reports: http://build.chromium.org/p/chromium.fyi/builders/Windows%20Tests%20%28DrMemory%20full%29/builds/514/steps/memory%20test%3A%20base/logs/stdio ~~Dr.M~~ Error `#4`: LEAK 28 direct bytes 0x005aa1d0-0x005aa1ec + 840 indirect bytes
~~Dr.M~~ # 0 RPCRT4.dll!? +0x0 (0x75f00636 )
~~Dr.M~~ # 1 RPCRT4.dll!? +0x0 (0x75f00610 )
~~Dr.M~~ # 2 RPCRT4.dll!I_RpcAllocate
~~Dr.M~~ # 3 RPCRT4.dll!NDRCContextMarshall
~~Dr.M~~ # 4 RPCRT4.dll!NDRCContextMarshall
~~Dr.M~~ # 5 RPCRT4.dll!NDRCContextMarshall
~~Dr.M~~ # 6 RPCRT4.dll!NdrClientInitialize
~~Dr.M~~ # 7 RPCRT4.dll!? +0x0 (0x75fa015a )
~~Dr.M~~ # 8 SspiCli.dll!? +0x0 (0x75333478 )
~~Dr.M~~ # 9 SspiCli.dll!CredUnmarshalTargetInfo
~~Dr.M~~ `#10` SspiCli.dll!? +0x0 (0x75329b7a )
~~Dr.M~~ `#11` SspiCli.dll!? +0x0 (0x75329d21 )
~~Dr.M~~ `#12` SspiCli.dll!? +0x0 (0x75329d71 )
~~Dr.M~~ `#13` SspiCli.dll!CredUnmarshalTargetInfo
~~Dr.M~~ `#14` SspiCli.dll!? +0x0 (0x7532a448 )
~~Dr.M~~ `#15` profapi.dll!? +0x0 (0x7502324f )
~~Dr.M~~ `#16` profapi.dll!? +0x0 (0x750231e8 )
~~Dr.M~~ `#17` profapi.dll!? +0x0 (0x75022e40 )
~~Dr.M~~ `#18` profapi.dll!? +0x0 (0x7502225c )
~~Dr.M~~ `#19` USERENV.dll!CreateEnvironmentBlock
~~Dr.M~~ `#20` base::LaunchProcess [base\process_util_win.cc:316]
~~Dr.M~~ `#21` ProcessUtilTest_LaunchAsUser_Test::TestBody [base\process_util_unittest.cc:418]
~~Dr.M~~ `#22` testing::internal::HandleExceptionsInMethodIfSupportedtesting::Test,void [testing\gtest\src\gtest.cc:2145]
~~Dr.M~~
~~Dr.M~~ Error `#5`: LEAK 16 direct bytes 0x005b8a08-0x005b8a18 + 0 indirect bytes
~~Dr.M~~ # 0 RPCRT4.dll!? +0x0 (0x75f00636 )
~~Dr.M~~ # 1 RPCRT4.dll!? +0x0 (0x75f00610 )
~~Dr.M~~ # 2 RPCRT4.dll!RpcBindingFree
~~Dr.M~~ # 3 RPCRT4.dll!NdrConformantVaryingArrayBufferSize
~~Dr.M~~ # 4 RPCRT4.dll!RpcBindingSetAuthInfoExW
~~Dr.M~~ # 5 RPCRT4.dll!RpcBindingSetAuthInfoExW
~~Dr.M~~ # 6 RPCRT4.dll!RpcBindingFree
~~Dr.M~~ # 7 RPCRT4.dll!RpcBindingSetAuthInfoExW
~~Dr.M~~ # 8 RPCRT4.dll!I_RpcBindingCopy
~~Dr.M~~ # 9 RPCRT4.dll!NDRCContextMarshall
~~Dr.M~~ `#10` RPCRT4.dll!NDRCContextMarshall
~~Dr.M~~ `#11` RPCRT4.dll!NDRCContextMarshall
~~Dr.M~~ `#12` RPCRT4.dll!NdrClientInitialize
~~Dr.M~~ `#13` RPCRT4.dll!? +0x0 (0x75fa015a )
~~Dr.M~~ `#14` SspiCli.dll!? +0x0 (0x75333478 )
~~Dr.M~~ `#15` SspiCli.dll!CredUnmarshalTargetInfo
~~Dr.M~~ `#16` SspiCli.dll!? +0x0 (0x75329b7a )
~~Dr.M~~ `#17` SspiCli.dll!? +0x0 (0x75329d21 )
~~Dr.M~~ `#18` SspiCli.dll!? +0x0 (0x75329d71 )
~~Dr.M~~ `#19` SspiCli.dll!CredUnmarshalTargetInfo
~~Dr.M~~ `#20` SspiCli.dll!? +0x0 (0x7532a448 )
~~Dr.M~~ `#21` profapi.dll!? +0x0 (0x7502324f )
~~Dr.M~~ `#22` profapi.dll!? +0x0 (0x750231e8 )
~~Dr.M~~ `#23` profapi.dll!? +0x0 (0x75022e40 )
~~Dr.M~~ `#24` profapi.dll!? +0x0 (0x7502225c )
~~Dr.M~~ `#25` USERENV.dll!CreateEnvironmentBlock
~~Dr.M~~ `#26` base::LaunchProcess [base\process_util_win.cc:316]
~~Dr.M~~ `#27` ProcessUtilTest_LaunchAsUser_Test::TestBody [base\process_util_unittest.cc:418]
~~Dr.M~~ `#28` testing::internal::HandleExceptionsInMethodIfSupportedtesting::Test,void [testing\gtest\src\gtest.cc:2145]
~~Dr.M~~
~~Dr.M~~ Error `#6`: LEAK 2 direct bytes 0x005bd2f0-0x005bd2f2 + 0 indirect bytes
~~Dr.M~~ # 0 RPCRT4.dll!? +0x0 (0x75f00636 )
~~Dr.M~~ # 1 RPCRT4.dll!? +0x0 (0x75f00610 )
~~Dr.M~~ # 2 RPCRT4.dll!RpcBindingFree +0x62a (0x75f0ae96 )
~~Dr.M~~ # 3 RPCRT4.dll!NdrConformantVaryingArrayBufferSize +0x755 (0x75f10efe )
~~Dr.M~~ # 4 RPCRT4.dll!RpcBindingSetAuthInfoExW +0x620 (0x75f11cbe )
~~Dr.M~~ # 5 RPCRT4.dll!RpcBindingSetAuthInfoExW +0x5b7 (0x75f11c55 )
~~Dr.M~~ # 6 RPCRT4.dll!RpcBindingFree +0xf0f (0x75f0b77b )
~~Dr.M~~ # 7 RPCRT4.dll!RpcBindingSetAuthInfoExW +0x57f (0x75f11c1d )
~~Dr.M~~ # 8 RPCRT4.dll!I_RpcBindingCopy +0x35 (0x75f0b98b )
~~Dr.M~~ # 9 RPCRT4.dll!NDRCContextMarshall +0x21d (0x75f08314 )
~~Dr.M~~ `#10` RPCRT4.dll!NDRCContextMarshall +0x18b (0x75f08282 )
~~Dr.M~~ `#11` RPCRT4.dll!NDRCContextMarshall +0x150 (0x75f08247 )
~~Dr.M~~ `#12` RPCRT4.dll!NdrClientInitialize +0x124 (0x75f07116 )
~~Dr.M~~ `#13` RPCRT4.dll!? +0x0 (0x75fa015a )
~~Dr.M~~ `#14` SspiCli.dll!? +0x0 (0x75333478 )
~~Dr.M~~ `#15` SspiCli.dll!CredUnmarshalTargetInfo +0x156f (0x75324cb4 )
~~Dr.M~~ `#16` SspiCli.dll!? +0x0 (0x75329b7a )
~~Dr.M~~ `#17` SspiCli.dll!? +0x0 (0x75329d21 )
~~Dr.M~~ `#18` SspiCli.dll!? +0x0 (0x75329d71 )
~~Dr.M~~ `#19` SspiCli.dll!CredUnmarshalTargetInfo +0x288f (0x75325fd4 )
~~Dr.M~~ `#20` SspiCli.dll!? +0x0 (0x7532a448 )
~~Dr.M~~ `#21` profapi.dll!? +0x0 (0x7502324f )
~~Dr.M~~ `#22` profapi.dll!? ...
_Original issue: http://code.google.com/p/drmemory/issues/detail?id=757_
Contributor guide
Assessment
This issue has not been assessed yet.