RuidSiel / chromiumembedded

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

CEF haphazardly crashes at CefShutdown #277

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I was unable to create a reliably reproducible scenario in cefclient.exe
For that matter, I am completely unable to make cefclient crash in this way. 
The bug, however, manifests quite readily in my custom application, which I 
cannot provide as a demonstration aid.

What is the expected output? What do you see instead?

CefShutdown() to complete successfully.
CefShutdown() causes a crash (sometimes!).

What version of the product are you using? On what operating system?

CEF r259. Windows 7 x64

Please provide any additional information below.

The problem is that when CEF is disposing of the last browser instance, it 
calls webkit_glue::ClearCache(), which requires the IO thread to still be 
alive. Sometimes, however, by the time the task posted by ClearCache on the IO 
thread is invoked, the IO thread itself is already dead.

I propose the following:

In CefContext::RemoveBrowser() allow the call to webkit_glue::ClearCache() to 
be executed immediately if we're already on the UI thread (which is the case 
when called "from" CefShutdown()), instead of being posted as a delayed task. 
In my testing this does the trick, although I am not 100% sure this is the 
ultimate solution.

Original issue reported on code.google.com by yyankov on 23 Jun 2011 at 11:42

Attachments:

GoogleCodeExporter commented 9 years ago
Here's the diagram fixed.

Original comment by yyankov on 23 Jun 2011 at 11:45

Attachments:

GoogleCodeExporter commented 9 years ago
DCHECK(g_io_thread) in browser_webblobregistry_impl.cc(94) is failed sometimes 
on shutdown (CEF r246).

Original comment by igor.ara...@gmail.com on 24 Jun 2011 at 12:57

GoogleCodeExporter commented 9 years ago
Re #2: Yes, we're talking about the same issue.

Original comment by yyankov on 24 Jun 2011 at 1:02

GoogleCodeExporter commented 9 years ago
@comment #1: Your diagram seems to suggest that 
WebCore::memoryCache()->setDisabled(true) posts a task to the IO thread. Can 
you explain where that task is being posted from?

(And thanks for the diagram! :-)

Original comment by magreenb...@gmail.com on 15 Jul 2011 at 8:46

GoogleCodeExporter commented 9 years ago
@#4: It is being posted from the UI thread, because webkit_glue::ClearCache is 
being run from the UI thread. Are you implying something doesn't add up?

And sorry for the late response. (insert usual excuses here)

(No, thank you for your awesome work!)

Original comment by yyankov on 21 Jul 2011 at 1:21

GoogleCodeExporter commented 9 years ago
Thanks, committed as revision 273 with minor changes.

Original comment by magreenb...@gmail.com on 3 Aug 2011 at 4:25

GoogleCodeExporter commented 9 years ago
Additional shutdown crash when exiting while loading resources fixed in 
revision 400.

Original comment by marsh...@spotify.com on 30 Nov 2011 at 5:00