Fix some copyright lines in folly/experimental/symbolizer/ Summary: [Folly] Fix some copyright lines in `folly/experimental/symbolizer/`. (Note: this ignores all push blocking failures!) Reviewed By: Orvid Differential Revision: D6648183 fbshipit-source-id: 36f9df5af91400a37dfa5ee2b209ffd47d5069df
Avoid tautological compare in folly/experimental/symbolizer/ Summary: [Folly] Avoid tautological compare in `folly/experimental/symbolizer/`. `x < 0` when `x` is unsigned is tautological and there are warnings against such comparisons. The underlying type of an unscoped enumerations without a fixed underlying type is not specified, and whether it is signed is also not specified; it could be unsigned, and is unsigned in practice in common cases. Reviewed By: Orvid, eduardo-elizondo Differential Revision: D5897792 fbshipit-source-id: 24d84f9bf2c61c907585e1b675c2bbf11ef1720b
Consistency in namespace-closing comments Summary: [Folly] Consistency in namespace-closing comments. Reviewed By: Orvid Differential Revision: D5524744 fbshipit-source-id: ced4dd2398ed6baa3ad5b68b74eee6a5d6b2b103
Apply clang-format to folly/experimental/symbolizer/ Summary: [Folly] Apply `clang-format` to `folly/experimental/symbolizer/`. Reviewed By: Orvid Differential Revision: D5468832 fbshipit-source-id: 94a0f82312769be0e8be724c11f97e14425ead10
Use more libstdc++ specific macro Summary: - The __GNUC__ macro is used by other compilers like Clang and ICC, but ext/stdio_filebuf.h is a libstdc++ only extension. fixes #636 Closes https://github.com/facebook/folly/pull/637 Reviewed By: yfeldblum Differential Revision: D5434532 Pulled By: Orvid fbshipit-source-id: ce4f966a74aa9f82ae907c67807ac87ec1588173
Sort #include lines Summary: [Folly] Sort `#include` lines, as required by `clang-format`. Reviewed By: igorsugak, Orvid Differential Revision: D5405153 fbshipit-source-id: 3bb1c2b84271bcf7a195e07680777dbfdd499823
fix rest of non-portable includes Summary: According to internal linter Reviewed By: Orvid Differential Revision: D5051010 fbshipit-source-id: febdeca05ac1cf3ad82617169f90912a445cf173
Switch implicit references of folly::make_unique to std::make_unique Summary: It's *almost* dead. This switches things to explicitly reference `std::make_unique` so that `folly::make_unique` can be marked as deprecated until mobile catches up and it can be killed completely. Reviewed By: yfeldblum Differential Revision: D5026584 fbshipit-source-id: aefc8cb3de84583fd3722fdb9dfea620884590c5
reduce consumed stack size in symbolizer Summary: It currently takes ~32kB of stack trace to run symbolizer, which is very close to ASan alt stack size (32 kB). If we exclude `demangle` (which can use unbound stack size in extreme cases), the heaviest path in symbolizer includes `FrameArray<100>` and three arrays of `PATH_MAX` (4 kB) size. This diff removes the former and one of the latters, reducing this code path from 32 kB to ~10 kB. Reviewed By: ot, yfeldblum Differential Revision: D4618467 fbshipit-source-id: e6a53b61b3d5f6e8b892216d2e9b839ed8430d0e
2017 Summary: [Folly] 2017. Reviewed By: Orvid Differential Revision: D4378593 fbshipit-source-id: 4a448228bb1ddbe191b6e8562483867a399be846
Allow building with -Wgnu-conditional-omitted-operand Summary: Which warns about the use of a ternary statement with the first operand omitted. This is a GCC extension and MSVC does not support it, so eliminate the last use of it. Reviewed By: yfeldblum Differential Revision: D4309989 fbshipit-source-id: 04c968708e47f8cb707fd0892e8780bc676df0de
Expose folly::symbolizer::dumpStackTrace(). Summary: Expose folly::symbolizer::dumpStackTrace() for use with custom signal handlers. Reviewed By: luciang Differential Revision: D4174004 fbshipit-source-id: 510b77edef652f3e9d10f0acfb4998b64a15fad5
fall back to .debug_info scan in fatal signal handler Summary: We've found clang might be generating incomplete `.debug_aranges`, while falling back to linear `.debug_info` scan is too expensive and shouldn't be used by default, we can afford doing that in fatal signal handler. Also optimize `exception_tracer::printExceptionInfo()` to avoid `LocationInfo` resolution if `NO_FILE_AND_LINE` is used. Reviewed By: luciang, ot Differential Revision: D4020989 fbshipit-source-id: 84172208736b224c19206da48bcb3b5c0b2c67d0
Use _r_debug instead of /proc/<pid>/maps for folly::symbolizer Summary: Using _r_debug offers a number of benefits: - It allows us to symbolize addresses in data segments like .bss that are marked "[heap]" in /proc/<pid>/maps. - It requires a lot less code. It also fixes a preexisting bug where we would fail to symbolize addresses that fell in any section past the first in any position- independent objects. Since `elfFile->getBaseAddress()` should always return 0 for any PIEs, we wouldn't correctly adjust the address to be ELF-relative when performing symbol lookup. (For the first section, we just used the start of the range we found in /perf/<pid>/maps.) There is a minor downside: - We have to open an ELF header for each object in order to check if a given address is in the range of some segment. Before, we used /proc/<pid>/maps to make the range check, and only opened the header once we knew it was the one we wanted. In the common case, however, where the addresses are from our own executable, we don't open any more files than before (and, in fact, one fewer). Reviewed By: luciang Differential Revision: D3695872 fbshipit-source-id: 9bdcc77da4d658ffad5c671f9b8ea65a471ed64f
don't destory defaultElfCache in exit handlers Summary: As it might be used during global destruction (for example, to symbolize unhandled exception happened at that time). Reviewed By: luciang, ot Differential Revision: D3238303 fb-gh-sync-id: 39d8a6f99d95e700586349436e961f3624c95718 fbshipit-source-id: 39d8a6f99d95e700586349436e961f3624c95718
Allow usage of Symbolizer options for ExceptionStats printing Summary: For exceptions aggregation conveniece Reviewed By: philippv Differential Revision: D3128132 fb-gh-sync-id: 48c72df364228c1d2c8f29161c2b85c131b4fea8 fbshipit-source-id: 48c72df364228c1d2c8f29161c2b85c131b4fea8
folly copyright 2015 -> copyright 2016 Summary: Update copyright for 2016 Reviewed By: igorsugak Differential Revision: D2828047 fb-gh-sync-id: 8638188aeb694c3ca2a615cc2bc3bc9d251e388d shipit-source-id: 8638188aeb694c3ca2a615cc2bc3bc9d251e388d
folly::Symbolizer can be enhanced for dumpStackTrace Summary: added functionality in Symbolizer.cpp to handle multi-segment binary and to allow symbol lookup via /proc/self/exe when some or whole text is relocated to ANON pages such as during hugification. An example of multi-segment binary : P56071432 cc markw65 - a part of the change include logic pulled from hphp/runtime/base/stack-logger.cpp:symbolize_huge_text so that hugified consumers of dumpStackTrace need not fork off. Reviewed By: edwardc Differential Revision: D2802837 fb-gh-sync-id: 577ab1b4ef8f22059894bfdd9c0526a22ee89ca8
folly: Symbolizer: don't colorize TERM="dumb" or TERM="" or TERM-undefined TTYs Reviewed By: @dcolascione Differential Revision: D2548486 fb-gh-sync-id: 6e2d7e84598eb5b05aba7a262b7c53532337dbe3
folly: Symbolizer: don't allocate from function which is supposed to be signal safe Reviewed By: @philippv, @dcolascione Differential Revision: D2548023 fb-gh-sync-id: d2b0571d5db03e38ed17a5de6a13d2194a05b2b9