Closed ahorek closed 5 years ago
investigating...
variables.scss
$gap: 12px !default;
$font-size: 15px !default;
$text-beta: #ae1400 !default;
main.scss
@import "variables";
.management {
&_indicator {
margin-right: 4*$gap;
position: absolute;
display: inline-block;
font-size: $font-size;
color: $text-beta;
top: 1.75*$gap;
padding-left: .25*$gap;
}
}
if I inline variables.scss into main.scss, it works. So it looks like any use of @import triggers the error.
@bolandrm could you share a linux binary built on your environment with debug flags enabled? https://github.com/sass/sassc-ruby/pull/129
@ahorek The pre-built binary is built in a Docker container, so everyone should have the same environment.
To build it, simply clone the repo and run bundle exec rake gem:native
. It will be in pkg/
.
@ahorek You need to have Docker and VirtualBox installed for rake gem:native
to work.
ok, I'll try that
Compiled just now with the no-strip patch:
sassc-2.1.0.pre2-x86_64-linux.gem.zip
This was compiled on my Windows machine but that shouldn't matter.
I was able to build https://github.com/sass/sassc-ruby/pull/129 according to your manual, however the error remains the same
...
I, [2019-06-12T01:09:17.692716 #2572] INFO -- : Writing /home/gitlab-runner/test/sassctest/devel/public/assets/asset-3d857124e31be2ed5924711e99957f250e939d51e4c75df19bf6393b1a5cf204.js.gz
*** Error in `ruby /usr/local/rvm/gems/ruby-2.3.3-railsexpress/bin/rake install RAILS_ENV=production --trace': free(): invalid pointer: 0x00007f894ea69f00 ***
Aborted
Perhaps you can try debugging with valgrind?
valgrind --tool=memcheck ./your-command
This looks suspicious:
==1985== Invalid free() / delete / delete[] / realloc() ==1985== at 0x4C29AB1: operator delete[](void*) (vg_replace_malloc.c:651) ==1985== by 0x1A6F5541: std::locale::_Impl::_M_install_facet(std::locale::id const*, std::locale::facet const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20) ==1985== by 0x1A6F59A2: std::locale::_Impl::_Impl(unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20) ==1985== by 0x1A6F6914: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20) ==1985== by 0x53D540F: pthread_once (pthread_once.S:103) ==1985== by 0x1A6F6960: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20) ==1985== by 0x1A6F69A2: std::locale::locale() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20) ==1985== by 0x1A73D518: std::basic_filebuf>::basic_filebuf() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20) ==1985== by 0x197CE2F5: Sass::File::read_file(std::__cxx11::basic_string , std::allocator > const&) (in /usr/local/rvm/gems/ruby-head-opt/gems/sassc-2.1.0.pre2-x86_64-linux/lib/sassc/libsass.so) ==1985== by 0x1989DA5B: Sass::Context::load_import(Sass::Importer const&, Sass::ParserState) (in /usr/local/rvm/gems/ruby-head-opt/gems/sassc-2.1.0.pre2-x86_64-linux/lib/sassc/libsass.so) ==1985== by 0x1989E048: Sass::Context::import_url(Sass::Import*, std::__cxx11::basic_string , std::allocator >, std::__cxx11::basic_string , std::allocator > const&) (in /usr/local/rvm/gems/ruby-head-opt/gems/sassc-2.1.0.pre2-x86_64-linux/lib/sassc/libsass.so) ==1985== by 0x1989F769: Sass::Context::call_loader(std::__cxx11::basic_string , std::allocator > const&, char const*, Sass::ParserState&, Sass::Import*, std::vector >, bool) (in /usr/local/rvm/gems/ruby-head-opt/gems/sassc-2.1.0.pre2-x86_64-linux/lib/sassc/libsass.so) ==1985== Address 0x1a98ef00 is in the BSS segment of /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20
I'll share a full log soon.
I found a thread on gcchelp about this that seems somewhat related: https://www.spinics.net/lists/gcchelp/msg46851.html
From the gcchelp thread it looks like there is some kind of compatibility issue (bug) with GCC 4/5 and the locale header.
Can you please try with this patch:
https://github.com/glebm/libsass/commit/3b5190a62bb17f0cef5e0e837e37603623740fb2
It avoids initializing locales by using the C API to read files instead of the C++ one.
thank you @glebm !
I can confirm the patch https://github.com/glebm/libsass/commit/3b5190a62bb17f0cef5e0e837e37603623740fb2 fixes the problem. All tests passed.
do we need a new libsass release?
do we need a new libsass release?
Maybe not, sent #130 to build from the right commit.
@ahorek 2.1.0.pre3
released containing this fix
Unfortunately, I'm getting the same issue with the pointer. sassc 2.1.0
on CentOS 7 with ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
. pg 1.1.4
is used as well.
I have an error during sass compilation
unfortunately no backtrace or hints where the problem could be.
it does happen only in combination with pg gem 1.1.4 and sassc-2.1.0.pre2 (precompiled version)
if I build sassc-2.1.0.pre2 from source, it doesn't happen sassc-2.1.0.pre2 (precompiled) + mysql gem also works fine so weird...
tried multiple ruby versions without any difference ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux] ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux] ...
the error never occurred to me with prior sassc versions, so it's definitelly related.
Any idea how to debug it further? @glebm I understand that the error message is quite useless, but I still wanted to report it before the final release.
thanks!
my env