redex
redex copied to clipboard
Unintelligible crash stacktrace
Right now, if Redex crashes inside of a walk::parallel::*
method the stack trace is largely unintelligible which makes debugging issues extremely difficult and irritating.
For example, I've got a crash and I can't make heads or tails of what happened other than it is related to SingleImplConfig
and analyze_opcodes
.
0 redex-all 0x0000000107ee8831 _Z23crash_backtrace_handleri + 81
1 libsystem_platform.dylib 0x00007ff815c1adfd _sigtramp + 29
2 ??? 0x0000000042000000 0x0 + 1107296256
3 redex-all 0x0000000107d72fe7 _ZN5boost6detail11thread_dataINSt3__18__bind_rIvRZN6sparta15SpartaWorkQueueIP8DexClassN20redex_workqueue_impl22NoStateWorkQueueHelperIS7_ZN4walk8parallel4codeINS2_6vectorIS7_NS2_9allocatorIS7_EEEEFbP9DexMethodEZN12AnalysisImpl15analyze_opcodesERK16SingleImplConfigE4$_10EEvRKT_RKT0_RKT1_mEUlS7_E_EEE7run_allEvEUlPNS4_17SpartaWorkerStateIS7_EEmE_JS13_RmEEEE3runEv + 583
4 redex-all 0x000000010846d242 _ZN5boost12_GLOBAL__N_112thread_proxyEPv + 130
5 libsystem_pthread.dylib 0x00007ff815c054e1 _pthread_start + 125
6 libsystem_pthread.dylib 0x00007ff815c00f6b thread_start + 15
Traceback (most recent call last):
File "/tmp/redex.6A59yw/redex.py", line 1311, in <module>
with_temp_cleanup(lambda: run_redex(args), args.always_clean_up)
File "/private/tmp/redex.6A59yw/pyredex/utils.py", line 81, in with_temp_cleanup
fn()
File "/tmp/redex.6A59yw/redex.py", line 1311, in <lambda>
with_temp_cleanup(lambda: run_redex(args), args.always_clean_up)
File "/tmp/redex.6A59yw/redex.py", line 1290, in run_redex
run_redex_binary(state, exception_formatter, output_line_handler)
File "/tmp/redex.6A59yw/redex.py", line 377, in run_redex_binary
run()
File "/tmp/redex.6A59yw/redex.py", line 370, in run
raise RuntimeError(msg)
RuntimeError: redex-all crashed with exit code -11! You can re-run it under gdb by running /tmp/redex.6A59yw/redex-gdb-63m42nks.sh or under lldb by running /tmp/redex.6A59yw/redex-lldb-a1gw9qq4.sh
We don't currently support nicely symbolized stacks on MacOS. If you were on Linux and with addr2line
available it would give you a nicer abort message.
The code for that is here. If you want to contribute something similar for Mac's atos
we'd be happy to take it.