Task WDT triggered in __log2() and weird program behavior
Posted: Wed Jan 26, 2022 6:02 am
I'm looking into an issue where the system hangs and would trigger task watchdog if enabled. Backtrace reported by WDT looks like the following:
Seems the hang happens inside a call to __log2(), which is itself a simple function:
So I attached gdb to a running (hanging) instance and examined the assembly listing as running on the core:
Here is the weird part: the jump address for instruction at <__log2+17> is nowhere inside the valid range (not a start address of an instruction), right? What could be wrong?
Thanks for your help!
Seems the hang happens inside a call to __log2(), which is itself a simple function:
- __uint32_t
- __log2(num)
- __uint32_t num;
- {
- __uint32_t i, limit;
- limit = 1;
- for (i = 0; limit < num; limit = limit << 1, i++);
- return (i);
- }
Here is the weird part: the jump address for instruction at <__log2+17> is nowhere inside the valid range (not a start address of an instruction), right? What could be wrong?
Thanks for your help!