brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Workaround for the Tern crash. #4196

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by dangoor Monday Jul 22, 2013 at 14:51 GMT Originally opened as https://github.com/adobe/brackets/pull/4533


Change the Acorn submodule to point to a branch in my repository that works around the crash by forcing a specific function to not be optimized by v8.

You'll need to run git submodule sync in order to switch the repository URL. I think you also need to follow this up with git submodule update.

I can reproduce the original crash reliably using this project. What I usually do to reproduce the crash is:

  1. open index.html
  2. open app.js
  3. type something like the code below, using ctrl-tab to switch between the two files frequently

var a = new Animation(elem, [
    [{opacity: "0.5"}, {opacity: "1.0"}],
    [{transform: "scale(0.5)"}, {transform: "scale(1)"}]
]);

It shouldn't actually matter what you type. Doing the frequent ctrl-tab switching causes a lot of reparsing of the polymer.min.js file which is actually the one that triggers the bug. You should be able to see the crash with the stock Brackets 27 and not with this workaround applied.

I did some performance testing of this fix. Without the fix, parsing polymer.min.js took an average of 268ms over 10 runs(1). With this fix, parsing polymer.min.js took an average of 287ms over 10 runs. So, the slowdown was only about 7% on that particular file.

The median without the fix was 279ms vs. 300ms with the fix which is again about 7%.

(1) it was actually 14 runs. There were 10 that completed and 4 that crashed. There were no crashes with the workaround in place.


dangoor included the following code: https://github.com/adobe/brackets/pull/4533/commits

core-ai-bot commented 3 years ago

Comment by dangoor Monday Jul 22, 2013 at 14:54 GMT


Also, for convenience, this is the actual change that fixes the crash.

core-ai-bot commented 3 years ago

Comment by gruehle Monday Jul 22, 2013 at 21:05 GMT


Looks good! Without this fix, I could get your example project to crash within a minute or two. With this fix, I haven't been able to get it to crash with about 10 minute of trying.