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

segmentation fault when parsing invalid sass #378

Closed
chrisspiegl opened this issue Jul 29, 2014 · 22 comments
Closed

segmentation fault when parsing invalid sass #378

chrisspiegl opened this issue Jul 29, 2014 · 22 comments

Comments

@chrisspiegl
Copy link

This problem was already discussed in issue #7. But as far as I tested it, it is still a problem.
I am using node-sass via gulp-sass. gulp-sass use the current version of node-sass (^0.9).

If I try to compile a scss file with an missing ; it writes segmentation fault to the console and crashes.

@keithamus keithamus added the bug label Jul 30, 2014
@am11
Copy link
Contributor

am11 commented Jul 30, 2014

I fixed a similar issue with #366. The PR is awaiting some love.

/cc @andrew et el.

@sjrdevelopment
Copy link

I'm also having this problem using gulp-sass, but I found I get a more helpful error by turning off the sourceMap and sourceComments options, if that helps the diagnosis.

@jacobsvante
Copy link

Not passing in sourceComments: 'map' "fixes" this issue for me.

@andremalkine
Copy link

I've seen this problem when using gulp-sass. I just tried out grunt-sass (grunt plugin for node-sass) and find that when sourceMap options are on, there's no error logging at all. Blatant issues pass right through unnoticed. Perhaps the scenarios are unrelated but they're strangely symmetrical.

@Arkkimaagi
Copy link

+1

I am using node-sass from gulp-sass and when I set the sourceComments: 'map' option, I get segmentation fault if there is an error in any scss file.

@am11
Copy link
Contributor

am11 commented Sep 4, 2014

This is fixed. The next release will bring tons of improvements. Don't know when it will be rolled out though. You can, however, build it by yourself if you have C++ compiler installed (also npm install -g node-gyp and follow the how-to-build instructions in repo's readme).

@keithamus
Copy link
Member

@am11 are you saying this is fixed in master? If so I'll close this issue.

@am11
Copy link
Contributor

am11 commented Sep 4, 2014

Actually I replied to the issue @Arkkimaagi reported. That is surely fixed.

It's unclear if the OP is facing the same issue.

I guess a release at this point will close couple of issues in the tracker. Do you know of an ETA on the next release?

@keithamus
Copy link
Member

@am11 first thing we need to do is build all of the binaries for https://github.com/sass/node-sass-binaries, updated to the latest version. I can do Mac and Linux, @LaurentGoderre usually sorts the Windows builds out. Finally, after that is done, we need to update the package.json to reflect a new version number and publish it to npm.

If you want to speed things up, feel free to try to compile the Mac/Nix/Win binaries and submit a pr in https://github.com/sass/node-sass-binaries

@am11
Copy link
Contributor

am11 commented Sep 4, 2014

Great! 👍

Will do that, but on second thought; I guess this would make sense if we wait for sass/libsass#471 and sass/libsass#476 to merge in by @akhleung.

After that I will make a minor update which corresponds to sass/libsass#476.

By that time, hopefully teletyping (TTY) test issue (#410) is sorted out, so CI build finally pass with flying colors! 🍏

@keithamus
Copy link
Member

Libsass is out of my control, but feel free to @ me when they're merged in and we can get the ball rolling on updating node-sass.

@am11
Copy link
Contributor

am11 commented Sep 12, 2014

@keithamus, @andrew,
For any consumer of node-sass, is it mandatory to have python and cpp compiler installed on your system? Today I ran npm install node-sass on a system and it complained about missing python. Shouldn't we go for a production release, so there is no "building" at install-time?

@andrew
Copy link
Contributor

andrew commented Sep 12, 2014

@am11 I don't believe it should if there are binaries available for the platform you're installing it on. The build.js testing-and-installing-or-building script is kinda crazy, I wouldn't be surprised if there were bugs in it.

@am11
Copy link
Contributor

am11 commented Sep 12, 2014

@andrew thanks for the quick reply.

I think we should add a note in README.md for python and c-compiler dependencies, to clarify that the installation of this npm it's not as straightforward as npm install node-sass (the case with most of the npms).. 😄

@nschonni
Copy link
Contributor

@am11 those dependencies are only required for a rebuild of the binaries. They shouldn't be needed for anyone one a stable NodeJS on any platform the binaries are shipped for.

Closing this issue since the PR fixings this was merged weeks ago

@am11
Copy link
Contributor

am11 commented Sep 12, 2014

@nschonni, thanks! That's what I was thinking. But it was actually building the package with npm install node-sass and subsequently failing the Web Essentials build. I ran npm cache clear and it is fixed! 😎

@justinewin
Copy link

Experienced a lot of segfault errors just a while ago. Tried doing npm rebuild and reinstalling my node modules but to no luck. Finally went back to my code and noticed one line exceeded one tab. Deleted the extra tab and now it finally works! This error occured while I was testing the responsiveness of the site and made a quick change in sass and gulp watch it right ahead.

@xzyfer
Copy link
Contributor

xzyfer commented Dec 10, 2016

noticed one line exceeded one tab

I'm not sure what you mean by this. Can you please show an example so I can see the segfaults myself?

@justinewin
Copy link

justinewin commented Jan 7, 2017

@xzyfer take this as an example:

sass is tab-sensitive, I failed to see one line exceeded by a tab. Something similar like this:

#scroll-1
	background: url('../img/scroll-1.png')
	     background-position: center
	background-size: cover

@xzyfer
Copy link
Contributor

xzyfer commented Jan 7, 2017

Thanks @justinewin this should throw an error, not segfault

Inconsistent indentation: "\t     " was used for indentation, but the rest of the document was indented using 1 tab.

This is likely a bug in sass2scss /cc @mgreter

@justinewin
Copy link

@xzyfer I see, mine was because of a tab. That's why I was wondering why I'm having a segmentation fault.

@xzyfer
Copy link
Contributor

xzyfer commented Jan 7, 2017

@justinewin your segmentation fault is due to an unhandled error. So yes, the extra tab is the problem, but a bug is causes libsass to segfault instead of returning an error,

jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
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