diff --git a/src/util-debug.c b/src/util-debug.c index 8283c99c5f..7a78987dda 100644 --- a/src/util-debug.c +++ b/src/util-debug.c @@ -358,12 +358,19 @@ SCError SCLogMessage(SCLogLevel log_level, char **msg, const char *file, substr = temp_fmt; substr++; break; - case SC_LOG_FMT_TM: temp_fmt[0] = '\0'; +/* disabled to prevent dead lock: + * log or alloc (which calls log on error) can call TmThreadsGetCallingThread + * which will lock tv_root_lock. This can happen while we already hold this + * lock. */ +#if 0 ThreadVars *tv = TmThreadsGetCallingThread(); cw = snprintf(temp, SC_LOG_MAX_LOG_MSG_LEN - (temp - *msg), "%s%s", substr, ((tv != NULL)? tv->name: "UNKNOWN TM")); +#endif + cw = snprintf(temp, SC_LOG_MAX_LOG_MSG_LEN - (temp - *msg), + "%s%s", substr, "N/A"); if (cw < 0) goto error; temp += cw; @@ -371,7 +378,6 @@ SCError SCLogMessage(SCLogLevel log_level, char **msg, const char *file, substr = temp_fmt; substr++; break; - case SC_LOG_FMT_LOG_LEVEL: temp_fmt[0] = '\0'; s = SCMapEnumValueToName(log_level, sc_log_level_map);