-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Illegal instruction: 4 and Bus error: 10 #1289
Comments
The problem seems to be causes by the large If the inline svg string is less than about 1,558 bytes - node-sass compiles fine. If the inline svg string is about 1,673 bytes or greater - the error is generated. It doesn't matter how many inline svg strings there are - as long as no single inline svg embed goes over roughly 1,558 bytes. (I can only adjust the number of grids, which determines the number of columns in the svg element, and so I can't tell you where the exact byte cutoff is). |
Thanks for your investigation @58bits. Could you please supply a sassmeister of broken (long) data url and working one. Having the single line of CSS causing the issue will help us quickly identify the problem as opposed to digging through a framework. |
Hi - here's a simple gist which generates the error locally... (Illegal instruction: 4) http://sassmeister.com/gist/6c5443acf20fe855f854 And here's what the output 'should' look like (in this case compiled with sassc - and of course also in the CSS of the SassMeister gist as well.) https://gist.github.com/58bits/d9475778075bae440c60 If |
I don't have an environment for singularity locally atm. Can you confirm whether the issue happens your input scss is the output css? This will confirm whether the issue is due to the length of the string or the code that generates the string is problematic. |
Hi @xzyfer thanks for the quick replies. Taking the outputed css from sassc and feeding that back into node-scss - doesn't generate the error. :-( |
That's interesting. I guess we'll need to dig into singularity itself. Maybe @Snugug can point in the right direction for potential causes. |
Understood - although strange that https://github.com/sass/sassc is able to compile the sass stylesheet fine. Maybe a combination of Node.js, V8, and Singularity? Is there some intermediate value that's causing the problem? |
I wonder what Seissmaster is using as their interface to Libsass - since it compiles fine with them. |
It could be an issue with the C++ code in node-sass that talks to LibSass. |
It would be useful to know if this happens on different versions of node,
|
Which version of node-sass matches the Libsass version in use use at SassMeister? I'll try that one first, and then work my way up ;-) |
Or rather - I'll try that one first, and then work my way up. |
v3.2.0 |
v3.2.0 fails to install - starting with ...and then source compilation error:
I suspect this is due to the version of node I'm using. I'm running out of cycles here. I'll try newer versions until I get a successful build, and then see what happens. |
v3.3.0
Same error....
|
v3.2.0 requires iojs 1, 2 or node 0.10, 0.12 |
Okay understood - but I'm afraid at this point I'm not sure when I'll have the time to change my dev environment, or setup a test for an earlier version of node-sass. I'm working on a single app built for Node.js 5.1 at the moment (and so I'm not using an environment switcher like N). |
@xzyfer @58bits I'm digging in to this. I've got the following:
@import 'bower_components/singularity/stylesheets/singularitygs';
@include sgs-change('debug', true);
@include add-grid(8);
@include add-gutter(0);
.container {
margin: 0 auto;
@include background-grid($color: #CCF);
} Error: > bugs@1.0.0 sass /Users/samrichard/Review/bugs
> node-sass --output-style expanded ./style.scss ./style.css
[1] 14822 illegal hardware instruction npm run sass This is connected to SVG string building we're doing. @58bits appears to have narrowed it down to a single string of a given size (~1,558 bytes or less is fine, ~1,673 bytes or greater is not). Might this be a SO issue with the string type? |
Thanks for all your work folk, I can reproduce this locally now. |
👍 |
Thank you @xzyfer ! |
Thank you x2 @xzyfer! :-) |
I've narrowed the problem down the overloaded |
Hi @xzyfer - does this mean |
Yes. Specifically the |
Here is what I got on FreeBSD:
if we get it on Mac OS X only, the issue may be related to the old libc++ runtime library being used on OS X... Would that be possible to get a debugger backtrace on that crash? |
Here's what I get on Ubuntu 14.04.3 LTS (using the source test file - same SVG element - and compiles fine.).
|
Definitely punching above my weight here, but I just tried to capture the error and a stack trace via the node-sass api calling |
Here's the output from
|
It might be that we are getting a stack overflow here. I'd need values of the stack registers at the time of the crash, this is |
More background infromation: https://developer.apple.com/library/mac/qa/qa1419/_index.htm @xzyfer does it also fail when running via sassc (the default stack size should be is larger there). If it does not fail, does increasing the SVG file size make it crash? |
Also, a full backtrace would be good. ( |
I can reproduce this locally now by limiting my stack size to 512 kilobytes. |
@xzyfer can you produce a backtrace ( |
Full backtrace obtained from the singularity project seems to be consistent with @xzyfer results https://gist.github.com/4cae7f96bd4bacb61d3d |
So it looks like we are generating a monster - say 132 characters substitutions times 1673 bytes is 220836 with overhead (string terminators, unicode) can easily be more than 512 kilobytes on stack. Maybe libsass can be told to save stack between calls. |
Sorry for the delay @saper. I saw the patch land in libuv. Sounds like this will magically fix itself in future version of Node. Is there anything else we can do? |
Not in the node-sass. Singularity and Ruby Sass need to do better string handling (as @mgreter suggests), on the libsass side we should be careful with our stack usage (I have yet to measure this a bit). But node-sass is plain innocent, as always! |
@jiv-e can you file a bug at https://GitHub.com/sass/libsass/issues about the need to detect recursive imports? There might be a bug about test already. |
I believe this is fixed in the beta. npm install node-sass@beta
|
Create quoted strings coming via API
I have the following error using node-sass (whether from the command line, or via the Grunt plugin).
The entire issue and source stylesheet is documented here at at-import/Singularity#215 and here at SassMeister http://sassmeister.com/gist/ac31969a3b5dfcbef1a5 (SassMeister also compiles the stylesheet fine).
The problem occurs when using the Singularity grid system in debug mode, and setting a background-grid color, and apparently only on Mac OS X. The grid system generates some large string inline embedded svg images for the background grid.
Here are a few platform details.
Any suggestions or ideas out there?
For interest, here's what the successfully compiled sass stylesheet produces...
https://gist.github.com/58bits/bd225aa29e4c89e2e2c2
The text was updated successfully, but these errors were encountered: