Locate bad memory access on Solaris

后端 未结 3 965
孤独总比滥情好
孤独总比滥情好 2020-12-15 12:39

On Linux, FreeBSD and other systems I have valgrind for checking for memory errors like invalid reads and similar. I really love valgrind. Now I have to test code on Solaris

相关标签:
3条回答
  • 2020-12-15 12:43

    Since version 3.11.0, Valgrind does run on Solaris. See Release Notes and Supported Platforms.

    More precisely, x86/Solaris and amd64/Solaris is now supported. Support for sparc/Solaris is still in works.

    0 讨论(0)
  • 2020-12-15 12:53

    watchmalloc is a quite useful library that can be dynamically loaded for your program (usually no need for recompiling) and then sets watchpoints at all the usually problematic memory locations, like freed areas or after an allocated memory block. If your program accesses one of these invalid areas it gets a signal and you can inspect it in the debugger.

    Depending on the configuration problematic areas can be watched for writes only, or also for reads.

    0 讨论(0)
  • 2020-12-15 12:56

    The dbx included with the Sun Studio compilers includes memory access checking support in its "Run Time Checking" feature (the check subcommand). See:

    • Solaris Studio 12.4 dbx manual: Chapter 9: Using Runtime Checking
    • Debugging Applications with Sun Studio dbx, dbxtool, and the Thread Analyzer
    • Leonard Li's Weblog: Runtime Memory Checking

    The related "Sun Memory Error Discovery Tool" is also available from http://cooltools.sunsource.net/discover/

    0 讨论(0)
提交回复
热议问题