anmar7889 / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

CEF3: [Mac] cefclient crashes on quit with single_process is enabled in debug mode #1182

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Precondition:
Problem is reproduced only in debug mode with single_process is enabled
Steps:
1. Update cefclient(sample application that goes along with 
cef_binary_3.1547.1412_macosx32) to make  single_process be enabled. The good 
place for this is main() from cefclient_mac.mm
2. Compile in debug mode and run cefclient
3. Quit cefclient 

What is the expected output? What do you see instead?
Actual behavior: app crashes on quit
Expected behavior: app safely quit

What version of the product are you using? On what operating system?
CEF 3.1547.1412_macosx32
Mac OSX 10.9.1

Please provide any additional information below.
Console output:

[0123/013942:WARNING:mac_util.mm(595)] Assuming Darwin 13 is Mac OS X 10.9
2014-01-23 01:39:42.480 cefclient[25675:303] Internals of CFAllocator not 
known; out-of-memory failures via CFAllocator will not result in termination. 
http://crbug.com/45650
[0123/013943:ERROR:proxy_service_factory.cc(88)] Cannot use V8 Proxy resolver 
in single process mode.
[0123/013947:FATAL:thread_restrictions.cc(38)] Function marked as IO-only was 
called from a thread that disallows IO!  If this thread really should be 
allowed to make IO calls, adjust the call to 
base::ThreadRestrictions::SetIOAllowed() in this thread's startup.
0   libcef.dylib                        0x0203d89f 
base::debug::StackTrace::StackTrace() + 63
1   libcef.dylib                        0x0203d83b 
base::debug::StackTrace::StackTrace() + 43
2   libcef.dylib                        0x020a3ccc 
logging::LogMessage::~LogMessage() + 76
3   libcef.dylib                        0x020a27cb 
logging::LogMessage::~LogMessage() + 43
4   libcef.dylib                        0x021a724e 
base::ThreadRestrictions::AssertIOAllowed() + 270
5   libcef.dylib                        0x021842b6 
base::PlatformThread::Join(base::PlatformThreadHandle) + 38
6   libcef.dylib                        0x0219c394 base::Thread::Stop() + 116
7   libcef.dylib                        0x0386657f 
content::RendererMainThread::~RendererMainThread() + 63
8   libcef.dylib                        0x038661eb 
content::RendererMainThread::~RendererMainThread() + 43
9   libcef.dylib                        0x0386623e 
content::RendererMainThread::~RendererMainThread() + 46
10  libcef.dylib                        0x0385d1d4 
base::DefaultDeleter<content::RendererMainThread>::operator()(content::RendererM
ainThread*) const + 68
11  libcef.dylib                        0x03866d46 
base::internal::scoped_ptr_impl<content::RendererMainThread, 
base::DefaultDeleter<content::RendererMainThread> >::~scoped_ptr_impl() + 70
12  libcef.dylib                        0x03866cdb 
base::internal::scoped_ptr_impl<content::RendererMainThread, 
base::DefaultDeleter<content::RendererMainThread> >::~scoped_ptr_impl() + 43
13  libcef.dylib                        0x03866c8b 
scoped_ptr<content::RendererMainThread, 
base::DefaultDeleter<content::RendererMainThread> >::~scoped_ptr() + 43
14  libcef.dylib                        0x0384c57b 
scoped_ptr<content::RendererMainThread, 
base::DefaultDeleter<content::RendererMainThread> >::~scoped_ptr() + 43
15  libcef.dylib                        0x038440ba 
content::RenderProcessHostImpl::~RenderProcessHostImpl() + 1034
16  libcef.dylib                        0x03843b6b 
content::RenderProcessHostImpl::~RenderProcessHostImpl() + 43
17  libcef.dylib                        0x03843b0e 
content::RenderProcessHostImpl::~RenderProcessHostImpl() + 46
18  libcef.dylib                        0x06631b2d 
CefContentRendererClient::RunSingleProcessCleanupOnUIThread() + 893
19  libcef.dylib                        0x0663160f 
CefContentRendererClient::RunSingleProcessCleanup() + 335
20  libcef.dylib                        0x06525245 
CefContext::FinalizeShutdown() + 69
21  libcef.dylib                        0x06524444 CefContext::Shutdown() + 676
22  libcef.dylib                        0x065240d1 CefShutdown() + 561
23  libcef.dylib                        0x002196c8 cef_shutdown + 40
24  cefclient                           0x00056f84 CefShutdown() + 36
25  cefclient                           0x00046aca main + 650
26  cefclient                           0x00002475 start + 53

Original issue reported on code.google.com by Alexande...@gmail.com on 22 Jan 2014 at 9:58

GoogleCodeExporter commented 9 years ago
any updates on this? I am seeing this on Mac OS X 10.8.3

I am using chromedriver to connect to CEF
    Driver info: chromedriver=2.9.248307,platform=Mac OS X 10.8.5 x86_64

Original comment by bino...@gmail.com on 16 Jul 2014 at 1:42

GoogleCodeExporter commented 9 years ago
This is a bug in Chromium and should be reported at http://crbug.com. CEF will 
get the fix after it is fixed in Chromium.

Original comment by magreenb...@gmail.com on 11 Feb 2015 at 8:03

GoogleCodeExporter commented 9 years ago
A (non-informed) drive-by comment:

Note that Chromium enables IO before shutting down the renderer during the 
teardown:
https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/brows
er_main_loop.cc&sq=package:chromium&type=cs&l=822

  // Teardown may start in PostMainMessageLoopRun, and during teardown we
  // need to be able to perform IO.
  base::ThreadRestrictions::SetIOAllowed(true);
  BrowserThread::PostTask(
      BrowserThread::IO, FROM_HERE,
      base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed),
                 true));

#if !defined(OS_IOS)
  if (RenderProcessHost::run_renderer_in_process())
    RenderProcessHostImpl::ShutDownInProcessRenderer();
#endif

I wonder if the same needs to be done in the 
CefContentRendererClient::RunSingleProcessCleanupOnUIThread
https://code.google.com/p/chromiumembedded/source/browse/trunk/cef3/libcef/rende
rer/content_renderer_client.cc

Also, note that the following code is not necessary:
  // Clear the run_renderer_in_process() flag to avoid a DCHECK in the
  // RenderProcessHost destructor.
  content::RenderProcessHost::SetRunRendererInProcess(false);
The DCHECK in question is long gone.

Calling RenderProcessHostImpl::ShutDownInProcessRenderer() to do the job 
(instead of doing it on your own) might help as well.

Original comment by aruslan@chromium.org on 24 Feb 2015 at 2:35

GoogleCodeExporter commented 9 years ago
Hi,

Same issue here. I tried to allow IO and several other things but without 
success. It always leads to a crash when exiting Chrome_InProcRendererThread. I 
must admit I am not comfortable with Chromium or CEF source code and I can't 
find a clear way to fix that bug. 

Marshall, you said this is a bug in Chromium but people from Google say this is 
a bug in CEF. Who is right?

Original comment by jer...@fl4re.com on 24 Feb 2015 at 9:51

GoogleCodeExporter commented 9 years ago
@#3: Thanks for the suggestions, re-opening this issue to try them out.

@#4: Are you referring to something other than comment #3?

Original comment by magreenb...@gmail.com on 24 Feb 2015 at 10:03

GoogleCodeExporter commented 9 years ago
I tried #3 but I'm absolutely not sure what I did was correct. I also tried to 
just comment base::ThreadRestrictions::AssertIOAllowed(); in 
PlatformThread::Join() like it is done for Windows.

Original comment by jer...@fl4re.com on 25 Feb 2015 at 11:09

GoogleCodeExporter commented 9 years ago
Any progress on this?

Original comment by jerome.j...@starbreeze.com on 9 Mar 2015 at 12:24

GoogleCodeExporter commented 9 years ago
CEF is transitioning from Google Code to Bitbucket project hosting. If you 
would like to continue receiving notifications on this issue please add 
yourself as a Watcher at the new location: 
https://bitbucket.org/chromiumembedded/cef/issue/1182

Original comment by magreenb...@gmail.com on 14 Mar 2015 at 3:29