This content has been marked as final. Show 2 replies
Without seeing any code, it's difficult to tell.
Also, can you try a newer compiler (Studio 12)? If so, does the problem persist?
You are using a really old compiler, now End of Life, at an old patch level.
This old compiler version can run into problems with the std::string class in multi-threaded programs. You can possibly fix the problems as follows:
1. Get ALL of the latest patches for WS6U2 here
including the Solaris patches for the C++ runtime libraries.
2. Make sure the WS6U2 installation has been adjusted to link libCstd.so.1 dynamically, instead of the default static linking. The instructions are in the C++ User Guide for WS6U2.
3. Clear out all template caches (delete all SunWS_cache directories) and recompile ALL of your code.
If that solves the problem, you will need to update the C++ runtime libraries on all computers that run the program (not just the computer where the program is built).
But it would be better to update to the current release, Sun Studio 12, which is free. Studio 12 requires Solaris 9 or 10. If you are on Solaris 8, get Studio 11, which is also free..
Of course, it is likely that the problem is in your program, and not in the C++ compiler or libraries. A crash in the string class might be due to a problem with a string, but it also might be due to general memory corruption. You often find the program fault at a place far removed in space and time from the actual error.
Source of corruption in a single-threaded program include
- reading or writing beyond the bounds of an object
- using an object after it has been deleted or gone out of scope
- deleting an object more than once
- using an uninitialized variable
In a multi-threaded program, you can also get memory corruption when an object shared among threads is not properly guarded.
The effects of these errors can appear random, making them hard to find, and even harder to find in a multi-threaded program.
With any version of WorkShop or Sun Studio, you can find many of these problems by running under the debugger with all checks turned on:
% dbx myprog
(dbx) check -all
Sun Studio 12 includes a Thread Analyzer that can find data races in multi-threaded programs.