Commit Graph

43 Commits

Author SHA1 Message Date
Aliaksey Kandratsenka
f15425dc99 implement SafeStrError and use it inside strerror
This fixes issue #1371

From time to time things file inside tcmalloc guts where calling to
malloc is not safe. Regular strerror does locale bits, so will
occasionally open files/malloc/etc. We avoid this by using our own
"safe" variant that hardcodes names of all POSIX errno constants.
2023-07-03 18:14:05 -04:00
Aliaksey Kandratsenka
cc4e289a83 drop weakening from cmake build
Weakening is optional and in github issue #1392 we apparently tried to
weaken on windows and failed. So lets not even try.
2023-07-03 13:02:59 -04:00
Aliaksey Kandratsenka
972c12f77d refactor stacktrace.cc and drop x86 backtracer
We had plenty of old and mostly no more correct i386 cruft. Now that
generic_fp backtracer covers i386 just fine, we can drop explicit x86
backtracer.

With that we refactored and simplified stacktrace.cc mostly around
picking default implementation, but also adding few more minor
cleanups.
2023-07-02 22:30:00 -04:00
Aliaksey Kandratsenka
4b78ffd03c try building with -fno-omit-frame-pointer -momit-leaf-frame-pointer
The idea is -momit-leaf-frame-pointer gives us performance pretty much
same as fully omitting frame pointers. And having frame pointers
elsewhere allows us to support cases when user's code is built with
frame pointers. We also pass all tests with
TCMALLOC_STACKTRACE_METHOD=generic_fp (not just libunwind or libgcc).
2023-07-02 22:30:00 -04:00
Aliaksey Kandratsenka
cddd759bd1 disable libgcc stack trace capturing on freebsd 2023-07-02 22:30:00 -04:00
Aliaksey Kandratsenka
7dd1b82378 simplify project by making it C++-only
I.e. no need for any AC_LANG_PUSH stuff in configure. Most usefully,
only CXXFLAGS needs to be set now when you need to tweak compile
flags.
2023-07-02 22:30:00 -04:00
Aliaksey Kandratsenka
e78238d94d reworked heap leak checker for more portability
In most practical terms, this expands "official" heap leak checker
support to Linux/arm64 and Linux/riscv (mips-en and legacy arm are
likely to work & pass tests too now).

The code is now explicitly Linux-only, without trying to pretend
otherwise. Main goal of this change is to finally amputate
linux_syscall_support.h, which we historically had trouble maintaining
well. Biggest challenge was around thread listing facility which uses
clone (ptrace explicitly fails between threads) and that causes
difficulties around parent and child tasks sharing
errno. linux_syscall_support stuff had special feature to "redirect"
errno accesses. But it caused us for more trouble. We switched to
regular syscalls, and errno stamping avoidance is now simply via
careful programming.

A number of other cleanups is made (such us thread finding codes in
procfs which clearly was built for some ages old and odd kernels).

sem_post/sem_wait synchronization was previously potentially prone to
deadlock (if parent died at bad time). We now use pipe pair for this
synchronization and it is fully robust.
2023-07-02 22:30:00 -04:00
Aliaksey Kandratsenka
2186967987 fix heap checker unittest
We had shell wrapper for heap checker unittest, but it failed to deal
with heap-checker-debug variant. So we now posix_spawn from .cc test
instead.
2023-07-02 22:30:00 -04:00
Aliaksey Kandratsenka
b7e47a77c0 simplify heap checker building default to be Linux-only
This also fixes cmake and freebsd where previously check for freebsd
wasn't working.
2023-07-02 22:30:00 -04:00
Aliaksey Kandratsenka
54605b8a58 amputate old atomic ops implementation 2023-07-02 22:30:00 -04:00
Aliaksey Kandratsenka
0451d21e83 use libunwind when it actually works
Previously we blindly tried to use libunwind whenever header is
detected. Even if actually working libunwind library is missing. This
is now fixed, so we attempt to use libunwind when it actually works.

