Topic
  • 1 reply
  • Latest Post - ‏2014-04-08T08:26:40Z by Dongxi Jin
2MDW_sfsdfsf_sdfsdfsdfsfsdf
2 Posts

Pinned topic Global data detection problem

‏2014-04-07T18:18:06Z |

How to detect such problem in Purify 7.0.1.0-003( on Windows  ) ?

int array[10];
void main() {
array[11] = 1;
}

 

I have found such example in mtz01-a.stanford.edu/programs/documentation/purify/purify.pdf  on page 46.  Also I've tried using -static-checking=yes flag but it's not recognized.

 

  • Dongxi Jin
    Dongxi Jin
    27 Posts

    Re: Global data detection problem

    ‏2014-04-08T08:26:40Z  

    Hi,

    The document you referenced is a Purify User Guide based on Linux/Unix system. On Linux/Unix, Purify is able to detects references beyond the boundaries of data in global
    variables and static variables, that is, data allocated statically at link-time as opposed to dynamically at run time. If testing your code on Linux, it is able to see reporting ABW. However, on Windows system, Purify detects array bounds errors within dynamically allocated regions (heap memory), not for global, local or static arrays on the stack.