Skip to content

Run asan and lsan suites without -O2 #15176

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

Merged
merged 1 commit into from
Sep 29, 2021
Merged

Run asan and lsan suites without -O2 #15176

merged 1 commit into from
Sep 29, 2021

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Sep 29, 2021

Running them in -O2 means llvm does optimizations which can hide
memory leaks (e.g. In some cases it can completely elinate calls
allocations due to malloc/new when the resulting pointer don't escape).

This should also speed up running these test suites.

Also, fix test_em_asm_2 under asan.

This change contains some parts that were split out from #15099.

@sbc100 sbc100 requested a review from kripken September 29, 2021 17:44
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will compile more quickly, but it may run a lot more slowly as ASan checks can be optimized out, so I actually worry this may be quite slow. That might be worth checking.

Looks like we added -O2 over here, for SIMD reasons #12249 (comment) @tlively may remember more, but if tests pass maybe that problem has gone away.

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 29, 2021

According to https://github.com/emscripten-core/emscripten/pull/12249/files#r492308304 this was because the "too many locals" issue.. which I dealt with more precisely in this PR. The fact that we only added -O2 for that one reason makes me even more confidant we should make this change.

Running them in `-O2` means llvm does optimizations which can hide
memory leaks (e.g. In some cases it can completely elinate calls
allocations due to malloc/new when the resulting pointer don't escape).

This should also speed up running these test suites.

Also, fix test_em_asm_2 under asan.
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

I'd still suggest looking at compile times, but as this wasn't an issue before, likely it's fine.

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 29, 2021

Makes sense.

I'd still suggest looking at compile times, but as this wasn't an issue before, likely it's fine.

Do you mean execution times? I'm not to worried about that.. asan execution times are excepted to be slow anyway. I will measure but unless its something like 10x slower I suggest we keep this setting since it also makes the stack traces on failure more readable. Perhaps once we have lsan up and running in CI we can using -O2 for asan and -O0 for lsan.

@sbc100 sbc100 merged commit 761bedc into main Sep 29, 2021
@sbc100 sbc100 deleted the asan_no_opt branch September 29, 2021 20:01
Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM FWIW

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.

3 participants