I'm getting the following coredump due to SIGBUS.
But the stack trace shows the problem is in down_cast.
Following are the pflags and stack traces for your references.
There's a good chance that the code causing the problem isn't anywhere near the code that crashes. SIGBUS on Solaris/SPARC indicates and unaligned memory access. This typically happens because a pointer is corrupted or the stack is corrupted, though there are many other things that can cause this as well.
My recommendation is to compile with "g++ -Wall" (using GCC 4.3) and fix all of the warnings emitted -- problems that Sun Studio cannot detect. There is a reasonable chance that GCC will at least warn you of the problem (certainly much more likely than Sun Studio warning you).
I wasn't suggesting changing compilers. Well, I *do* recommend changing compilers -- Sun Studio is a poor C++ compiler -- but that wasn't the gist of my earlier suggestion. :-)
I was just suggesting compiling the code with g++ and cleaning up any warnings. All of our released Solaris code is built using Sun Studio, but we typically compile everything at least once with "g++ -Wall" to make sure the code is clean. This has made our code quite a bit more robust.
Back to your code. Is there any chance that m_msg is != 0, but does not point to a Session object?
If your check doesn't stop the problem, you could try catching std::bad_cast and exploring what m_msg contains.
In code, chances of m_msg being corrupted are more(I guess).
Tried std::bad_cast also , didn't catch any exceptions.
Could be crashing somewhere else and pointing to "ffffffff6fd08bf4 __1cG__CrunJdown_cast6Fpvpkn0AQstatic_type_info_4_ 1_ (24d8c4f80, ffffffff73d33028, " this line.
Are there anyways to analyze core file so that we can find out the exact crash point or corrupted pointers???
Right -- well my suggestion to try catching std::bad_cast was silly. You are getting a SIGBUS. It's not going to help. It will be tough to give any more suggestions without knowing the code in detail. If you can cause the crash with a debug build then you may be able to navigate through the core & source with Sun Studio's debugging tools.