Skip to content

Commit

Permalink
tmp: backtrace on second address
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukáš Ondráček committed Dec 2, 2024
1 parent 6c9d047 commit 9287473
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions daemon/defer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "lib/defines.h"
#include "lib/utils.h"
#include "lib/kru.h"
#include "execinfo.h"

/// Initialize defer, incl. shared memory with KRU, excl. idle.
KR_EXPORT
Expand Down Expand Up @@ -50,11 +51,13 @@ static inline void defer_sample_addr(const union kr_sockaddr *addr, bool stream)

if (defer_sample_state.addr.ip.sa_family != AF_UNSPEC) {
// TODO: this costs performance, so only in some debug mode?
if (kr_fails_assert(kr_sockaddr_cmp(&addr->ip, &defer_sample_state.addr.ip) == kr_ok())) {
if (!(kr_sockaddr_cmp(&addr->ip, &defer_sample_state.addr.ip) == kr_ok())) {
kr_log_error(DEFER, "%s != %s\n",
kr_straddr(&addr->ip),
kr_straddr(&defer_sample_state.addr.ip));
abort(); // TODO change this to warning or remove before releasing
char buf[10000];
backtrace_symbols_fd((void *) buf, 10000, 2);
kr_require(false);
return;
}

Expand Down

0 comments on commit 9287473

Please sign in to comment.