Enable folly::Symbolizer for debug symbols#8123
Open
florinpapa wants to merge 3 commits into
Open
Conversation
added 2 commits
February 9, 2018 11:32
In the Options.cmake file, MAP_TEXT_HUGE_PAGES and ENABLE_FOLLY_SYMBOLIZER are set depending on the value of the LINUX variable, which is only set in a file included later - HPHPCompiler.cmake. This causes these 2 variables not to be visible in third-party modules the first time configure is run (subsequent times the variables are taken from the cmake cache). This change fixes this behavior by adding a new cmake file that sets the OS variables and including it before Options.cmake.
This change depends on hhvm/hhvm-third-party#123, which enables 2 additional source files to be compiled and adds libunwind as a dependency for folly. The "-lgcc_s" added before "-lunwind" is used to solve a linking order issue that causes "_Ux86_64_setcontext" to be called from libunwind instead of libgcc_s and messes up the signal mask (more details here http://savannah.nongnu.org/bugs/?48486). The libgcc_s dependency is already part of HHVM, this change enforces the order in which the libraries are linked. By enabling folly::Symbolizer, HHVM will show debug symbols (in stacktraces, perf, GDB) when huge pages are enabled (default behavior for open source builds). Also, one nice side-effect is that this change causes HHVM to show symbols in backtraces (after a crash) for non-huge-pages builds, which were missing for some reason.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables folly::Symbolizer in HHVM, in order to have debug symbols (in stacktraces, perf, GDB) when huge pages are enabled (default behavior for open source builds). This feature can be
turned off by setting the CMake option ENABLE_FOLLY_SYMBOLIZER to OFF.
Also, one nice side-effect is that this change causes HHVM to show symbols in backtraces (after a crash) for non-huge-pages builds, which were missing for some reason.
It also fixes an issue with the build system, by creating a new cmake file that initializes the OS variables and including it before Options.cmake, where these variables are used. More specifically, MAP_TEXT_HUGE_PAGES and ENABLE_FOLLY_SYMBOLIZER are set depending on the value of the LINUX variable, which is only set in HPHPCompiler.cmake, included later. This causes these 2 variables not to be visible in third-party modules the first time configure is run (subsequent times the variables are taken from the cmake cache).
This PR depends on hhvm/hhvm-third-party#123.