Open AlexK-BD opened 3 years ago
I used some ham-handed instrumentation to see where the stack was growing.
The extreme case (running bazel-out/k8-fastbuild/bin/absl/debugging/symbolize_test --gtest_filter=Symbolize\*Stack*:\*Cache\*
)
is due to the snprintf
call in ReadAddrMap
(which uses a lot of stack)
In the normal (all gtests case), by the time the stack consumption tests run, FindSymbolInCache
succeeds and almost none of Symbolizer::GetSymbol
runs as a result. When the tests are run in isolation, FindSymbolInCache
returns null and the rest of GetSymbol
runs.
Describe the bug
In some builds (see below), running
symbolize_test
with--gtest_filter=Symbolize.SymbolizeStackConsumption
causes that test to fail, e.g.Steps to reproduce the bug
I have reproduced this in several Linux x86_64 builds on my ubuntu 18.04 machine. Notably, the bazel build without
-O2
does work.cmake
bazel with -O2
I'm very new to bazel, but:
This uses gcc 7 by default . I've tried gcc 8, clang 8, and clang 10. The amount of stack violation varies, but all of them exhibit the problem. Variations like
-O3
and-Os
, architecture switches, etc, change the exact max stack size, but all exhibit the same problem.This also fails:
env CC=g++-8 bazel test --copt=-O1 --copt=-fcaller-saves //absl/debugging:symbolize_test
What version of Abseil are you using?
4bb9e39c88854dbf466688177257d11810719853
(master as of a few hours ago. Problem also manifested with code from Jul 2 (58e042da9210710dc4ac3b320e48b54e2449521e)What operating system and version are you using
Ubuntu 18.04, x86_64
What compiler and version are you using?
Default gcc:
Other compilers tested: gcc 8, clang 8, clang 10.
What build system are you using?
bazel 4.0.0
andcmake version 3.10.2
Additional context
I came across this because I integrated abseil (tests and all) into our gn-based build system. Our parallel test framework runs test cases from each gtest one at a time (each in a separate process).
Running both stack consumption tests in one process also fails on both (
--gtest_filter=Symbolize\*Stack*
)Other interesting multi-test cases:
bazel-out/k8-fastbuild/bin/absl/debugging/symbolize_test --gtest_filter=Symbolize\*Stack*:\*Cache\*
[----------] Global test environment tear-down [==========] 3 tests from 1 test suite ran. (1 ms total) [ PASSED ] 2 tests. [ FAILED ] 1 test, listed below: [ FAILED ] Symbolize.SymbolizeWithDemanglingStackConsumption