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 #864

Open
griffinmacias opened this issue May 5, 2016 · 35 comments
Open

Internal Error: Illegal Access #864

griffinmacias opened this issue May 5, 2016 · 35 comments

Comments

@griffinmacias
Copy link

griffinmacias commented May 5, 2016

Node version 6.0.0
Node Inspector 0.12.8
Express 4.13.4

screen shot 2016-05-05 at 9 37 54 am

  1. node-debug app.js
  2. open the inspector and press play
  3. open the localhost:3000
  4. works then set breakpoint on 'res.send() line';
  5. reload localhost:3000
  6. internal error: illegal access

I am aware of the issue #413 and my issue might be related. Why am I getting this error, I am not able to set a breakpoint anywhere.

@LeandroFavero
Copy link

Same problem, and happens only with Node 6.0

@chippawah
Copy link

Same here.

@theHazzard
Copy link

Same Problem

@MKHenson
Copy link

MKHenson commented May 5, 2016

Same here

@wokalski
Copy link

wokalski commented May 8, 2016

I have this issue only if I try to debug ES6 code. I run node-inspector and then invoking babel-node debug -- myscript.js. It breaks on the first line of a script and everything seems fine, but then it hangs and after some times outputs the error message.

Do you know any workarounds?


Sorry for any misleading thoughts. I'm completely new to the whole js stack.

@rcosnita
Copy link

As a work around you can use --debug-brk argument which will enable a breakpoint on the first line of the script you run. Your debug session will work as expected.

@griffinmacias
Copy link
Author

Thanks @rcosnita, that works

@theHazzard
Copy link

it didn't work for me
every time that I try to debug inside a callback from requestjs it throws Illegal Access

@bmcswee
Copy link

bmcswee commented May 13, 2016

Also not working for me - already using --debug-brk.

Error gets thrown no matter where I put my breakpoint.

@alfg
Copy link

alfg commented May 13, 2016

Same problem here. Node 6+ when setting breakpoint on a callback.

@griffinmacias griffinmacias reopened this May 13, 2016
@jaredwy
Copy link

jaredwy commented May 13, 2016

As part of my work i've had to track down what was causing this issue in our setup (not node, but we use node inspector). The culmination of that investigation was https://bugs.chromium.org/p/v8/issues/detail?id=5010.The symptoms were the same, and as @rcosnita they seemed to improved when using --debug-brk in some cases. So i suspect they are likely the same, im going to start looking to fix this on monday.

@blake-regalia
Copy link

Same error here on node v6.1.0 & node-inspector v0.12.8; using --debug-break

As @alfg noted, it only happens (for me at least) when the breakpoint is within a callback that is reached after a different breakpoint outside the callback is encountered. Trying now to make a reproducible example

@blake-regalia
Copy link

Got it. It happens when trying to inspect a variable that is the result from calling bind on a function:

let crash_inspector = (function(){}).bind({});
debugger;

To prove that inspecting it is the culprit, you can see it happen like this:

(() => {
    let try_to_inspect_this_variable = {
        crash_inspector: (function(){}).bind({}),
    };
    debugger;
})();

@jaredwy
Copy link

jaredwy commented May 14, 2016

Yup. I've got a patch in progress for v8. Will update this issue as it lands.

@theHazzard
Copy link

Hi!

it always throws while debugging inside a request callback

const request = require('request');

request.get('http://www.google.com', (err, res, body) => {
    debugger;
});

@eugenioclrc
Copy link

+1

@blake-regalia
Copy link

This is a v8 problem that was addressed with this commit:
v8/v8@246d5bb

Now you'll have to wait until this v8 dep appears in a node.js upgrade

@jaredwy
Copy link

jaredwy commented May 19, 2016

FYI I have informed node of the problem and they will pick up the patch when it lands on the right branch in v8.
On Thu, 19 May 2016 at 9:50 AM blake-regalia notifications@github.com
wrote:

This is a v8 problem that was addressed with this commit:
v8/v8@246d5bb
v8/v8@246d5bb

Now you'll have to wait until this v8 dep appears in a node.js upgrade


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#864 (comment)

@LeandroFavero
Copy link

I updated to 6.2.0, but there are other issue:

Cannot find module '/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.7.3/node-v48-darwin-x64/debug.node'

@wokalski
Copy link

@LeandroFavero remove node_modules and run npm install. (Or just remove the node-inspector module)

@superclarkk
Copy link

@wokalski That is not the answer. The v8 fix has not been integrated into node yet.

@theHazzard
Copy link

I'm still having the same issue with node 6.2, illegal access while
debugging inside of a request callback :(

Enzo Luis Stróngoli
NodeJS Developer
http://www.turismocity.com.ar http://www.turismocity.com.ar/
https://www.linkedin.com/in/enzostrongoli
https://www.linkedin.com/in/enzostrongoli

strongolienzo@gmail.com strongolienzo@gmail.com
enzo@turismocity.com enzo@turismocity.com

2016-05-19 12:02 GMT-03:00 Wojtek Czekalski notifications@github.com:

@LeandroFavero https://github.com/LeandroFavero remove node_modules and
run npm install. (Or just remove the node-inspector module)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#864 (comment)

@wokalski
Copy link

@superclarkk It is not a fix for illegal access, but it is a fix for @LeandroFavero issue, as far as I know.

@theHazzard
Copy link

sorry, I thought that was for this issue

Enzo Luis Stróngoli
NodeJS Developer
http://www.turismocity.com.ar http://www.turismocity.com.ar/
https://www.linkedin.com/in/enzostrongoli
https://www.linkedin.com/in/enzostrongoli

strongolienzo@gmail.com strongolienzo@gmail.com
enzo@turismocity.com enzo@turismocity.com

2016-05-19 14:30 GMT-03:00 Wojtek Czekalski notifications@github.com:

@superclarkk https://github.com/superclarkk It is not a fix for illegal
access, but it is a fix for @LeandroFavero
https://github.com/LeandroFavero issue, as far as I know.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#864 (comment)

@superclarkk
Copy link

@wokalski I have the same issue as @LeandroFavero and also the illegal access issue (I presume they are connected). Deleting and reinstalling all modules does not fix it.

@wokalski
Copy link

@superclarkk No, they are not connected afaik. I had this issue because I installed node-inspector with some version of node and used it with other. I'm sorry if my tip is misleading!

@nicobevilacqua
Copy link

Same problem here with node 6.2 and node-inspector 0.12.8

@jaredwy
Copy link

jaredwy commented May 23, 2016

nodejs/node#6928 is up that will include the v8 fix that is required to fix this.

@sunilalgos
Copy link

Am also facing same problem with node 6.2.0 and node-inspector 0.12.8 version. This is not working with --debug and -debug-brk flag too. Are there any alternatives in solving this problem like using earlier versions like so ? If possible please update me.

@kunal-mandalia
Copy link

Same as a bunch of other folk. Node 6.2.0, node-inspector 0.12.8.
Getting 'Internal error: illegal access' after running 'node-inspector' and 'node --debug-brk index.js' (or node --debug index.js) and setting a breakpoint on the following code:

var express = require('express');
var app = express();

app.get('/', function (req, res) {
  res.send('Hello World!'); <-- breakpoint set here
});

app.listen(3003, function () {
  console.log('Example app listening on port 3003!');
});

Hope the JavaScript Gods heed the call of the humble debuggers!

@mgol
Copy link

mgol commented Jun 3, 2016

Node 6.2.1 has been released and is supposed to fix this issue.

@kunal-mandalia
Copy link

kunal-mandalia commented Jun 3, 2016

I can confirm node 6.2.1 lets node-inspector work as expected 👍

lukesampson pushed a commit to ScoopInstaller/Scoop that referenced this issue Jun 4, 2016
# Notable changes

## Notable changes

* **buffer**: Ignore negative lengths in calls to `Buffer()` and `Buffer.allocUnsafe()`. This fixes a possible security concern (reported by Feross Aboukhadijeh) where user input is passed unchecked to the Buffer constructor or `allocUnsafe()` as it can expose parts of the memory slab used by other Buffers in the application. Note that negative lengths are not supported by the Buffer API and user input to the constructor should always be sanitised and type-checked. (Anna Henningsen) [#7051](nodejs/node#7051)
* **npm**: Upgrade npm to 3.9.3 (Kat Marchán) [#7030](nodejs/node#7030)
  - [`npm/npm@42d71be`](npm/npm@42d71be) [npm/npm#12685](npm/npm#12685) When using `npm ls <pkg>` without a semver specifier, `npm ls` would skip any packages in your tree that matched by name, but had a prerelease version in their `package.json`. ([@zkat](https://github.com/zkat))
  - [`npm/npm@f04e05`](npm/npm@df04e05) [npm/npm#10013](npm/npm#10013) `read-package-tree@5.1.4`: Fixes an issue where `npm install` would fail if your `node_modules` was symlinked. ([@iarna](https://github.com/iarna))
  - [`b894413`](npm/npm@b894413) [#12372](npm/npm#12372) Changing a nested dependency in an `npm-shrinkwrap.json` and then running `npm install` would not get up the updated package. This corrects that. ([@misterbyrne](https://github.com/misterbyrne))
  - This release includes `npm@3.9.0`, which is the result of our Windows testing push -- the test suite (should) pass on Windows now. We're working on getting AppVeyor to a place where we can just rely on it like Travis.
* **tty**: Default to blocking mode for stdio on OS X. A bug fix in libuv 1.9.0, introduced in Node.js v6.0.0, exposed problems with Node's use of non-blocking stdio, particularly on OS X which has a small output buffer. This change should fix CLI applications that have been having problems with output since Node.js v6.0.0 on OS X. The core team is continuing to address stdio concerns that exist across supported platforms and progress can be tracked at <nodejs/node#6980>. (Jeremiah Senkpiel) [#6895](nodejs/node#6895)
* **V8**: Upgrade to V8 5.0.71.52. This includes a fix that addresses problems experienced by users of node-inspector since Node.js v6.0.0, see <node-inspector/node-inspector#864> for details. (Michaël Zasso) [#6928](nodejs/node#6928)
enlight added a commit to debugworkbench/hydragon that referenced this issue Jun 8, 2016
There was a bug in the V8 version in Electron v1.1.0 that made debugging
the main process rather impractical because the `node-inspector` UI
often blew up with an `Internal Error: Invalid Acccess` error when a
breakpoint was hit in the main process.

Relevant `node-inspector` issue:
node-inspector/node-inspector#864
@rohitsi
Copy link

rohitsi commented Jun 16, 2016

After updating to node 6.2.1, was able to debug a strongloop app... Great work guys. Thanks a ton!

@aa6
Copy link

aa6 commented Jun 22, 2016

On node v6.2.1 I still have a problem debugging this code:

var Human = function(name)
{
    this.name = name
}
Human.prototype.speak = function(cb)
{
    console.log("My name is " + this.name)
}

var humanHandler =
{
    apply: function(target, this_arg, args) 
    {
        return new (Function.prototype.bind.apply(Human, [null].concat(Array.prototype.slice.call(args)))) 
    }
}

var ProxyHuman = new Proxy(function(){},humanHandler)

var tony = ProxyHuman("Tony")
tony.speak()

It gives Internal error: illegal access in the debugger if I resume script execution.

me@me:~/tst/openca$ node --version
v6.2.1
me@me:~/tst/openca$ node-inspector --version
Node Inspector v0.12.8
me@me:~/tst/openca$ node bug.js
My name is Tony
me@me:~/tst/openca$ node-debug bug.js
Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
Debugging `bug.js`

Debugger listening on port 5858

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests