[hacklet] handle kernel > 5.12 rename of task_struct.state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings fellow crash users.  The hacklet below keeps crash working
(for the nonce) into the 5.14 kernel cycle.  I doubt it's applicable (despite being kinda sorta disguised as a patch just in case;), but it should serve as a bandaid until the real deal comes along.

Handle kernel rename of task_struct.state to __state

Kernels post 5.13 renamed task->state to task->__state.  Check the
validity of 'state', and upon failure, rashly presume that "__state"
exists, and isn't going to change again any time soon.

Signed-off-by: Mike Galbraith <efault@xxxxxx>
---
 task.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/task.c
+++ b/task.c
@@ -296,7 +296,10 @@ task_init(void)
 		tt->flags |= THREAD_INFO;
 	}

-        MEMBER_OFFSET_INIT(task_struct_state, "task_struct", "state");
+	if (VALID_MEMBER(task_struct_state))
+        	MEMBER_OFFSET_INIT(task_struct_state, "task_struct", "state");
+	else /* post linux 5.13 */
+        	MEMBER_OFFSET_INIT(task_struct_state, "task_struct", "__state");
         MEMBER_OFFSET_INIT(task_struct_exit_state, "task_struct", "exit_state");
         MEMBER_OFFSET_INIT(task_struct_pid, "task_struct", "pid");
         MEMBER_OFFSET_INIT(task_struct_comm, "task_struct", "comm");


--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux