node-sass: segmentation fault with sass-maps (linux only)

  • NPM version (npm -v): 3.10.8
  • Node version (node -v): 6.9.1
  • Node Process (node -p process.versions):
{ http_parser: '2.7.0',
  node: '6.9.1',
  v8: '5.1.281.84',
  uv: '1.9.1',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  icu: '56.1',
  modules: '48',
  openssl: '1.0.2j' }
  • Node Platform (node -p process.platform): linux
  • Node architecture (node -p process.arch): x64
  • node-sass version (node -p "require('node-sass').info"):
node-sass   3.10.1  (Wrapper)   [JavaScript]
libsass     3.3.6   (Sass Compiler) [C/C++]

How to reproduce:

This is my test file test.scss:

$maptest: (
    key: value
);

Now if I run node-sass test.scss I only get a segfault without further information.

This happens only on linux and not on my macOS with this exact same versions.

I need to go back to version 3.4.x to get it to work.

Edit: I corrected the example and removed the semicolon.

About this issue

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

Most upvoted comments

You can try this:

cd node_modules/node-sass node scripts/build -f

Rebuilding the script worked for me, I have the same problem on a debian wheezy x64 server with latest node-sass version.

Even if itโ€™s just a workaround, not a solution ๐Ÿ˜•

I am having the same issue. (on Debian Wheezy x64) I canโ€™t use bootstrap scss files which use sass map. Since I am using webpack. I dig a bit into it to see where it come from (sass-loader & co) and it seems to come from node-sass.

Exemple

$grid-breakpoints: (
  xs: 0,
  sm: 544px,
  md: 768px,
  lg: 992px,
  xl: 1200px
) !default;
$container-max-widths: (
  sm: 576px,
  md: 720px,
  lg: 940px,
  xl: 1140px
) !default;

Producing $ ./node_modules/node-sass/bin/node-sass ./node_modules/bootstrap/scss/_variables.scss > variables.css Segmentation fault

Versions

node-sass	4.2.0	(Wrapper)	[JavaScript]
libsass  	3.4.3	(Sass Compiler)	[C/C++]
bootstrap  	4.0.0-alpha.2

Working when recompiling

@xzyfer any news since April? Having to rebuild the whole scripts slows the whole deploying and CI process ๐Ÿ˜•

Sorry but, any news on this issue ?

I can confirm: it looks like this is the same as #1738: recompiling libsass solves the problem.

Tested on Debian wheezy x64:

$ ./node_modules/.bin/node-sass test.scss 
Segmentation fault
$ cd node_modules/node-sass && node scripts/build -f && cd ../..
[...]
$ ./node_modules/.bin/node-sass test.scss 

$

And the libstdc++ version is 3.4.17:

$ /sbin/ldconfig -p | grep stdc++
    libstdc++.so.6 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
$ readelf -sV /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | sed -n 's/.*@@GLIBCXX_//p' | sort -u -V | tail -1
3.4.17