0

I am currently experiencing a kernel panic with one of my code. The kernel panic seem to be not with null pointer dereferencing, since I have got the below hint,

Kernel panic - not syncing: softlockup: hung tasks

Using GDB, I decoded the backtrace and the crash points to below line,

for (i = 0; i <= list->maxlimit; i++), where i is short int and packet->maxlimit is integer(32 bit)

On further disassembling the function, I found the crash points to the below ARM instruction

uxtb w4,w4

which is nothing but variable promotion before comparing (i <= list->maxlimit).

I would like to know whether kernel panic occurs with variable promotion or my interpretation is wrong. Also please let me know what softlockup kernel panic means and how to proceed with that kind of kernel panics?

Thanks in advance!

Thanks, Santhosh

  • what can we say except that _list_ is an invalid address ? – bruno Jan 06 '19 at 18:35
  • I don't see the string `list->maxlimit` in the kernel sources? Is this your own code? – Florian Weimer Jan 06 '19 at 18:59
  • @FlorianWeimer Ya this is my own code...the crash is pointing to variable promotion...something wierdo – santhosh Jan 06 '19 at 19:43
  • @bruno list holds a valid valid, otherwise I would have observed a crash while dereferencing itself...but the crash points to variable promotion of i – santhosh Jan 06 '19 at 19:44
  • @bruno List holds a valid address, otherwise I would have observed a crashed while dereferncing itself...the crash points at variable promotion of i – santhosh Jan 06 '19 at 19:46
  • @santhosh Probably the code is running into an infinite loop or something like that, which is why the kernel detects a soft lockup (basically, an unexpected delay). – Florian Weimer Jan 06 '19 at 20:24
  • @FlorianWeimer oh, if that is the case, then why does it point to variable promotion. That's confusing me...i am not able to move further on this....could you please let me know how could we approach this issue? – santhosh Jan 06 '19 at 20:28
  • @santhosh I think soft lockups are reported asynchronously, interrupting whatever the CPU is doing at this point. You can add some `printks` (with loop iteration counts, and also in loops) to determine how the code executes and check that it matches your expectations. – Florian Weimer Jan 06 '19 at 20:32
  • @FlorianWeimer Thanks for your inputs...but I came across this issue only once...Dont know flooding debugs would help... – santhosh Jan 06 '19 at 20:39
  • What is the value of maxlimit? If it is integer type and larger than short type the index i may overflow back to 0 before reaching the maxlimit hence your process is stuck by the for loop... the softlockup error can happen for various reasons. It is likely your process is holding a lock and get stuck in the for loop and cause starvation on other tasks that are waiting for the same lock – luke Jan 06 '19 at 21:05
  • @luke Ya maxlimit is integer and index i is short int – santhosh Jan 06 '19 at 21:12

0 Answers0