node-sass: Webpack segmentation faults for newer versions of node-sass

I’ve been getting segmentation faults from Webpack for a project I work on. From what I have read, the cause of these segfaults is due to the version of node-sass being beyond version 3.4.2. By downgrading or pinning to 3.4.2, people have mitigated the segfaulting from reoccurring.

In the case of the developer who downgraded from 3.5.2 to 3.4.2, there are a small number of changes that were made to node-sass between these versions. It might be easier to pinpoint the offending change, though I’m not familiar enough with Webpack’s internals to pinpoint what changes could be causing these segfaults.

I am posting this here because the Webpack team has asked that I report it here instead.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 20 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@saper I’ve found a case where a segmentation fault occurs. I don’t know if it’s the same as what was causing @zg’s problem, but it consistently fails for me.

I believe I’ve found the minimum possible case. Anything left out of this causes a valid error message instead of a Segmentation fault.

Here’s the SCSS:

:not(.something) {
  @extend .something;
  cursor: pointer;
}

The cursor property can be anything but must be there to cause the segmentation fault. I tried updating node-sass like you said and the segmentation fault still happens.

Before I deleted everything, .something was defined, so this isn’t happening because that isn’t there. Adding a definition for .something to the code above still results in Segmentation fault.

The :not() selector wasn’t alone in my original code either. When I was deleting code I found that it doesn’t really matter what the selector looks like so long as the .something in the :not() is the same as the argument to @extend.

$ ./node_modules/.bin/node-sass --version
node-sass   3.9.3   (Wrapper)   [JavaScript]
libsass     3.3.6   (Sass Compiler) [C/C++]
$ ./node_modules/.bin/node-sass segfault.scss
Segmentation fault

Edit: The code compiles file with just sass (though the version is different from the one reported above)

$ sass --version
Sass 3.4.21 (Selective Steve)
$ sass segfault.scss
:not(.something) {
  cursor: pointer; }