aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-09-13 13:10:47 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-09-13 13:10:47 +0100
commit89f2c5d327ab9f95379de264dd6f1e982087e5a0 (patch)
treed63c2fddc8765e8b28bdb3ced37ac419a9fa341a
parent6b55b31af8029ff01bdb432bdbad5608c83918f5 (diff)
downloadrspamd-89f2c5d327ab9f95379de264dd6f1e982087e5a0.tar.gz
rspamd-89f2c5d327ab9f95379de264dd6f1e982087e5a0.zip
[Minor] Use a more standard way to initialize libunwind
-rw-r--r--src/libserver/worker_util.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index a0abe63b1..32e1e9ae0 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -1612,14 +1612,16 @@ void rspamd_worker_init_monitored(struct rspamd_worker *worker,
#ifdef WITH_LIBUNWIND
static void
-rspamd_print_crash(ucontext_t *uap)
+rspamd_print_crash(ucontext_t *_uap)
{
unw_cursor_t cursor;
- unw_word_t ip, off;
+ unw_context_t uc;
+ unw_word_t ip, off, sp;
guint level;
gint ret;
- if ((ret = unw_init_local(&cursor, uap)) != 0) {
+ unw_getcontext(&uc);
+ if ((ret = unw_init_local(&cursor, &uc)) != 0) {
msg_err("unw_init_local: %d", ret);
return;
@@ -1640,10 +1642,10 @@ rspamd_print_crash(ucontext_t *uap)
if (ret == 0) {
msg_err("%d: 0x%xl: %s()+0x%xl",
- level, (unsigned long)ip, name, (unsigned long)off);
+ level, (unsigned long) ip, name, (unsigned long) off);
}
else {
- msg_err("%d: %0x%xl: <unknown>", level, (unsigned long)ip);
+ msg_err("%d: %0x%xl: <unknown>", level, (unsigned long) ip);
}
level++;