Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leaks in src/parser.cpp:765 #3107

Open
puppet-meteor opened this issue May 26, 2020 · 1 comment
Open

memory leaks in src/parser.cpp:765 #3107

puppet-meteor opened this issue May 26, 2020 · 1 comment

Comments

@puppet-meteor
Copy link

Version: sassc-3.6.1-8-g3e73 libsass-3.6.3-57-g9515

OS: Ubuntu 16.04 LTS

POC: https://github.com/puppet-meteor/NLP_POC/blob/master/sassc/POC_1_002081

cmd: ./sassc POC

ASAN log:

=================================================================
==40261==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 208 byte(s) in 1 object(s) allocated from:
#0 0x7ffff6f03532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x57513d in Sass::Parser::parse_pseudo_selector() src/parser.cpp:765

Indirect leak of 1013 byte(s) in 2 object(s) allocated from:
#0 0x7ffff6f02602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
#1 0x4213e8 in sass_alloc_memory src/sass.cpp:39

Indirect leak of 480 byte(s) in 4 object(s) allocated from:
#0 0x7ffff6f03532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x570585 in Sass::Parser::parse_css_variable_value() src/parser.cpp:1602
#2 0x575070 in Sass::Parser::parse_pseudo_selector() src/parser.cpp:764

Indirect leak of 240 byte(s) in 2 object(s) allocated from:
#0 0x7ffff6f03532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x572120 in Sass::Parser::parse_css_variable_value() src/parser.cpp:1633
#2 0x575070 in Sass::Parser::parse_pseudo_selector() src/parser.cpp:764

Indirect leak of 240 byte(s) in 2 object(s) allocated from:
#0 0x7ffff6f03532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x5719dc in Sass::Parser::parse_css_variable_value() src/parser.cpp:1622
#2 0x575070 in Sass::Parser::parse_pseudo_selector() src/parser.cpp:764

Indirect leak of 128 byte(s) in 1 object(s) allocated from:
#0 0x7ffff6f03532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x56feac in Sass::Parser::parse_css_variable_value() src/parser.cpp:1594
#2 0x575070 in Sass::Parser::parse_pseudo_selector() src/parser.cpp:764

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x7ffff6f03532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x5a0071 in __gnu_cxx::new_allocator<Sass::SharedImplSass::Media_Query_Expression >::allocate(unsigned long, void const*) /usr/include/c++/5/ext/new_allocator.h:104
#2 0x5a0071 in std::allocator_traits<std::allocator<Sass::SharedImplSass::Media_Query_Expression > >::allocate(std::allocator<Sass::SharedImplSass::Media_Query_Expression >&, unsigned long) /usr/include/c++/5/bits/alloc_traits.h:491
#3 0x5a0071 in std::_Vector_base<Sass::SharedImplSass::Media_Query_Expression, std::allocator<Sass::SharedImplSass::Media_Query_Expression > >::_M_allocate(unsigned long) /usr/include/c++/5/bits/stl_vector.h:170
#4 0x5a0071 in void std::vector<Sass::SharedImplSass::PreValue, std::allocator<Sass::SharedImplSass::PreValue > >::_M_insert_aux<Sass::SharedImplSass::PreValue const&>(__gnu_cxx::__normal_iterator<Sass::SharedImplSass::PreValue*, std::vector<Sass::SharedImplSass::PreValue, std::allocator<Sass::SharedImplSass::PreValue > > >, Sass::SharedImplSass::PreValue const&) /usr/include/c++/5/bits/vector.tcc:353

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
#0 0x7ffff6f03532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x43f2c6 in Sass::Context::register_resource(Sass::Include const&, Sass::Resource const&) src/context.cpp:277

Indirect leak of 31 byte(s) in 1 object(s) allocated from:
#0 0x7ffff6f03532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x7ffff68fe498 in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x11f498)

SUMMARY: AddressSanitizer: 2460 byte(s) leaked in 15 allocation(s).

@calvin2021y
Copy link

get a lot same warning from linux:

Indirect leak of 16 byte(s) in 1 object(s) allocated from

 #2 0x5b85b8 in std::__1::__libcpp_allocate(unsigned long, unsigned long) /usr/lib/llvm-12/bin/../include/c++/v1/new:261:10
    #3 0x5def71 in std::__1::allocator<Sass::SharedImpl<Sass::SelectorComponent> >::allocate(unsigned long) /usr/lib/llvm-12/bin/../include/c++/v1/memory:865:38
    #4 0x5dee3c in std::__1::allocator_traits<std::__1::allocator<Sass::SharedImpl<Sass::SelectorComponent> > >::allocate(std::__1::allocator<Sass::SharedImpl<Sass::SelectorComponent> >&, unsigned long) /usr/lib/llvm-12/bin/../include/c++/v1/__memory/allocator_traits.h:260:20
    #5 0x5de335 in std::__1::__split_buffer<Sass::SharedImpl<Sass::SelectorComponent>, std::__1::allocator<Sass::SharedImpl<Sass::SelectorComponent> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<Sass::SharedImpl<Sass::SelectorComponent> >&) /usr/lib/llvm-12/bin/../include/c++/v1/__split_buffer:314:29
    #6 0x5dddbc in std::__1::vector<Sass::SharedImpl<Sass::SelectorComponent>, std::__1::allocator<Sass::SharedImpl<Sass::SelectorComponent> > >::insert(std::__1::__wrap_iter<Sass::SharedImpl<Sass::SelectorComponent> const*>, Sass::SharedImpl<Sass::SelectorComponent> const&) /usr/lib/llvm-12/bin/../include/c++/v1/vector:1793:53
    #7 0x5cb3a3 in Sass::Vectorized<Sass::SharedImpl<Sass::SelectorComponent> >::append(Sass::SharedImpl<Sass::SelectorComponent>) sass/src/ast.hpp:300:17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants