Comments (8)
Does grunt-sass or node-sass use threads? The backtrace starts and ends with pthread calls but it's not clear where they're coming from. Also, in your node-sass issue you said it happens "roughly once in every 10 runs". That sounds consistent with a race condition to me.
What does thread apply all backtrace
give you?
from libsass.
Also, are you actually running LibSass, or just buiding it? (I've tried to make LibSass re-entrant.)
from libsass.
Hi again, sorry for slow reply, I was away the past few days.
I don't believe grunt-sass or node-sass use threads, they're both just very thin javascript wrappers around libsass. Ive not compiled LibSass either, all Im doing is using grunt-sass in my automated grunt build, this then includes node-sass which wraps a built libsass I believe (I'll double check that - havent poked around inside them too much yet).
Here's a new trace using 'thread apply all backtrace'.
Thread 3 (process 6593):
0 0x00007fff8aa99ce2 in __pthread_kill ()
1 0x00007fff859787d2 in pthread_kill ()
2 0x00007fff85969a7a in abort ()
3 0x00007fff83fa77bc in abort_message ()
4 0x00007fff83fa4fcf in default_terminate ()
5 0x00007fff8539a1cd in _objc_terminate ()
6 0x00007fff83fa5001 in safe_handler_caller ()
7 0x00007fff83fa505c in std::terminate ()
8 0x00007fff83fa6152 in __cxa_throw ()
9 0x00007fff87962255 in std::__throw_length_error ()
10 0x00007fff8798884e in std::string::_Rep::_S_create ()
11 0x00007fff8798a2fa in std::string::_S_construct<char const*> ()
12 0x00007fff8798a4a8 in std::basic_string<char, std::char_traits, std::allocator >::basic_string ()
13 0x0000000100f690f8 in Sass::Token::to_string () at :68
14 0x0000000100f690f8 in Sass::Node::to_string (this=0x7fff85992711, inside_of=Sass::Node::none) at ../libsass/node_emitters.cpp:68
15 0x0000000100f6c5d1 in std::string::data () at ../libsass/node_emitters.cpp:390
16 0x0000000100f6c5d1 in std::string::_M_data () at /usr/include/c++/4.2.1/bits/basic_string.h:2413
17 0x0000000100f6c5d1 in std::operator<< <char, std::char_traits, std::allocator > () at /usr/include/c++/4.2.1/bits/basic_string.h:1542
18 0x0000000100f6c5d1 in Sass::Node::emit_nested_css (this=0x100a5c088, buf=@0x100ff7708, depth=1, at_toplevel=false, in_media_query=true) at ../libsass/node_emitters.cpp:390
19 0x0000000100f6ca13 in std::operator<< std::char_traits () at /usr/include/c++/4.2.1/ostream:427
20 0x0000000100f6ca13 in Sass::Node::emit_nested_css (this=0x10101d528, buf=@0x100ff7708, depth=<value temporarily unavailable, due to optimizations>, at_toplevel=<value temporarily unavailable, due to optimizations>, in_media_query=false) at ../libsass/node_emitters.cpp:428
21 0x0000000100f6c4df in Sass::Node::emit_nested_css (this=0x100ff7c58, buf=@0x100ff7708, depth=0, at_toplevel=true, in_media_query=false) at ../libsass/node_emitters.cpp:379
22 0x0000000100f46787 in std::basic_stringstream<char, std::char_traits, std::allocator >::str () at /usr/include/c++/4.2.1/sstream:133
23 0x0000000100f46787 in Sass::Document::emit_css (this=<value temporarily unavailable, due to optimizations>, style=<value temporarily unavailable, due to optimizations>) at ../libsass/document.cpp:141
24 0x0000000100f70581 in std::string::_M_rep () at ../libsass/sass_interface.cpp:51
25 0x0000000100f70581 in std::string::_M_data () at /usr/include/c++/4.2.1/bits/basic_string.h:605
26 0x0000000100f70581 in std::string::size () at /usr/include/c++/4.2.1/bits/basic_string.h:287
27 0x0000000100f70581 in process_document (doc=@0x100ff7c20, style=0) at ../libsass/sass_interface.cpp:52
28 0x0000000100f70157 in sass_compile (c_ctx=0x100e00530) at ../libsass/sass_interface.cpp:65
29 0x00000001000462a8 in etp_proc ()
30 0x00007fff859768bf in _pthread_start ()
31 0x00007fff85979b75 in thread_start ()Thread 2 (process 6593):
0 0x00007fff8aa986b6 in semaphore_wait_trap ()
1 0x000000010027484a in v8::internal::RuntimeProfiler::WaitForSomeIsolateToEnterJS ()
2 0x000000010027495a in v8::internal::RuntimeProfilerRateLimiter::SuspendIfNecessary ()
3 0x00000001002fb9bd in v8::internal::SamplerThread::Run ()
4 0x00000001002fb384 in v8::internal::ThreadEntry ()
5 0x00007fff859768bf in _pthread_start ()
6 0x00007fff85979b75 in thread_start ()Thread 1 (process 6593):
0 0x00007fff8aa9a7e6 in kevent ()
1 0x000000010004c2a9 in kqueue_poll ()
2 0x0000000100043828 in uv__run ()
3 0x0000000100043763 in uv_run ()
4 0x00000001000090c3 in node::Start ()
5 0x0000000100001144 in start ()
from libsass.
Does grunt-sass or node-sass use threads? The backtrace starts and ends with pthread calls but it's not clear where they're coming from. Also, in your node-sass issue you said it happens "roughly once in every 10 runs". That sounds consistent with a race condition to me.
Note the output mmap(size=1152921504876556288)
, and that the pthread calls actually go down to a throw()
in basic_string. It looks like Sass::Node::to_string
is called on a Token
with begin
and end
that are wildly incorrect. Now, whether that's due to a parsing issue or some thread corrupting things, I have no idea, but I thought I'd just point that out.
from libsass.
@gregtillbrook Can you provide a copy of the Sass stylesheets that you're trying to compile? Then I can test them myself and try to reproduce the problem -- it could be that there's a null pointer dereference that I haven't caught.
from libsass.
I cant provide the exact same sass as technically my client owns it and its not mine to share. I'll make a generic sample that reproduces the same problem (bare with me though as this week is looking like a busy one..)
How would like me to send it to you? Email or just paste it here?
from libsass.
A generic sample that reproduces the crash should be fine -- just post it here, if you can. Thanks!
from libsass.
Sorry about the lack of response. I did at the time try to create a simplified case but without success. Since then Ive moved project and then job so this issue is no longer affecting me - so i'll close this issue.
Thanks a lot for all your help!
from libsass.
Related Issues (20)
- libsass.org has expired HOT 2
- SassError: media query expression must begin with '(' HOT 2
- build with autotools failed on ubuntu16.04
- extend does not extend all values
- 'There are no more files' error with Ruby 2.7..3 & Windows 7 (might be ffi related) HOT 3
- Read null address in Sass::SharedPtr::obj and Sass::Functions::sass_if HOT 2
- Read null address in Sass::Inspect::operator() HOT 1
- Is any precombiled so files for Raspberry ARM64
- can't find stylesheet to import "~@angular/material/theming"; HOT 1
- AddressSanitizer: SEGV on unknown address 0x000000000000 at inspect.cpp:466 HOT 2
- AddressSanitizer: stack-overflow on address 0x7ffff3e46ff8 (pc 0x7f13120dddd5 bp 0x615000000be8 sp 0x7ffff3e47000 T0) HOT 2
- random($limit) should no longer ignore units HOT 1
- A stack-overflow src/ast_selectors.cpp:557 in Sass::CompoundSelector::has_real_parent_ref() const HOT 7
- AddressSanitizer: stack-overflow src/ast_selectors.cpp:464 in Sass::ComplexSelector::has_placeholder() const HOT 2
- LeakSanitizer: detected memory leaks HOT 1
- LibSass not doing inplace text replacement for variables in unknown at rules HOT 2
- Ambiguous operator== overloads with GCC 13 and C++20
- Validated `or` css-operator usage does not compile in media query when included in SCSS HOT 5
- `mix(...)` sass semantics in relation to `color-mix(...)` css semantics HOT 3
- 3.6.6: compile time watnings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsass.