We need at least following defs to be set to print stacktrace in
failure signal handler.
- HAVE_UNWIND_H: on Linux and macOS. unwind.h is usually present
by default on those OSes.
- HAVE_DLADDR: on macOS.
Windows is not cared because glog can not be built with bazel
on Windows today.
When glog 0.4.0 is built using musl instead of glibc, the compilation
for this test fails because musl doesn't provide execinfo.h, which sets
HAVE_STACKTRACE to false.
Tested by building glog with musl and verifying that the build succeeds
with this patch. [See https://github.com/openwrt/packages/pull/8583]
Signed-off-by: Amol Bhave <ambhave@fb.com>
for `&CheckStackAddress`, VisualStudio emits address of a trampoline like PLT,
not the actual address of `CheckStackTrace`.
We need address of `CheckStackTrace` to guess the address range of the function.
`static` function seems to return the actual address of the function.
Fixes#421
* Fix demangling template parameter packs
Clang 4.0.1-10 and gcc 7.3.0 both mangle the function "void add<int>(int)" as
"_Z3addIJiEEvDpT_". The template parameter pack is of the form
J <template-arg>* E
The opening character for a param pack could be either I or J, as libiberty
follows [1]. This change simply adds the J case.
[1] fbd263526a/libiberty/cp-demangle.c (L3209)
The code references `@ac_cv_have_libgflags@` but not `@ac_cv_have_libgflags_h@`. This corrects that.
`int(with_gflags)` incorporates the possibility of `True/False`: https://github.com/bazelbuild/bazel/issues/4792
* Upstream Chromium local changes to symbolize.cc
Chromium has its own fork of symbolize.cc and symbolize.h, and it has
several not-yet-upstreamed changes, that are not specific to Chromium.
This patch upstreams such a changes.
Fixed google::FindSymbol reading past end of a section
3dae0a2d7d
Fix -INT_MIN integer overflow in itoa_r().
ac4d28e9cb
Add print_unsymbolized_stack_traces gn arg.
6a2726776f
Switch to standard integer types in base/.
9b6f42934e
* Add a build option to print unsymbolized traces
This PRINT_UNSYMBOLIZED_STACK_TRACES option to cmake, and
--enable-unsymbolized-traces option to autoconf.
ReadFromOffset in symbolize.cc used to call lseek() + read() to read
data from fd. However, the fd may be reused for multiple symbolize
requests from multiple threads, and causes a race around the fd read
offset.
This updates it to use pread() to resolve the race.