New issue
Advanced search Search tips

Issue 717928 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Jul 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

State leak in unit tests

Reported by oleg...@yandex-team.ru, May 3 2017

Issue description

When some unit tests which initialize ServiceManagerConnection are executed sequentially like this:
unit_tests --gtest_filter=DeclarativeContentActionTest.ShowPageAction:RequestContentScriptTest.MissingScripts
DCHECK in service_manager_connection_impl.cc(408) fails:
[11281:11281:0420/181735.782814:786677145905:FATAL:service_manager_connection_impl.cc(408)] Check failed: !g_connection_for_process.Get(). 
#0 0x7fb198d8fadb base::debug::StackTrace::StackTrace()
#1 0x7fb198d8e7dc base::debug::StackTrace::StackTrace()
#2 0x7fb198e01ef3 logging::LogMessage::~LogMessage()
#3 0x7fb1939a2e42 content::ServiceManagerConnection::SetForProcess()
#4 0x7fb194caabcc content::ServiceManagerContext::ServiceManagerContext()
#5 0x00000374982f content::TestServiceManagerContext::TestServiceManagerContext()
#6 0x000003728365 content::InProcessUtilityThreadHelper::InProcessUtilityThreadHelper()
#7 0x00000186b06d extensions::ExtensionServiceTestBase::ExtensionServiceTestBase()
#8 0x0000015d435f extensions::(anonymous namespace)::RequestContentScriptTest::RequestContentScriptTest()
...
 

Comment 1 by ajha@chromium.org, May 10 2017

Components: Tests
Project Member

Comment 2 by bugdroid1@chromium.org, May 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5ffddc43be38516f89c6c631872285324778eb39

commit 5ffddc43be38516f89c6c631872285324778eb39
Author: olegmax <olegmax@yandex-team.ru>
Date: Mon May 15 08:26:12 2017

Isolate tests that initialize ServiceManagerConnection

Some unit tests initialize ServiceManagerConnection and leave it initialized
(e.g. in RenderProcessHostImpl::InitializeChannelProxy). On the other hand,
tests that use TestServiceManagerContext/ServiceManagerContext expect
ServiceManagerConnection to be unitialized on test start or
DCHECK(!g_connection_for_process.Get()) fails.
Change to explicitly uninitialize ServiceManagerConnection on creation of
TestServiceManagerContext.

BUG= 717928 ,697217

Review-Url: https://codereview.chromium.org/2861503003
Cr-Commit-Position: refs/heads/master@{#471696}

[modify] https://crrev.com/5ffddc43be38516f89c6c631872285324778eb39/content/public/test/test_service_manager_context.cc

This issue is resolved by commit in previous comment. I don't have rights to change issue status.
Labels: Needs-Feedback
As per the comment #3 please confirm can we change the issue status to fixed ?

Thanks,
Yes, as for me it is fixed.
Project Member

Comment 6 by sheriffbot@chromium.org, Jul 20 2017

Cc: kavvaru@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "kavvaru@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -kavvaru@chromium.org
Status: Fixed (was: Unconfirmed)
Thanks for the quick update.Marking it as fixed as per comment #5

Sign in to add a comment