English 中文(简体)
Locate bad memory access on Solaris
原标题:

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?

最佳回答

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/

问题回答

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.

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.





相关问题
Portable way to get file size (in bytes) in the shell

On Linux, I use stat --format="%s" FILE, but the Solaris machine I have access to doesn t have the stat command. What should I use then? I m writing Bash scripts and can t really install any ...

Unix: fast remove directory for cleaning up daily builds

Is there a faster way to remove a directory then simply submitting rm -r -f *directory* ? I am asking this because our daily cross-platform builds are really huge (e.g. 4GB per build). So the ...

Startup time in Solaris server using shell script

How to find the start up time of a Solaris 5.1 server using a shell script,need to know how much time it took to be on running state?I need to know how much time it took to come to running mode from ...

Ruby 1.8.6 BigDecimal.to_f always returns 0,0 on Solaris

I have come across a very weird error. I m on Solaris 10, using Ruby Enterprise Edition (ruby 1.8.6 (2008-08-08 patchlevel 286) [i386-solaris2.10]) with Rails 2.3.4. I have a very weird error. In irb: ...

Where to set JDK to be used for SunOne server?

Where to set the JDK to be used by the SunOne server on Solaris? Is it all configured via an environment variable like JDK_HOME or JAVA_HOME, or is there a config file for the SunOne server somewhere ...

热门标签