1b4602bd9b
This adds a fallback backtracer for use on Android where <execinfo.h> ins't present, instead using <unwind.h> to unwind and <dlfcn.h> to lookup function names and addresses. lockf() wasn't available until NDK API 24, so I've just no-op'd file locking on older targets. I tried switching from lockf() to flock(), but flock() didn't see to _do_ anything, neither on Android nor on my Mac laptop. I think I should be able to use the lower-level fcntl() APIs to restore file locking uniformly in a follow-up. The upshot is until then, we'll have interlaced logs and stack traces on Android devices unless you set ndk_api=24 in GN. We need to add a couple build flags to make backtraces useful: * -funwind-tables makes the call to _Unwind_Backtrace() actually traverse the call stack. This is a small extra binary size cost. * -rdynamic makes symbols linked into the main executable visible to dladdr(). We do this on Linux already for the same reason. Here's an example where I made aaxfermodes call SK_ABORT(): 650 ok, 1 crashed caught signal SIGABRT while running 'aaxfermodes' 0x76ed936288 [unknown]+308 0x76eec014e0 [unknown]+510811706592 0x76ed367b2c tgkill+8 0x76ed364f50 pthread_kill+68 0x76ed31ff5c raise+28 0x76ed318814 abort+56 0x76edebd070 sk_out_of_memory()+12 0x76ed99f664 AAXfermodesGM::draw_pass(SkCanvas*, AAXfermodesGM::DrawingPass)+96 0x76ed99f4e4 AAXfermodesGM::onDraw(SkCanvas*)+36 0x76ed9e8550 skiagm::GM::drawContent(SkCanvas*)+224 0x76ed9e82ac skiagm::GM::draw(SkCanvas*)+288 0x76ed93b10c GMStream::GMSrc::draw(SkCanvas*)+96 0x76ed937b08 SWDst::draw(Src*)+284 0x76ed936ca0 [unknown]+112 0x76ed939b4c ForkEngine::spawn(std::function<Status ()>)+88 0x76ed934d00 main+2200 0x76ed316598 __libc_init+92 0x76ed93434c [unknown]+510791992140 Change-Id: Ica4849d99a3b97f48d778f4c15a7fa36275b8133 Reviewed-on: https://skia-review.googlesource.com/40802 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> |
||
---|---|---|
.. | ||
bookmaker | ||
copyright | ||
debugger | ||
fiddle | ||
flags | ||
gpu | ||
lua | ||
skdiff | ||
skiaserve | ||
skp | ||
skpbench | ||
svg | ||
timer | ||
trace | ||
viewer | ||
__init__.py | ||
add_codereview_message.py | ||
AndroidSkDebugToStdOut.cpp | ||
BigPathBench.inc | ||
build_command_buffer.py | ||
BUILD_simulator.py | ||
check-headers-self-sufficient | ||
chrome_fuzz.cpp | ||
colorspaceinfo.cpp | ||
compare_codereview.py | ||
CrashHandler.cpp | ||
CrashHandler.h | ||
create_flutter_test_images.cpp | ||
create_test_font.cpp | ||
doxygen_footer.txt | ||
dump_record.cpp | ||
DumpRecord.cpp | ||
DumpRecord.h | ||
embed_resources.py | ||
find_run_binary.py | ||
fix_pythonpath.py | ||
gcov_shim | ||
generate_fir_coeff.py | ||
generate_vk_interface.sh | ||
get_current_monitor_profile.cpp | ||
get_images_from_skps.cpp | ||
git-sync-deps | ||
gpuveto.cpp | ||
gyp | ||
imgblur.cpp | ||
imgslice.cpp | ||
install_dependencies.sh | ||
ios_utils.h | ||
ios_utils.m | ||
iOSShell.cpp | ||
iOSShell.h | ||
jsondiff.py | ||
LsanSuppressions.cpp | ||
merge_static_libs.py | ||
milestone.py | ||
mirror-dev.sh | ||
misc_utils.py | ||
ok_dsts.cpp | ||
ok_engines.cpp | ||
ok_srcs.cpp | ||
ok_test.cpp | ||
ok_vias.cpp | ||
ok.cpp | ||
ok.h | ||
OverwriteLine.h | ||
parse_llvm_coverage.py | ||
pathops_sorter.htm | ||
pathops_visualizer.htm | ||
picture_utils.cpp | ||
picture_utils.h | ||
pinspect.cpp | ||
ProcStats.cpp | ||
ProcStats.h | ||
public_headers_warnings_check.cpp | ||
random_parse_path.cpp | ||
random_parse_path.h | ||
reformat-json.py | ||
Registry.h | ||
Resources.cpp | ||
Resources.h | ||
retrieve_from_googlesource.py | ||
sanitize_source_files.py | ||
sk_tool_utils_flags.h | ||
sk_tool_utils_font.cpp | ||
sk_tool_utils.cpp | ||
sk_tool_utils.h | ||
skhello.cpp | ||
SkJSONCPP.h | ||
skp_parser.cpp | ||
skpinfo.cpp | ||
skpmaker.cpp | ||
SkShaper_harfbuzz.cpp | ||
SkShaper_primitive.cpp | ||
SkShaper.h | ||
Stats.h | ||
test_all.py | ||
test_font_index.inc | ||
test_font_monospace.inc | ||
test_font_sans_serif.inc | ||
test_font_serif.inc | ||
test_gpuveto.py | ||
test_pdfs.py | ||
ThermalManager.cpp | ||
ThermalManager.h | ||
UrlDataManager.cpp | ||
UrlDataManager.h | ||
using_skia_and_harfbuzz.cpp | ||
valgrind.supp | ||
whitelist_typefaces.cpp | ||
win_dbghelp.cpp | ||
win_dbghelp.h | ||
win_lcid.cpp | ||
xsan.blacklist |