Re: [RFC][PATCH v2 00/31] timers: Use del_timer_shutdown() before freeing timers

From: Steven Rostedt
Date: Thu Oct 27 2022 - 15:27:38 EST


On Thu, 27 Oct 2022 15:20:58 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> > (many more of those)
> > ...
> > [ 16.329989] timer_fixup_free+0x40/0x54
>
> Ah, I see the issue here. Looks like the timer_fixup_free() is calling
> itself and crashing.
>
> Let me take a look into that. I didn't touch the fixup code, and there
> could be an assumption there that it's behaving with the old approach.

Can you add this and see if it makes this issue go away?

-- Steve

diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 1d17552b3ede..7305c65ad0eb 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -691,7 +691,7 @@ static bool timer_fixup_init(void *addr, enum debug_obj_state state)

switch (state) {
case ODEBUG_STATE_ACTIVE:
- del_timer_sync(timer);
+ del_timer_shutdown(timer);
debug_object_init(timer, &timer_debug_descr);
return true;
default:
@@ -737,7 +737,7 @@ static bool timer_fixup_free(void *addr, enum debug_obj_state state)

switch (state) {
case ODEBUG_STATE_ACTIVE:
- del_timer_sync(timer);
+ del_timer_shutdown(timer);
debug_object_free(timer, &timer_debug_descr);
return true;
default: