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

Selector unification: use == for comparison #2738

Merged
merged 1 commit into from
Nov 20, 2018
Merged

Conversation

glebm
Copy link
Contributor

@glebm glebm commented Nov 18, 2018

Extracted from #2315
@mgreter

@xzyfer xzyfer self-requested a review November 19, 2018 10:23
@xzyfer
Copy link
Contributor

xzyfer commented Nov 19, 2018

This needs to be rebased on master.

@glebm
Copy link
Contributor Author

glebm commented Nov 19, 2018

Done

@xzyfer
Copy link
Contributor

xzyfer commented Nov 19, 2018 via email

@glebm
Copy link
Contributor Author

glebm commented Nov 19, 2018

@xzyfer The first failing commit seems to be the one that disables coverage for clang: d09d09d

It looks like libsass may have been leaking for a while but this went unnoticed because ASAN is disabled when coverage is enabled:

# https://en.wikipedia.org/wiki/AddressSanitizer
if [ "x$CC" == "xclang" ]; then
if [ "x$COVERAGE" != "xyes" ]; then

@xzyfer
Copy link
Contributor

xzyfer commented Nov 19, 2018 via email

@glebm
Copy link
Contributor Author

glebm commented Nov 19, 2018

This is what I use for investigating by the way:

enable_asan() {
  export EXTRA_CXXFLAGS='-fsanitize=address -g -O0 -fno-omit-frame-pointer'
  export EXTRA_CFLAGS="$EXTRA_CXXFLAGS"
  export EXTRA_LDFLAGS="-fsanitize=address -lstdc++"
  export ASAN_OPTIONS="verbosity=1:symbolize=1"
  export CC=clang
  export CXX=clang++
}

enable_asan
cd sassc && make clean && cd - && make clean && make -j8 test

@glebm
Copy link
Contributor Author

glebm commented Nov 19, 2018

in the small window where the configuration was incorrect,

Maybe not that small, it fails on d09d09d as well.

@glebm
Copy link
Contributor Author

glebm commented Nov 19, 2018

Bisecting (manually, running on the current test suite but only considering ASAN errors):

Date Commit Result
04 Jul 38f4c36 FAIL
04 Apr 9266d26 FAIL
17 Mar d0b6338 FAIL
17 Mar bbfcf49 FAIL
17 Mar 4c34d16 FAIL
17 Mar 205dc65 FAIL
17 Mar 0599b2e PASS
17 Mar 10c25da PASS
17 Mar aa7386f PASS
15 Mar 9cfe0df PASS

@glebm
Copy link
Contributor Author

glebm commented Nov 19, 2018

According to the bisection results, the first ASAN failure is at 205dc65

glebm referenced this pull request Nov 19, 2018
Media_Blocks are prone to have circular references.
Copy could leak memory if it does not get picked up.
Looks like we are able to reset block reference for copy
Good as it will ensure a low memory overhead for this fix
So this is a cheap solution with a minimal price
glebm referenced this pull request Nov 19, 2018
- handle in Function_Call directly
@xzyfer
Copy link
Contributor

xzyfer commented Nov 20, 2018

Sorry I'm not following why your finding explain why master only began failing recently.

Maybe not that small, it fails on d09d09d as well.

The change in d09d09d essentially reverts ab03dc0. This why I suggested the issue crept in between those two commits - making d225a09 obvious candidate.

It's worth noting that all following PRs to address leaks continue to fail in the same

This suggest to me that the problem is more recent. I'm started debugging this by branching from f477cd6 and replaying the subsequent commits except my changes to .travis.yml.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 20, 2018

The first failing commit seems to be the one that disables coverage for clang: d09d09d

Aha apologies, I missed this comment.

@glebm
Copy link
Contributor Author

glebm commented Nov 20, 2018

My PRs each address individual leaks. With all 3 there are no more leaks.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 20, 2018

I don't get notified of edits via email. It's easier for me to respond in a timely manner if you can avoid editing comments :)

@glebm
Copy link
Contributor Author

glebm commented Nov 20, 2018

OK, will do so in the future. CI was only passing because it wasn't running ASAN (until you disabled coverage). Memory leaks existed since March 17.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 20, 2018

Thanks for looking into this. I agree it is weird. I'm catching up on the backlog before going to bed.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 20, 2018

I believe I've merged all the leak fix PRs however CI still appears to be unhappy - https://travis-ci.org/sass/libsass/jobs/457400390

I wonder if there is a config issue for that build.

@glebm
Copy link
Contributor Author

glebm commented Nov 20, 2018

Yes, there must be, because the error message in that build is:

==4122==LeakSanitizer has encountered a fatal error.
==4122==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==4122==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)

@glebm
Copy link
Contributor Author

glebm commented Nov 20, 2018

Looks like it doesn't work in a docker container without --cap-add ptrace. See google/sanitizers#764.

Looks like there is no way to add container capabilities on Travis. However, we can simply set sudo: required in .travis.yml. See travis-ci/travis-ci#9033

@xzyfer xzyfer merged commit 546f8e9 into sass:master Nov 20, 2018
@glebm glebm deleted the unify-eq branch November 20, 2018 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants