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

Sails 0.12.0-rc6 debug error : Segmentation fault #3538

Closed
chirag200666 opened this issue Feb 1, 2016 · 9 comments
Closed

Sails 0.12.0-rc6 debug error : Segmentation fault #3538

chirag200666 opened this issue Feb 1, 2016 · 9 comments

Comments

@chirag200666
Copy link

When I am running sails with node-inspector then I am getting Segmentation fault error.
I ran the sails app using the command : node --debug app.js
and ran node inspector using node-inspector
The app is lifted and the bootstrap code runs but after that it gives the segmentation fault error

I also tried the debugging using the command node-debug app.js --save-live-edit=true
here the debugger is started, since the default breakpoint being set to the first line of app.js it stops there, after continuing runs on few files and then it is detaches from the app.

Then I setup breakpoints in the code by writing debugger and run the app using sails debug , the app lifts, but when I try to access the url of controller where I set the breakpoint the app crashes without giving any error.

Using sails version : 0.12.0-rc6
Node version : 4.2.6

I updated sails to rc6 version because of grunt issue( #2670 ) in the 0.11.4 version.

@sgress454
Copy link
Member

Hi @chirag200666, thanks for the report. It's hard to say what's going on without more information. Would you mind setting up a repo that reproduces this in a new sails app?

e.g.:

sails new sails-issue-3538
cd sails-issue-3538
# Now make whichever are the simplest/quickest changes which reproduce the issue,
# and when you for sure have the issue isolated, run:
git init
hub create  # or use the GitHub UI to create the repo and `git remote add` it manually
git add .
git commit -am 'Reproduces https://github.com/balderdashy/sails/issues/3538'
git push -u origin master
hub browse # or open the repo in your browser manually
# Then copy the URL of the new repo and paste it as a comment on this issue.
# We'll check it out, and since this way we'll be able to experience the problem
# ourselves, we should have no problem getting to the bottom of it.

Thanks!

@LongSteve
Copy link

I hit this same issue today. I think it's related to this Node issue nodejs/node#4440

One comment says that if you roll back to Node v4.2.4, that fixes the issue, but that might be awkward depending upon how you install Node.

In Sails, I got around the issue by setting inspect:false in my log config. But, since that can be useful when running normally, I actually did this in log.js:

var inspectOk = !(typeof v8debug === 'object');
module.exports = {
  log: {
    inspect: inspectOk
  }
}

This turns the inspect feature off when running in the debugger

chirag200666 added a commit to chirag200666/sails-issue-3538 that referenced this issue Feb 5, 2016
@chirag200666
Copy link
Author

Hi @sgress454
I created the issue repo : https://github.com/chirag200666/sails-issue-3538
using node-inspector while debugging the app should give the error.

To replicate the issue I had created an api and added a create query in bootstrap.js (somethings like User.create({'name':'Ram'}).exec( console.log); ) and then the segmentation fault issue occurs. Few observations I made, when I keep bootstrap.js empty the issue doesn't come, when I remove console.log from bootstrap.js then the issue doesn't come, hope it helps.
using node version: 4.2.6

Thanks

@chirag200666
Copy link
Author

@LongSteve changing the log.js file ( config/log.js ?) didn't fix the issue for me. But downgrading node to 4.2.4 allows me to debug, thanks for your help.

@mikermcneil
Copy link
Member

@LongSteve thanks for the tip, and the link to the issue in Node. That helps a ton.

@chirag200666 really appreciate the repro-- and thanks for trying this out w/ 4.2.4! Unfortunate that the log config fix doesn't solve it. Looks like Myles pushed a fix in Node core, so this should be resolved again soon.

@mikermcneil
Copy link
Member

To summarize for anyone reading this, if you run into this error, the solution (as of Friday February 5th, 2016) is to downgrade to node version 4.2.4.

Will keep this open until nodejs/node#4819 in Node core is merged and published, and we've confirmed that the new version solves this problem.

@sgress454
Copy link
Member

nodejs/node#4819 has been merged. Not published yet, but should be in the next release.

@sgress454
Copy link
Member

Node 5.6.0 was released yesterday. It doesn't list this specific issue in the changelog, but that doesn't mean it didn't make it in. Would someone mind checking with the new Node and seeing if the issue persists?

@sgress454
Copy link
Member

Update: works for me w/ Node 5.6.0 (I was able to repro w/ 4.2.6). If anyone still has problems, feel free to post here and we'll re-open.

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

No branches or pull requests

4 participants