How to debug random data abort issue on arm based platform

a 夏天 提交于 2019-12-05 04:12:08

问题


As developing on ARM based project, we get data abort randomly, that is when we play with it we get a data abort interrupt. But the data abort is not always on the same point when we check with the register map with r14 or r13, even though check the function callback. Is there anyway that I can get the information about the root cause on data abort precisely? I have try the ref2 but could not get the same point when I trap the data about interrupt.

Related ARM Data Abort error exception debugging ARM: HOW TO ANALYZE A DATA ABORT EXCEPTION


回答1:


Checking the link register (r14) as described in your Keil link above will show you the instruction that triggered the data abort. From there you'll have to figure out why it triggered a data abort and how that could have happened, which is the difficult part.

In my experience what most likely happened is that you accessed an invalid pointer. It can be invalid for many reasons. Here are a few candidates:

  1. You used the pointer before it was initialized
  2. You used the pointer after it, or the containing memory, had been freed (and was subsequently modified when another function allocated it)
  3. The pointer was corrupted by a stack overflow
  4. The pointer was corrupted by other, unrelated, misbehaving code that is trampling on memory
  5. The pointer was allocated on the stack as a local variable and then used after the allocating function had exited
  6. The pointer has incorrect alignment for its type (for example, trying to access 0x4001 as a uint32_t)

As you can see, lots of things can be the root cause of an ARM data abort. Finding the root cause is part of what makes ARM software/firmware development so much fun! Good luck figuring out your puzzle.



来源:https://stackoverflow.com/questions/11474700/how-to-debug-random-data-abort-issue-on-arm-based-platform

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!