-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
@@ -1247,7 +1247,7 @@ define(function (require, exports, module) { | |||
* We can clean up the web worker we use to calculate hints now, since | |||
* we know we will need to re-init it in any new project that is opened. | |||
*/ | |||
function closeWorker() { | |||
function closeWorker(quitting) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this function, perhaps, the param should be called terminate
or something like this. also, add @param
to the doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I forgot to add @param
since I was in a rush to set up the pull request for others to discuss. So don't land it yet even after I make the changes. Thanks for reviewing.
Closing since the actual crash is caused by callback_maps_ in the shell code. |
@peterflynn, @nethip Can you review and merge? |
@peterflynn Let us know if this PR looks good to you. |
@nethip My main concern is that we already know of at least one extension that uses worker threads and causes a crash, so fixing only our own usage of worker threads isn't enough to fully fix this. A secondary concern: because Raymond is unable to repro in cefclient yet, that means this may be caused by a bug in our brackets-shell code. If we don't fully understand the root cause of the bug, we don't know its scope: the same unfixed underlying bug may cause crashes in other scenarios too. |
@RaymondLim Continuing our discussion before about building a testcase to see if this is a cefclient issue... it sounds like we have two cases right now:
Since there are two variables that differ here, we don't know whether no crash in cefclient means the bug isn't present there, or if it just means that the much simpler testcase we're using in cefclient isn't enough to cause a crash. First, I think we should try to just run the same very simple testcase code in brackets-shell -- is it enough to cause a crash there? If so, then we know it's a valid repro case, and the lack of a crash in cefclient tells us something. But if it's not enough to crash brackets-shell, the next step is to build a testcase that does repro the crash. We can try to tackle that in two different ways:
|
@peterflynn I agree with you on getting this fixed from brackets-shell app side. I already started looking into it and I am trying to nail down to the actual bug. I am attacking this by replacing Brackets source files with that of CefClient and see if the crash goes away. After disabling app extensions and substituting client_handler, cef_main_window, cefclient_win and client_handler_win, with that of cefclient, the crash went away. So now I will have to nail down to the correct file to figure out which module is causing the crash. Looks like there is some new code that got added to 2171's cefclient's source. |
@peterflynn @RaymondLim And about the repro, I am able to consistently crash appshell on my laptop with my demo_script worker example. |
@peterflynn @RaymondLim I think I found the problem and the solution to that as well. I carefully looked at cefclient code and noticed that the destruction sequence is different to that of Bracket's. In cefclient, destruction does not happen at WM_DESTROY, rather in ClientHandler::OnBeforeClose(). Inside OnBeforeClose(), they call CefQuitMessageLoop(). Then I checked in Brackets about the same destruction sequence. Looks like we are handling WM_DESTROY and when this message is received we do a PostQuitMessage(). Upon removing this handling and calling CefQuitMessageLoop() in OnBeforeClose(), the crash is gone! I did some unit testing and this does not crash even with my demo_script worker example anymore. I have put up the same for review. Please review this Let me know your comments. |
This fixes issue #7683.