-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Segmentation fault when compiling susy #1879
Comments
Thanks for the report. I have been able to reproduce this issue on the I was not able to reproduce the issue on OSX. Still investigating. |
Interestingly even building fresh binaries on Alpine produces the segfault which is interesting. |
Also happens in the |
Also getting segfaults on node-sass 4.4/4.5 on node 4.3.0, still trying to reproduce with a smaller piece of code though |
@m4rcelofs @nizhu are you both using alpine? |
@xzyfer yes! 3.3.1 |
I've narrow this down a bug with LibSass introduced in sass/libsass@6a5444b (be warned the diff may crash your browser). I've been able to reproduce this on Alpine, but not OSX. I have also been able to confirm the issue doesn't appear when compiled with This is as far as I've gotten at the moment. |
For posterity
|
I can confirm the rebuild the binary locally with |
FWIW. I cannot reproduce on my virtual box machine:
Note that |
I've just uploaded the
|
I was able to reproduce with node-sass but not with any other code base (latest perl-libsass dev branch and sassc). @xzyfer have you tried latest mater with node-sass? . RUN apk add --update --no-cache nodejs python=2.7.12-r0 git-perl perl-dev bash make gcc g++
RUN npm install susy@^2
ENV SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
RUN npm install node-sass@4.3.0 susy@^2
RUN gcc -v
RUN git clone https://github.com/sass/libsass && cd libsass && git clone https://github.com/sass/sassc && cd sassc && make -j8
RUN libsass/sassc/bin/sassc node_modules/susy/sass/_susy.scss > susy.sassc.css
RUN perl -MCPAN -e "CPAN::Shell->rematein('notest', 'install', 'File::Slurp')"
RUN perl -MCPAN -e "CPAN::Shell->rematein('notest', 'install', 'List::MoreUtils')"
RUN perl -MCPAN -e "CPAN::Shell->rematein('notest', 'install', 'Encode::Locale')"
RUN perl -MCPAN -e "CPAN::Shell->rematein('notest', 'install', 'ExtUtils::CppGuess')"
RUN git clone https://github.com/sass/perl-libsass && cd perl-libsass && perl Makefile.PL --no-plugins && make -j8 install
RUN psass node_modules/susy/sass/_susy.scss
RUN ulimit -c unlimited && node node_modules/.bin/node-sass node_modules/susy/sass/_susy.scss || ls Took me some time to figure out since it's the first time I'm actually using docker. Not that easy to figure out how to attach to an image when your new. Anyway, after a while I got a bash prompt and was able to debug the core dump.
|
Thanks for following up in this. I was also unable to reproduce it with SassC. I hadn't had time to get a core dump, thanks.
I have not. I've been working on patch for a couple nullptr and memory leaks which I'd hoped might address this issue. I'll keep looking into this and that PR so we can update node-sass' LibSass. I know CodeKit is currently blocked on 3.5.0.beta.3 which I've been delaying until this could be sorted out. |
I wasn't able to build the clang static analyzer on Alpine. I can confirm the issue is still present using LibSass master. |
I have a minimal reproduction at https://github.com/xzyfer/node-sass-1879 |
This could maybe be cut down a little bit more. It's late here so I'll continue looking at it tomorrow. Interestingly there are a lot of elements in play, including |
Hi @xzyfer, do you have found a work around ? |
No work around. Might be fixed with newer alpines images but I haven't had a chance to test. |
Is there any Alpine version that does not have this issue? |
I don't know. We welcome people testing and reporting back. |
Kind of fix could possibly be the following addition in your Dockerfiles. |
Interestingly enough but the original Dockerfile that I included in the issue description above doesn't crash for me any longer: https://gist.github.com/IlyaSemenov/88bc27acdd4131aabd7bba901940d7a7 Same goes to the minimal reproduction (https://github.com/xzyfer/node-sass-1879), it runs fine. I believe the issue may be closed as outdated? |
@IlyaSemenov thanks for reporting back ❤️ |
node-sass 4.5.0 (and 4.4.0) fails to compile susy 2.2.12 with a segfault.
Steps to reproduce:
If you replace node-sass version with 4.3.0 it compiles fine. Also, I didn't manage to repeat this on Ubuntu so it might be Alpine Linux-specific.
Please note that I deliberately trimmed the example. Of course there's no point to compile susy from command line in real world. But it crashes the same way in full webpack environment as well.
npm -v
): 3.10.9node -v
): v6.9.2node -p process.versions
):{ http_parser: '2.7.1',
node: '6.9.2',
v8: '5.1.281.88',
uv: '1.9.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
icu: '57.1',
modules: '48',
openssl: '1.0.2j' }
node -p process.platform
): linuxnode -p process.arch
): x64node -p "require('node-sass').info"
):node-sass 4.5.0 (Wrapper) [JavaScript]
libsass 3.5.0.beta.2 (Sass Compiler) [C/C++]
npm ls node-sass
):/
`-- node-sass@4.5.0
The text was updated successfully, but these errors were encountered: