Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367639 - 100% CPU trying to open file
Summary: 100% CPU trying to open file
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.4 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-30 00:59 EST by John J. Barton CLA
Modified: 2012-01-18 15:28 EST (History)
2 users (show)

See Also:


Attachments
quick profile screen shot (21.77 KB, image/png)
2011-12-30 00:59 EST, John J. Barton CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John J. Barton CLA 2011-12-30 00:59:27 EST
Created attachment 208863 [details]
quick profile screen shot

1.clone https://johnjbarton@github.com/johnjbarton/inspector.git
2.Open the navigator page, open twisty for front-end/ folder.
3.open inspector.html

In Chrome 17.0.963.12 dev-m, one CPU pegs and the window remains blank. I don't know if it is making progress.  

I opened a new tab, opened devtools, then pasted the inspector.html URL in. The window painted, I got the usual errors in the console, then 100% and nothing works.

Ok but I can profile, see attachment
Comment 1 John J. Barton CLA 2011-12-30 01:03:18 EST
I tried to uninstall jslintPlugin, but it won't go away.
Comment 2 Mark Macdonald CLA 2012-01-03 14:37:53 EST
This sounds like the same bug: https://github.com/douglascrockford/JSLint/issues/67 It's been fixed on jslint.com, but not in the version of JSLint that Orion uses.

A workaround is to move the copyright notice underneath the DOCTYPE.
Comment 3 John J. Barton CLA 2012-01-09 18:44:24 EST
The workaround works, except that you have to do it off-line (since you can't user Orion), and I can't commit the workaround back to the original source.

This problem is embarrassing because it means Cloud9 can edit Chrome devtools but Orion cannot edit it. What needs to be done to get the new version of JSLint installed?
Comment 4 Mark Macdonald CLA 2012-01-10 09:47:33 EST
(In reply to comment #3)

> This problem is embarrassing because it means Cloud9 can edit Chrome devtools
> but Orion cannot edit it. What needs to be done to get the new version of
> JSLint installed?

I agree, this pretty bad. We need to get legal approval to use the new version of JSLint. I've just kicked off the process.
Comment 5 Andrew Clement CLA 2012-01-17 19:37:21 EST
I've created a pull request for a patch that might address this in the current JSLint we are using - it addresses the referenced bug ( https://github.com/douglascrockford/JSLint/issues/67 ).  I tried it on the inspector project but I guess that has changed in the interim and no longer contains the trigger code for the problem.  The fix is once the error situation is reached, skip over the problem character rather than continuously spinning trying to process it.  I cannot say for certain there will be other subsequent parse issues once this problem state has been reached, but at least it won't spin and lock up the editor.

pull request is: https://github.com/eclipse/orion.client/pull/12

I know the longer term plan is upgrade jslint, but I created this to maybe help in the interim.
===
I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use.
Comment 6 Mark Macdonald CLA 2012-01-18 13:21:34 EST
(In reply to comment #5)
> I've created a pull request for a patch that might address this in the current
> JSLint we are using - it addresses the referenced bug (
> https://github.com/douglascrockford/JSLint/issues/67 ).  I tried it on the
> inspector project but I guess that has changed in the interim and no longer
> contains the trigger code for the problem.  The fix is once the error situation
> is reached, skip over the problem character rather than continuously spinning
> trying to process it.  I cannot say for certain there will be other subsequent
> parse issues once this problem state has been reached, but at least it won't
> spin and lock up the editor.
> 
> pull request is: https://github.com/eclipse/orion.client/pull/12
> 
> I know the longer term plan is upgrade jslint, but I created this to maybe help
> in the interim.

Hi Andy,

I'm fine with your changes. The JSLint upgrade probably won't make it into 0.4, so let's commit this fix.

There's one additional change we need though. In the header of jslintworker.js, after the line
>    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

Can you add a section listing the contributors to the file, like this:
>    Contributors:
>        Douglas Crockford - Original implementation
>        Andy Clement - Fix for Bug #367639

Thanks!
Comment 7 Andrew Clement CLA 2012-01-18 14:03:52 EST
I just added that additional change to the pull request, hope it is ok now.
Comment 8 Mark Macdonald CLA 2012-01-18 15:28:58 EST
(In reply to comment #7)
> I just added that additional change to the pull request, hope it is ok now.

Looks good. Pushed:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=7cdb1df648acc943ad9dcce2cc04e41de6c03a9f

(I squashed the changes into one commit for clarity, but kept you as the Author.) Thanks Andy.