Summary:
dbg and dbgo builds of hhvm with gcc-5 crash when generating
backtraces using folly::Symbolizer, because the .debug_aranges for
libc-2.23.so are SHF_COMPRESSED, and folly::Symbolizer doesn't
recognize that.
Just pretend that the section doesn't exist if it has SHF_COMPRESSED
set.
We might eventually want to support decompressing such sections under
an option - but folly::Symbolizer's goal is to just mmap and walk the
debug info without allocating memory (so that it can run while
handling signals etc).
Reviewed By: pixelb
Differential Revision:
D4586762
fbshipit-source-id:
bef61ed670d1a80caa4f7aac1f80fd2a92cc4ba9
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
* limitations under the License.
*/
#include <folly/experimental/symbolizer/Dwarf.h>
#include <type_traits>
#include <folly/experimental/symbolizer/Dwarf.h>
#include <type_traits>
if (!elfSection) {
return false;
}
if (!elfSection) {
return false;
}
+#ifdef SHF_COMPRESSED
+ if (elfSection->sh_flags & SHF_COMPRESSED) {
+ return false;
+ }
+#endif
*section = elf_->getSectionBody(*elfSection);
return true;
}
*section = elf_->getSectionBody(*elfSection);
return true;
}
elf_ = nullptr;
return;
}
elf_ = nullptr;
return;
}
- getSection(".debug_str", &strings_);
// Optional: fast address range lookup. If missing .debug_info can
// be used - but it's much slower (linear scan).
// Optional: fast address range lookup. If missing .debug_info can
// be used - but it's much slower (linear scan).