Somehow recent freebsd ships libunwind.h (which seems to belong to
llvm's implementation), but apparently without matching .so. So then building
and linking failed.
2023-07-02 21:28:30 -04:00
Aliaksey Kandratsenka
e003e91b74 drop dependency on PTHREAD_CREATE_JOINABLE 2023-07-02 21:28:30 -04:00
Aliaksey Kandratsenka
bf8b714bf5 bump version to 2.10 2022-05-30 21:21:21 -07:00
Aliaksey Kandratsenka
f7c6fb6c8e bump version to 2.9.1 2021-03-02 19:32:07 -08:00
Aliaksey Kandratsenka
c2f60400a8 prefer backtrace() on OSX
It seems to work and _Unwind_Backtrace which is configured otherwise
doesn't.
2021-02-28 17:52:17 -08:00
Aliaksey Kandratsenka
47b5b59ca9 bump version to 2.9 2021-02-21 15:16:06 -08:00
Aliaksey Kandratsenka
d7cbc8c2ff unbreak cmake build
It was trying to use third_party/valgrind.h header which I recently
removed.
2021-02-21 15:01:01 -08:00
Aliaksey Kandratsenka
96ba58e19b bump version to 2.9rc 2021-02-14 23:18:57 -08:00
Aliaksey Kandratsenka
17bab484ae always respect --enable-frame-pointers
Previously it only was respected on x86_64, but this days lots of modern
ABIs are without frame pointers by default (e.g. arm64 and riscv, and
even older mips).
2021-02-14 16:44:28 -08:00
Aliaksey Kandratsenka
419c85814d amputate unused dynamic annotations support 2021-02-14 16:09:17 -08:00
Aliaksey Kandratsenka
73a72cdb61 don't check for snprintf 2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka
95b52b0504 don't check for unused uname symbol 2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka
ac68c97187 don't check for useless __builtin_stack_pointer
It doesn't seem to be supported anyways, and we're not using it too.
2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka
7271bb72be unbreak cmake check for TLS support 2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka
7c106ca241 don't bother checking for stl namespace and use std
Because there are no compilers left that don't do std namespace.
2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka
0c11d35f4a amputate checking for __int64
Since everything supports stdint.h this days.
2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka
92718aaaeb amputate checking for conflict-signal.h
It was never found or used.
2021-02-14 15:12:19 -08:00
Aliaksey Kandratsenka
9bb2937261 amputate checking for inline keyword support
It is supported everywhere now.
2021-02-14 15:12:19 -08:00
Aliaksey Kandratsenka
d8eb315fb1 bump version to 2.8.1 2020-12-20 23:35:08 -08:00
Aliaksey Kandratsenka
6ed61f8e91 add note that cmake build is preliminary 2020-12-19 19:14:50 -08:00
okhowang(王沛文)
6bbf2ed150 Update cmake 2020-12-19 18:52:40 -08:00
Isaac Hier
913d3eb7d7 Fix a few macros for Apple 2020-12-19 18:52:40 -08:00
Isaac Hier
64a73b1cb8 Work on fixing linking errors in stacktrace 2020-12-19 18:52:40 -08:00
Isaac Hier
b788d51eb4 Fix conditional definitions 2020-12-19 18:52:40 -08:00
Isaac Hier
495229b625 Make internal tcmalloc libs 2020-12-19 18:52:40 -08:00
Isaac Hier
cca7f6f669 More unit tests and libraries 2020-12-19 18:52:40 -08:00
Isaac Hier
11dc65c3c4 Fix config headers, add more unit tests 2020-12-19 18:52:40 -08:00
Isaac Hier
6078fe40d9 Finish configure.ac conversion to CMake, start on Makefile.am 2020-12-19 18:52:40 -08:00
Isaac Hier
515fb22196 Generate config header 2020-12-19 18:52:40 -08:00
Isaac Hier
4adb5ff74d Add architecture checks 2020-12-19 18:52:40 -08:00
Isaac Hier
fa9bedc82c Add most of CMake build 2020-12-19 18:52:40 -08:00
Isaac Hier
9e4f72fd1f Define options, start system checks 2020-12-19 18:52:40 -08:00
Isaac Hier
a6ce98174b Add CMakeLists.txt 2020-12-19 18:52:40 -08:00