Re: stack corruption?

Louis LeBlanc
2005-06-14T20:52:30Z

On 06/14/05 01:35 PM, Jason Molenda sat at the `puter and typed:
>
> On Jun 13, 2005, at 8:32 PM, Louis LeBlanc wrote:
>
> > Stack corruption shows up anytime I open the program in gdb. I get an
> > occasional core dump (SEGV and BUS) from my program, but when I can
> > make heads or tails of it, it appears to be deep in a host lookup
> > (system libs, Solaris 9) or Oracle 8.1.7 database calls (which could
> > also be a host lookup).
>
>
> Louis, I think you're going to need to be a lot more specific.
> You're using gdb on Solaris 9 with a SPARC CPU? What version of
> gdb? Your paragraph above sounds like there's a bug in your program
> causing it to crash, and you cannot understand the stack backtrace --
> are you asking for help in using gdb to find your bug, or are you
> saying that gdb is not behaving properly?
>
> If it's the latter, some example output of the problem would do
> wonders to clear things up.

Sorry for being too general. I am on a SPARC, running Solaris 8 and 9
on different machines. Whether there's a bug in my code, well, I'm
sure there are minor bugs, but I'm not convinced yet that there's a
serious one. This process runs at high network volumes for days and
weeks at a time without problem, then suddenly it dumps. When I try
to examine the core, I get stack corruption messages.

Basically, I'm not entirely sure. The codebase in question has never
had this problem in the past, but now (with a newer version of gdb,
and after much work on my code) I always get the corrupt stack notice
when I open the process in gdb.

The gdb version I am using is:
$ gdb -v
GNU gdb 6.3.0.20050516-cvs

I have been planning to get a later snapshot, but haven't gotten
around to it yet.

BTW, I've seen problems in several applications while performing
network lookups, not just my code, and not just C programs. I got a
couple created by Perl scripts a couple weeks ago and they were also
in the middle of network lookups. This makes me skeptical of the
system libs, not my code and not gcc. The real problem is that gdb
tells me nothing useful in these cases, unless the corrupt stack
message is a real issue with my code.

BTW, I have always used the standard pstack utility on all cores I've
had to examine on Solaris - they don't always match up directly with
the gdb backtrace, but they're usually close. Thread numbers and LWP
ids are sometimes way off too.

Lou
--
Louis LeBlanc dev@keyslapper.net
Fully Funded Hobbyist, KeySlapper Extrordinaire :þ
http://www.keyslapper.net Ô¿Ô¬
Key fingerprint = C5E7 4762 F071 CE3B ED51 4FB8 AF85 A2FE 80C8 D9A2

Facts are stubborn, but statistics are more pliable.