Browse Source

unwind-libdw: fix initialization of libdwfl cache

This fixes stack trace printing for early syscalls that precede
the first syscall from memory mapping or execve families.

* unwind-libdw.c (tcb_init): Set struct ctx.last_proc_updating
to a value different from mapping_generation so that libdwfl cache
is properly initialized before the first use.
* NEWS: Mention this fix.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1788636
Dmitry V. Levin 1 month ago
parent
commit
69b2c33a77
2 changed files with 3 additions and 1 deletions
  1. 2
    0
      NEWS
  2. 1
    1
      unwind-libdw.c

+ 2
- 0
NEWS View File

@@ -8,6 +8,8 @@ Noteworthy changes in release ?.? (????-??-??)
8 8
   * Updated lists of BPF_* constants.
9 9
 
10 10
 * Bug fixes
11
+  * Fixed stack trace printing for early syscalls when strace is configured
12
+    to use libdw backend for stack tracing.
11 13
   * Fixed potentially unaligned access in decoder of SO_TIMESTAMP*_NEW
12 14
     control messages.
13 15
   * Fixed decoding of NDA_LLADDR netlink neighbor table attribute.

+ 1
- 1
unwind-libdw.c View File

@@ -69,7 +69,7 @@ tcb_init(struct tcb *tcp)
69 69
 
70 70
 	struct ctx *ctx = xmalloc(sizeof(*ctx));
71 71
 	ctx->dwfl = dwfl;
72
-	ctx->last_proc_updating = 0;
72
+	ctx->last_proc_updating = mapping_generation - 1;
73 73
 	return ctx;
74 74
 }
75 75
 

Loading…
Cancel
Save