diff options
author | Luca Clementi <luca.clementi@gmail.com> | 2014-01-07 00:00:59 -0800 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-22 20:38:24 +0900 |
commit | 42257ddab08af8d797457d0fdc8199cccb56a66c (patch) | |
tree | 155f1677a6710516350cc51a2b218802e5842979 /output.c | |
parent | ef7bcd4f12ad7f50a7ff3e7a4f2807cb41724655 (diff) | |
download | ltrace-42257ddab08af8d797457d0fdc8199cccb56a66c.tar.gz ltrace-42257ddab08af8d797457d0fdc8199cccb56a66c.tar.bz2 ltrace-42257ddab08af8d797457d0fdc8199cccb56a66c.zip |
Fix infinite loop in stack unwind
This bug was introduced in af452c6
Reported-by: Petr Machata <pmachata@redhat.com>
Diffstat (limited to 'output.c')
-rw-r--r-- | output.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -662,9 +662,12 @@ output_right(enum tof type, struct process *proc, struct library_symbol *libsym, unw_init_remote(&cursor, proc->unwind_as, proc->unwind_priv); while (unwind_depth) { - if (unw_get_reg(&cursor, UNW_REG_IP, (unw_word_t *) &ip)) { - fprintf(options.output, " > stacktrace_error\n"); - continue; + own_retval = unw_get_reg(&cursor, UNW_REG_IP, + (unw_word_t *) &ip); + if (own_retval) { + fprintf(options.output, " > Error: %s\n", + unw_strerror(own_retval)); + goto cont; } /* We are looking for the library with the base address @@ -694,6 +697,7 @@ output_right(enum tof type, struct process *proc, struct library_symbol *libsym, fprintf(options.output, " > %s(??\?) [%p]\n", lib_name, ip); + cont: if (unw_step(&cursor) <= 0) break; unwind_depth--; |