-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Crash when trying to reload Brackets with or without extensions. #6422
Comments
Process: Brackets [11186] Date/Time: 2014-01-08 16:57:12.877 -0800 Interval Since Last Report: 372578 sec Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) VM Regions Near 0xc79c0a4f: Application Specific Information: Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread Thread 1:: Dispatch queue: com.apple.libdispatch-manager Thread 2:: NetworkConfigWatcher Thread 3:: DnsConfigService Thread 4:: Chrome_DBThread Thread 5:: Chrome_WebKitThread Thread 6:: Chrome_FileThread Thread 7:: Chrome_FileUserBlockingThread Thread 8:: Chrome_ProcessLauncherThread Thread 9:: Chrome_CacheThread Thread 10:: Chrome_IOThread Thread 11:: MediaStreamDeviceThread Thread 12:: NetworkConfigWatcher Thread 13:: BrowserBlockingWorker1/32259 Thread 14:: Chrome_DevToolsHandlerThread Thread 15:: Proxy resolver Thread 16:: com.apple.NSURLConnectionLoader Thread 17:: JavaScriptCore::BlockFree Thread 18:: JavaScriptCore::Marking Thread 19:: JavaScriptCore::Marking Thread 20:: JavaScriptCore::Marking Thread 21: Thread 22:: BrowserBlockingWorker2/94519 Thread 23: Thread 24: Thread 25: Thread 26:: WorkerPool/49651 Thread 27:: CVDisplayLink Thread 0 crashed with X86 Thread State (32-bit): Binary Images: |
My first crash was reproduced by using keyboard shortcuts, but I was able to reproduce the second crash with selecting menu items in the above steps. |
I'm not able to reproduce with the same steps (to be clear, you reload without extensions twice, then with extensions once, then without extensions twice, right?). Do you actually have any extensions installed? Maybe it depends on having an extension installed that adds some particular set of menu items. |
I'm still nailing down the exact steps. |
Mac OS 10.8.5. You can see it from the call stack also. |
Updated steps as I was able to reproduce with new steps twice. |
Still not able to repro even after cycling through those steps a few times. Do you have any extensions installed? |
@njx I do have multiple extensions including Emmet installed. After disabling all other extensions and leaving just Emmet does not cause the crash. So I'm nailing on which extensions or how many extensions with shortcuts registered to cause the crash. |
I can't repo on Mac or Win. Are you using menus, shortcuts, or both? |
@redmunds I don't think using menus or shortcuts is important. I can reproduce it with either one. That's why I just provided the steps with menus, but you can try it with shortcuts only and it will also be easier to reproduce. I think what is important is the number of extensions that register the keyboard shortcuts. |
Extensions that I have to reproduce the crash are Emmet, brackets-beautify, brackets-minifier, dkehrig.show-whitespace, mikaeljorhult.brackets-autoprefixer and some more. But I don't think the set of extensions does matter. What matters is the number of shortcuts (or menu items) registered by these extensions and having Emmet in the set is a must since it registers the most shortcuts (and menu items). |
@RaymondLim I installed all of the extensions you mentioned, including Emmet, and I still can't repro the problem. But since you can, if I write you a fix that makes sure the key bindings are removed when the menu items are removed, can you test it out for me and see if it fixes this issue? |
@lkcampbell Sure. |
Looking at the call stack and the crash message EXC_BAD_ACCESS, I think we're trying to remove something that is already removed or deallocated from memory. And I don't think it is due to something that we miss to remove or deallocate. @lkcampbell So can you make sure that when we "reload w/o extensions" (right after a regular reload) do we still have the correct list of menus and menu items to remove? |
I found out the real issue that is causing the crash. My dev tools console is showing an error loading Emmet extension and somehow I have a modified version of Emmet that will only work with services.widget approach we had for a research project in last August. After I reinstall the correct Emmet, I can't reproduce the crash any more. But we still need to consider whether we need to take care of the crash scenario in this issue. If an extension fails to load successfully and some menu items are registered, then how do we avoid a crash when reloading w/o extensions? |
@RaymondLim, all of these types of issues have, up to this point, been caused by the same problem and solved with the same process. Any changes that extensions create that are non-shell related will get reset as part of the reloading of the code. This reloading process is the same with or without extensions. The only difference is the definition of the paths of extension directories that are loaded up. Normal reload includes the dev and user paths and the "without extensions" reload does not. Any changes that extensions create that change the state of the Brackets Shell need to be explicitly wiped clean just prior to the reload. This assures that the default values replace the changes during the reload. So the question becomes, what change of the buggy Emmet code is "sticking around" in the Brackets Shell between reloads? What state data in the shell are not being cleared out? Not sure at this point. The code explicitly removes all menus, menu items, and menu dividers just prior to the reload. It does not, however, clear out key bindings, so that's the fix I want to try next. If you have theories on what other state data might be sticking around, let me know and we can look into explicitly clearing that data out as well. |
@RaymondLim, see #6411 (comment). |
Not only does Emmet have a lot of shortcuts, many of them conflict with core command shortcuts, so that may also be a factor. |
@RaymondLim thanks for the file. I will assign this to myself and take a look. I don't think this should be a show stopper for the Reload Without Extensions command since the main problem is a buggy extension, but if there is any way to improve the recovery from the extension I will add it. |
I added "extension problem" tag. Is this really "Mac only"? |
Removing "extension problem" since that tag is really intended to be used for bugs that are caused by specific (real) extensions, while this is really a bug that only (so far) has shown up in an unreleased, hacked-up version of Emmet that Raymond was using for prototyping. Marking low priority - @lkcampbell, please investigate, and if it turns out that this could happen in a wider set of circumstances, we could bump up the priority. |
@RaymondLim, I tried your corrupted file in the Emmet extension but I still can't repro this problem. I am going to need more info or better repro steps. Also, this isn't caused by issue #6452, is it? Are you doing two quick reloads in a row or allowing a pause between reloads? |
@lkcampbell I can't reproduce it either. Somehow I'm not seeing any error loading the corrupted Emmet extension in the console. Well. closing for now. |
Result: crash with the following call stack. And the crash usually happens when you reload w/o extensions in step 1.
The text was updated successfully, but these errors were encountered: