3.3.0 segmentation fault 11 on OSX
Node quits with "segmentation fault 11" when node-sass is required. I am using gulp-sass that depends on node-sass.
Mac OS X 10.10.5 node -v v2.3.0 npm -v 2.12.1
Reverting to 3.2.0 fixes the problem
:+1: I'm having the exact same issue
node -v
# v2.5.0
npm -v
# 2.13.2
I'm using it through gulp-sass though, so can't really revert.
My guess is that you need to delete your node_modules and do a clean install.
Sounds like your system has kept the v3.2.0 rather than downloading the updated v3.3.0 binary.
Nope, 3.3.0 is definitely causing the problem on my PC. Reverting 3.3.0 with 3.2.0 manually fixes the problem.
@bestander please follow our troubleshooting guide and create a gist with all the output.
We're unable to reproduce this issue.
I deleted my node_modules, and did a clean install. It shows segmentation fault 11 now.
If someone could produce a scss sample that produce that the segfault that would greatly help.
Sure will do.
I am using gulp-sass, so maybe the reason is that latest gulp-sass is not compatible with node-sass 3.3.0
Hm, in an isolated case it does not throw the error:
var sass = require('gulp-sass');
var gulp = require('gulp');
gulp.task('test', function () {
});
But in our production system with a large gulp script just having
var sass = require('gulp-sass');
Segfaults node with error.
npm -v
2.12.1
node -v
v2.3.0
node -p process.versions
{ http_parser: '2.5.0',
node: '2.3.0',
v8: '4.2.77.20',
uv: '1.6.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
modules: '44',
openssl: '1.0.2c' }
node -p process.platform
darwin
node -p process.arch
x64
I'll try to investigate more
It's not related to gulp-sass as I am currently using that without issue.
@xzyfer I'm using the sass-loader for Webpack, that uses node-sass, and 3.3.0 definitely crashes Node with Segmentation Fault: 11. Downgraded to 3.2.0 and voila, it works.
@eddiemoore @enriquecaballero @yizhan
Are you using node-sass via Gulp / Grunt, and which?
Please run the following commands
npm -v
node -v
node -p process.versions
node -p process.platform
node -p process.arch
By pure fluke I was able to reproduce this in a gulp watch task. The stacktrace for segfault is
PID 42935 received SIGSEGV for address: 0x46
0 segfault-handler.node 0x00000001013fa90f _ZL16segfault_handleriP9__siginfoPv + 287
1 libsystem_platform.dylib 0x00007fff8e80a5aa _sigtramp + 26
2 ??? 0x0000000103300450 0x0 + 4348445776
3 fse.node 0x00000001036ee616 _ZN3Nan3imp10GetWrapperIPFvRKNS_20FunctionCallbackInfoIN2v85ValueEEEENS0_15FunctionWrapperEEEPT0_T_ + 142
4 fse.node 0x00000001036eda40 _ZN3fse8FSEvents10InitializeEN2v86HandleINS1_6ObjectEEE + 194
5 node 0x0000000100601047 _ZN4node6DLOpenERKN2v820FunctionCallbackInfoINS0_5ValueEEE + 725
6 node 0x00000001001749ee _ZN2v88internal25FunctionCallbackArguments4CallEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEE + 158
7 node 0x000000010019c97b _ZN2v88internalL19HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateERNS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEE + 811
8 node 0x000000010019f1cd _ZN2v88internalL21Builtin_HandleApiCallEiPPNS0_6ObjectEPNS0_7IsolateE + 61
9 ??? 0x00001395f2e060bb 0x0 + 21534745845947
The culprit appears to fse.node which is part of the fsevents modules. This module is used in chokidar which in turn is use by many watchers like gulp and webpack.
I'm still digging into why node-sass is triggering this segfaulting behaviour in fsevents.
Some suspect things I've noticed with regards to fsevents.
- segmentation fault bug was fixed in the 0.3.7 release 26 days ago.
- they also converted to
nan@20.3.8 release 19 days ago.
Incase you still need it
node -v
# v2.5.0
npm -v
# 2.13.2
node -p process.versions
{ http_parser: '2.5.0',
node: '2.5.0',
v8: '4.2.77.21',
uv: '1.6.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
modules: '44',
openssl: '1.0.2d' }
node -p process.platform
# darwin
node -p process.arch
# x64
@eddiemoore are you experiencing this through a watcher or in a singe gulp run?
both. During a build and watch.
gulp.task('styles', () => {
return gulp.src('src/styles/**/*.scss')
.pipe($.sass().on('error', $.sass.logError))
.pipe(gulp.dest('dist/styles'))
})
Using gulp-load-plugins in case you are wondering what the $ is.
I've done some more digging and I believe this to be a bug in [email protected]. By locking to [email protected] I'm no longer able to reproduce this issue.
@enriquecaballero @eddiemoore @bestander can you please try the following:
Add this line as the first dependency on your package.json
"dependencies": {
"fsevents": "0.3.7"
Then delete your node_modules and do a fresh npm install.
@xzyfer That solves the issue for now. Just hope this will be fixed soon without having to do this.
Thanks @eddiemoore. That just helps confirm fsevents is the culprit. I've commented on their related issue https://github.com/paulmillr/chokidar/issues/219