-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Webpack segmentation faults for newer versions of node-sass #1676
Comments
Without a repeatable reproduction there isn't much we can do. There may have only been a few changes to the node-sass JS however there were many changes to LibSass C++ which the majority of this project's code. |
The other thing in play here is sass-loader which uses the importer API |
We've set up segfault-handler so we will be able to hopefully figure out the root cause. In the initial run of segfault-handler, we noticed issues with the node garbage collector, but I don't know what that says about the issue here. |
We also need more information: which OS is this, which node engine, and most important: the platform. Also getting a full log from processing may give us some hints. We are currently collecting information for a similar case with grunt: https://github.com/saper/sass_issue_1672 is a complete bug show case and #1672 contains some useful logs. Can you supply us with the information similar to bug #1672 ? |
Operating system: OS X El Capitan 10.11.6 (15G31) I'm not sure what you mean by "platform". If you mean architecture, I'm on x86_64.
|
Thank you. Looks like it crashes in code the node engine provides to the V8 garbage collector (similar issues). Having said that, we still cannot preclude that it is not node-sass or libsass fault, especially since we mix C++ runtime libraries on MacOS X, which is asking for trouble. As this happens during some JSON parsing by node it is also possible that node-sass is not involved here. As per @bnoordhuis troubleshooting advice in nodejs/node#7654 can you try running node with |
Another question: Did you try node-sass@3.8.0? Also, it is very important to have a possibly small repository to reproduce this problem. |
The strangest part about the segfault issues we've been encountering is that they're not easy to reproduce. I was able to successfully do Unfortunately, I cannot provide a repository which can reproduce this problem as we have written software that cannot be released publicly. |
I would also like to note that I installed |
Since the exception occurs in the garbage collector it relies on some specific memory allocation pattern and some specific situation where garbage collection may be triggered. It would be interesting to see if the stacktraces are similar between crashes. Please also try the newest node-sass code released (3.8.0). Also I'd recommend trying the same with node 6.x and see if the newer V8 engine somehow fixed or worked around the problem (even if the core cause is somewhere else). Please try building this on Linux/FreeBSD and see if you can reproduce this there. Basically there are the following possibilities to continue troubleshooting this:
|
@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 Before I deleted everything, The
Edit: The code compiles file with just
|
Excellent find, @sunjay! |
This is great @sunjay. On my box it looks like the infinite loop that eats up all the memory. |
So, the good news is: this has been fixed in the current libsass master code:
|
Unfortunately I've since left the company and cannot see if this was the issue, though I have forwarded the comment by @sunjay to someone I know personally and he might look into it. |
I understand - I'll close the issue for now - if anyone comes up with a way to reproduce it, we can always reopen it. Thank you. |
@saper since this is fixed in the latest sass, do I just have to update my libsass version? Does node-sass use the system libsass version? |
@sunjay nope, if you use the binary file downloaded via |
Make sure hash is recalculated after value update
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.
The text was updated successfully, but these errors were encountered: