7

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/OpenSolaris and can't find a way to get information on invalid reads/writes in an as nice way (or better ;-)) as valgrind there.

When searching for this on the net I find references to libumem, but I get only reports about memory leaks there, not invalid access. What am I missing?

Andrew Cheong
  • 29,362
  • 15
  • 90
  • 145
johannes
  • 15,807
  • 3
  • 44
  • 57

3 Answers3

6

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

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

alanc
  • 4,102
  • 21
  • 24
  • hm, i had been there and forgotabout it ... playing with the bcheck wrapper now and trying to get it in my automated test suite. – johannes Dec 11 '09 at 19:20
  • There is now also an [experimental/partial port of valgrind to Solaris](https://bitbucket.org/setupji/valgrind-solaris) that was made by a student as part of their [master thesis project](https://dip.felk.cvut.cz/browse/pdfcache/pavlupe1_2012dipl.pdf). – alanc Aug 18 '12 at 17:20
2

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.

ivosh
  • 153
  • 4
  • 10
  • Just to mention, you have to have at least Solaris 11. In particular, Solaris 10.X is not supported. – marol Nov 13 '15 at 08:15
1

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.

alanc
  • 4,102
  • 21
  • 24
sth
  • 222,467
  • 53
  • 283
  • 367