From b201ada26638ce5d97ccdb29b20d6669b4ef8e55 Mon Sep 17 00:00:00 2001 From: Mateusz Moscicki Date: Thu, 29 Apr 2021 12:57:55 +0200 Subject: [PATCH] crash-manager: Fix TID finding To find a thread ID that crashed crash-worker checked if /proc//tasks//wchan contains pipe_wait or do_coredump. Additionally it should check if pipe_write is there, because since kernel 5.10 this content is for the thread that crashed. Change-Id: Ic45913306d4f5b39ae704abdd58bbd79fef5e7cd --- src/shared/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/util.c b/src/shared/util.c index 4c04626..778f0ad 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -473,10 +473,12 @@ static int check_thread_wchan(int pid, int tid) buf[cnt] = 0; close(fd); - if (strncmp("do_coredump", buf, sizeof(buf)) == 0 || strncmp("pipe_wait", buf, sizeof(buf)) == 0) + if (strncmp("do_coredump", buf, sizeof(buf)) == 0 || + strncmp("pipe_wait", buf, sizeof(buf)) == 0 || + strncmp("pipe_write", buf, sizeof(buf)) == 0) return tid; else - return 0; + return -1; } /** -- 2.7.4