Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

3.3.0 segmentation fault 11 on OSX #1107

Closed
bestander opened this issue Aug 26, 2015 · 47 comments
Closed

3.3.0 segmentation fault 11 on OSX #1107

bestander opened this issue Aug 26, 2015 · 47 comments

Comments

@bestander
Copy link

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

@bestander
Copy link
Author

Reverting to 3.2.0 fixes the problem

@eddiemoore
Copy link

👍 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.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

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.

@bestander
Copy link
Author

Nope, 3.3.0 is definitely causing the problem on my PC.
Reverting 3.3.0 with 3.2.0 manually fixes the problem.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

@bestander please follow our troubleshooting guide and create a gist with all the output.

We're unable to reproduce this issue.

@yizhan
Copy link

yizhan commented Aug 26, 2015

I deleted my node_modules, and did a clean install. It shows segmentation fault 11 now.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

If someone could produce a scss sample that produce that the segfault that would greatly help.

@bestander
Copy link
Author

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

@bestander
Copy link
Author

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

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

It's not related to gulp-sass as I am currently using that without issue.

@enriquecaballero
Copy link

@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.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

@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

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

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.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

Some suspect things I've noticed with regards to fsevents.

@eddiemoore
Copy link

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

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

@eddiemoore are you experiencing this through a watcher or in a singe gulp run?

@eddiemoore
Copy link

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.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

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.

@eddiemoore
Copy link

@xzyfer That solves the issue for now. Just hope this will be fixed soon without having to do this.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

Thanks @eddiemoore. That just helps confirm fsevents is the culprit. I've commented on their related issue paulmillr/chokidar#219

@vinkla
Copy link

vinkla commented Aug 26, 2015

Reverting to 3.2.0 from 3.3.0 solved this for me as well.

@eddiemoore
Copy link

Only thing is CodeShip CI can't install it.........

npm ERR! node v2.5.0
npm ERR! npm  v2.13.2
npm ERR! code EBADPLATFORM

npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

@xzyfer
Copy link
Contributor

xzyfer commented Aug 26, 2015

@eddiemoore make it an optionalDependency instead

  "optionalDependencies": {
    "fsevents": "0.3.7"
  },

@eddiemoore
Copy link

👍

@xzyfer
Copy link
Contributor

xzyfer commented Aug 27, 2015

@saper I don't know of a way to get remote access to an OSX machine, sorry.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 27, 2015

@saper libsass runs against osx in CI. Maybe you could hack together something to exploit that in PR?

@saper saper changed the title 3.3.0 segmentation fault 11 3.3.0 segmentation fault 11 on OSX Aug 27, 2015
@saper saper added the OS - OSX label Aug 27, 2015
@lomteslie
Copy link

Today I started getting the segmentation fault 11 issue. However, I'm running node-sass 3.2.0 with sass-loader for webpack. Based on this conversation it doesn't seem like that's possible. Am I losing my mind?

@vinkla
Copy link

vinkla commented Aug 27, 2015

@lomteslie Please see #1107 (comment)

@lomteslie
Copy link

@vinkla Thank you – That fixed it after reinstalling node modules.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 28, 2015

Yes unfortunately the issue isn't specific to node-sass but the underlying 3rd party library used for compiling native extensions like watchers used by grunt, gulp, webpack and karma. It just so happens node-sass manages to trigger this issue. We're working with the 3rd party library to get this resolved.

xzyfer added a commit to xzyfer/node-sass that referenced this issue Aug 29, 2015
This is to make sure binaries affected by
sass#1107 are never built
@saper saper modified the milestones: v3.3.2, next.patch Aug 29, 2015
@saper
Copy link
Member

saper commented Aug 29, 2015

This should now be fixed to the extent possible via #1110 and #1113

@saper saper closed this as completed Aug 29, 2015
am11 pushed a commit to am11/node-sass that referenced this issue Aug 29, 2015
This is to make sure binaries affected by
sass#1107 are never built
@xzyfer
Copy link
Contributor

xzyfer commented Aug 30, 2015

@sirrodgepodge
Copy link

Hey all, just wanted to say that in my experience this can sometimes be due to particular sass bugs and sometimes only cause seg faults in one OS (node-sass does different things dep on OS), one that's caused seg faul n Linux:
-using interpolation without variable, e.g. (this is kinda a user error in that #{} interpolation isn't necessary):

.example {
width: #{100%/3}
}

switched to:

.example {
width: 100%/3
}

fixes

Happened one other time when I was using an undeclared mixin

@mgreter
Copy link
Contributor

mgreter commented Oct 28, 2015

@sirrodgepodge segfaults are pretty much always a bug in libsass and if someone would have reported it as an issue, libsass team would have had a chance to fix it already ...

@xzyfer
Copy link
Contributor

xzyfer commented Oct 29, 2015

@sirrodgepodge this has been fixed in libsass and will be in the next node-sass version.

@spezticle
Copy link

I was experiencing this issue. Initially, I installed encfs with homebrew while my OS x version was Yosemite.
brew install homebrew/fuse/encfs

Everything worked fine until I upgraded to El Capitan, (begrudgingly). Then I experienced the segmentation fault 11. I uninstalled encfs:
brew uninstall homebrew/fuse/encfs --force encfs

and then reinstalled:
brew install homebrew/fuse/encfs

and everything worked fine again.

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

No branches or pull requests