prefetch abort

Posted 91program

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了prefetch abort相关的知识,希望对你有一定的参考价值。

prefetch abort 是一类比较难解决的问题,因为很难定位出错的位置。

更奇怪的是:程序单独运行就会出错,使用VS2008按 F5 运行就不会出错。更不用想单步调试了,也不会出错啦!

 

类似于 Data Abort 的错误,prefetch abort 可能的原因有:

1)操作过程中有Bug,内容被修改;

2)内存重新映射以后,出错的地址处的内容没有初始化;arm,linux,winbond,nuvoton,w90p710,w90n745, 开源,嵌入式,操作系统,嵌入式开发,嵌入式联盟,linux,ecos,uclinux,t- kernel,freeos,rtems,ucos,skyeye,  y1 p) [1 d0 F, ]/ T2 K- W
- 我们只做简洁、实用、专业的嵌入式开发技术论坛。0 m2 `# m& a- d2 H3 P8 n
3)PC指针无效;

 

在网上查找到有这样一篇文章:

Windows CE: Prefetch Aborts, why they are difficult to locate

转载其内容:

Prefetch aborts can be difficult to locate and fix.  To understand why, we first need to understand what a prefetch abort is.  A prefetch abort occurs when the CPU runs out of instructions in its pipeline.  But that can also mean that a zero instruction is in the pipeline.

Possible causes of prefetch aborts:

  1. The CPU really can't get instructions to run.  This could indicate a hardware problem.
  2. An uninitialized function pointer.  I have seen this used as a way to indicate a problem, although I can think of better ways to indicate problems.  This can also be a bug in the code.



    Causes the following debug output:

    Prefetch Abort: Thread=8339d4a8 Proc=81327730 'SDMenu.exe'
    AKY=00000021 PC=00000000(???+0x00000000) RA=00011a58(SDMenu.exe+0x00001a58) BVA=
    00000000 FSR=000004f0

    Notice that the Program Counter (PC) is zero, which should never happen.  But the good news is that the Return Address (RA) is telling us where the code last was.  So this abort message does give us something to go on to find the problem.
  3. Stack overrun, or corrupted stack.

    Writting code to demonstrate this is a challenge becuase the compiler's job is to optimize out code that doesn't do anything.  So the following two functions will cause the prefetch abort.  The reason for the two functions is to trick the compiler into createing the necessary assembly code.

    This set of functions will cause a prefetch abort by corrupting the stack:.


    When it runs, the following abort occurs.  Notice the PC is zero again. Notice that the RETAILMSG at the end of CausePrefetchStackAbort() is displayed, just before the return address is popped off the stack.

    returning CausePrefetchStackAbort( 500 )
    Prefetch Abort: Thread=8339d550 Proc=81327730 ''
    AKY=00000021 PC=00000000(???+0x00000000) RA=00000000(???+0x00000000) BVA=0000000
    0 FSR=000004f0

So the problem with prefetch aborts is that the abort message doesn't always give much to go on to track back to the cause.  When it does, we can use that to find the problem in the code.  I will cover that in a post on Data Aborts soon.

 

以上是关于prefetch abort的主要内容,如果未能解决你的问题,请参考以下文章

Bad mode in prefetch abort handler detected

基于 ARM 的设备上 Prefetch Abort 错误的常见原因是啥?

嵌入式:ARM中断系统设计全解

设置SVC模式

DNS Prefetch/preconnect/prefetch/prerender/Preload

在同步调用上强制 NSUrlConnection 超时