FAIL: strace-k

Masatake YAMATO yamato at redhat.com
Thu Mar 19 09:15:07 UTC 2015


Hi,

About ppc, ppc64, I have no idea.
I guess the way to unwind in vdso area is different from that in normal area.


About aarch64, could you try a patch at the end of this mail?
With the patch, strace will print an error code defined in libunwind-common.h.
This will be a hint. (The patch is an temporary one. I will submit a better one for
merging to the official source tree.)

/* Error codes.  The unwind routines return the *negated* values of
   these error codes on error and a non-negative value on success.  */
typedef enum
  {
    UNW_ESUCCESS = 0,		/* no error */
    UNW_EUNSPEC,		/* unspecified (general) error */
    UNW_ENOMEM,			/* out of memory */
    UNW_EBADREG,		/* bad register number */
    UNW_EREADONLYREG,		/* attempt to write read-only register */
    UNW_ESTOPUNWIND,		/* stop unwinding */
    UNW_EINVALIDIP,		/* invalid IP */
    UNW_EBADFRAME,		/* bad frame */
    UNW_EINVAL,			/* unsupported operation or bad value */
    UNW_EBADVERSION,		/* unwind info has unsupported version */
    UNW_ENOINFO			/* no unwind info found */
  }
unw_error_t;

Masatake YAMATO

diff --git a/unwind.c b/unwind.c
index 6f422a1..65de278 100644
--- a/unwind.c
+++ b/unwind.c
@@ -366,6 +366,7 @@ stacktrace_walk(struct tcb *tcp,
 	size_t symbol_name_size = 40;
 	unw_cursor_t cursor;
 	int stack_depth;
+	unw_error_t err;
 
 	if (!tcp->mmap_cache)
 		error_msg_and_die("bug: mmap_cache is NULL");
@@ -376,8 +377,9 @@ stacktrace_walk(struct tcb *tcp,
 	if (!symbol_name)
 		die_out_of_memory();
 
-	if (unw_init_remote(&cursor, libunwind_as, tcp->libunwind_ui) < 0)
-		perror_msg_and_die("Can't initiate libunwind");
+	err = unw_init_remote(&cursor, libunwind_as, tcp->libunwind_ui);
+	if (err < 0)
+		perror_msg_and_die("Can't initiate libunwind (error code: %d)", err);
 
 	for (stack_depth = 0; stack_depth < 256; ++stack_depth) {
 		if (print_stack_frame(tcp, call_action, error_action, data,






More information about the Strace-devel mailing list