Closed just-now closed 7 months ago
In multi-threading environment, using static quantifier in line 22 near by static char _msg[1024]; may cause data corruption. It's worth removing static.
static char _msg[1024];
static
#define tracef(...) \ do { \ if (UNLIKELY(_dqliteTracingEnabled)) { \ static char _msg[1024]; \ snprintf(_msg, sizeof(_msg), __VA_ARGS__); \ struct timespec ts = {0}; \ /* Ignore errors */ \ clock_gettime(CLOCK_REALTIME, &ts); \ int64_t ns = ts.tv_sec * 1000000000 + ts.tv_nsec; \ fprintf(stderr, "LIBDQLITE %" PRId64 " %s:%d %s\n", \ ns, __func__, __LINE__, _msg); \ } \ } while (0)
fixed in #542
In multi-threading environment, using static quantifier in line 22 near by
static char _msg[1024];
may cause data corruption. It's worth removingstatic
.