Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal error: illegal access (debugging ES6 proxy) #413

Open
iliakan opened this issue Jul 29, 2014 · 26 comments
Open

Internal error: illegal access (debugging ES6 proxy) #413

iliakan opened this issue Jul 29, 2014 · 26 comments

Comments

@iliakan
Copy link

iliakan commented Jul 29, 2014

I'm using node-inspector for node 0.11.13

I start node --debug-brk ..., open node-inspector and enter the code in Chrome. Everything's fine.

Then I press 'Continue' in Chrome and, after some time, in console:

Internal error: illegal access

There is no stack at all.

Is there a way to trace communication with v8 to see at which stage it happened? It looks like a node-inspector bug.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@3y3
Copy link
Member

3y3 commented Jul 31, 2014

What is your node-inspector version?

@iliakan
Copy link
Author

iliakan commented Jul 31, 2014

node-inspector -v
v0.7.4

@3y3
Copy link
Member

3y3 commented Jul 31, 2014

Is "pause on uncaught errors" enabled?

@iliakan
Copy link
Author

iliakan commented Jul 31, 2014

Not enabled.

@3y3
Copy link
Member

3y3 commented Jul 31, 2014

Ok, how I explain current situation:
Application was loaded and paused on first line. After that you start execution and application terminates with error Internal error: illegal access.
Are you think that reason for this error is attached inspector?
Or problem is in not displayed error stack?
You can't see stack trace bacause this is Uncaught error.
You can try to enable "pause on uncaught errors" - is this helpful?


А вообще я бы предпочел разобраться с этим на русском языке через почту 3y3@bk.ru

@iliakan
Copy link
Author

iliakan commented Jul 31, 2014

The application does not terminate.
Web interface of Node Inspector terminates.

And yes, there is no stack.

P.S. Right now the code has changed quite a bit, when I see the problem the next time, I can try pause on uncaught errors or do something else if you recommend.

@iliakan
Copy link
Author

iliakan commented Aug 5, 2014

@3y3 I made the commit for you: https://github.com/iliakan/javascript-nodejs/commit/d539f298644bfd0eaaa75e9cb8cd1d86843110c3

Probably, the project can be cleared off most stuff to demonstrate the error, but I believe you can easily run it as it is.

To see the error:

  1. Install and run the project, see https://github.com/iliakan/javascript-nodejs/blob/master/Install.md (in Russian).
  2. Run node-inspector, open node-inspector browser window.
  3. Go http://127.0.0.1:3000/

You should see the error like this: http://ilyakantor.ru/screen/2014-08-05_2155.png

@unbornchikken
Copy link

I having the same issue. I already figured out that there is related to harmony proxies. If I place a breakpoint to a position where the current scope is behind a proxy call, in the call stack I can see many "Illegal access" lines. I think this issue is not related to node-inscpector, because I cannot debug my harmony Proxy based code in JetBrains Web Storm also, the above error happens,

@iliakan
Copy link
Author

iliakan commented Aug 9, 2014

The Illegal access is indeed coming from proxies. On my codepath though, there seem to be no proxies.

@3y3
Copy link
Member

3y3 commented Aug 9, 2014

@unbornchikken , can you post example of code?

@3y3
Copy link
Member

3y3 commented Aug 9, 2014

@iliakan , I forked you commit and try to find the problem.

@unbornchikken
Copy link

Hello,

Of course, here it goes: http://1drv.ms/XSR4Qc

I've created a simple mocha unit test to reproduce this issue.

steps to reproduce:

npm install -g mocha
unarchive my repro project to a folder
npm install
launch node-inspector
mocha --debug-brk --harmony index
switch to node-inspector, refresh page, put a breakpoint to index.js line 11
launch debugging
nothing happens, debugging hangs up (except there should be an error message in the node.js console that says: illegal access buff)
pause debugging
red Internal error: Illegal access will appear in the node-inspector console

Cheers,
chikk

@unbornchikken
Copy link

Almost forgot: node version is 0.11.13

@unbornchikken
Copy link

It seems it's a v8 issue. I've opened it there:

https://code.google.com/p/v8/issues/detail?id=3510

@iliakan
Copy link
Author

iliakan commented Aug 29, 2014

The V8 team is not going to fix that any time soon (https://code.google.com/p/v8/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20HW%20OS%20Area%20Stars&groupby=&sort=&id=3510)

Proxy breaks node-inspector, making things non-debuggable, so I'd suggest to evade Proxy in code now. That's mostly possible. And there's something node-inspector could do here, better than just diy with a strange error.

I'd suggest that node-inspector should catch this kind of error (is it possible)? And console.log a descriptive message, something like 'ES6 Proxy are not debuggable in V8 yet', and, if possible saying where the offending Proxy is (to get rid of it).

Doable?

@3y3
Copy link
Member

3y3 commented Sep 1, 2014

@iliakan , can you confirm, that your project also has problems by reason of Proxy? (I forked your commit, but I can't start it - npm install fails on javascript-parser, but I see what you use --harmony flag)

About fixing: I have in plans switch to Blink object serialization algorithm, in other words - rewrite current place that emit this error. But it's not a small fix - is's a big job.
Also Node Inspector current target is "work same as Blink Dev Tools", but not "work better than Blink Dev Tools", therefore this fix has low priority for me.

@iliakan
Copy link
Author

iliakan commented Sep 1, 2014

I would guess so. The error message looks like Proxy error.
I've reported an issue to koa-passport, that's the only place in the project which uses Proxy, hopefully @rkusa will fix it.

@bajtos bajtos changed the title Internal error: illegal access Internal error: illegal access (debugging ES6 proxy) Dec 18, 2014
@MeanwhileMedia
Copy link

Thanks, this issue shed some light on my mystery problem. Have subscribed. Fingers crossed for some future compatibility fixes.

@bajtos
Copy link
Member

bajtos commented Jan 13, 2015

FWIW, the upcoming io.js 1.0.0 release should ship a much more recent version of V8, you should give it a try and see if the issue has been fixed. https://iojs.org/

@metamatt
Copy link

This is a V8 problem (in its runtime debugger/reflection APIs), not a node-inspector problem per se.

For a project I work on, we patched the following functions in V8: Runtime_GetLocalPropertyNames, Runtime_GetLocalElementNames, Runtime_DebugGetProperty, Runtime_DebugConstructedBy to deal better with JSProxy, then rebuilt node from the patched source.

Those are the V8 3.14 (node 0.10.x) functions and they don't exist under those names in V8 3.28 (node 0.12.0), but I don't think the issue has actually been fixed as of V8 3.28. I haven't tried io.js. I did just try a quick test of node 0.12.0 with Proxy and node-inspector and still see Illegal access exceptions.

@MeanwhileMedia
Copy link

Thanks for that info @metamatt
I guess our only hope is to wait for a V8 fix. However, even when that happens, we will need node-inspector to support io.js so we can get at the newest v8. Looks like that may come just in time (#523)!

@benmarten
Copy link

I just ran into this problem... Is there any fix yet?

@egalpin
Copy link

egalpin commented Jun 6, 2016

Was also seeing this error, but based on this node-inspector issue thread, I upgraded to node 6.2.1 and the issue was resolved.

If you have the ability to upgrade to 6.2.1, it might be worth a try. Not sure how related the 2 issues are.

@huanghaiyang
Copy link

same problem.
node version v6.2.0

@mhcho-dev
Copy link

This happens on Chrome browser's debugger! with Proxy Object.

@iyobo
Copy link

iyobo commented May 6, 2017

Just verified that this is be resolved in node 7.7+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

12 participants