🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3371

Re: program crashes

#3371
From: Rishad Omar
Date: Thu, 15 Nov 2001 08:16
68 lines
4131 bytes
I agree with the previous writer that you have probably corrupted your
heap. This can also be caused as a side effect of corrupting your stack
and then any pointers on it. (I've found that corrupting the stack is a
more common problem.)
One way of finding the region of code which is responsible for your
problem is to comment 'chunks' of code until your code works and then
uncommenting smaller chunks until you home into the problem area.
Start with newly written source and hopefully you will find your
problem.
Good luck.
Rishad

Fletcher Glenn wrote:
> 
> cal wrote:
> >
> > Hi there,
> >     My program crashes with a core. and I check it with debugger. I got the
> > following.
> >
> > Copyright 1998 Free Software Foundation, Inc.
> > GDB is free software, covered by the GNU General Public License, and you are
> > welcome to change it and/or distribute copies of it under certain
> > conditions.
> > Type "show copying" to see the conditions.
> > There is absolutely no warranty for GDB. Type "show warranty" for details.
> > This GDB was configured as "sparc-sun-solaris2.7"...
> > Core was generated by `cybAgent'.
> > Program terminated with signal 9, Killed.
> > Reading symbols from /usr/lib/libsocket.so.1...done.
> > Reading symbols from /usr/lib/libnsl.so.1...done.
> > Reading symbols from /usr/lib/libpthread.so.1...done.
> > Reading symbols from
> > /export/home/ccheung/agent/v3/dev/bin/./libstdc++.so.3... done.
> > Reading symbols from /usr/lib/libm.so.1...done.
> > Reading symbols from
> > /export/home/ccheung/agent/v3/dev/bin/./libgcc_s.so.1... done.
> > Reading symbols from /usr/lib/libc.so.1...done.
> > Reading symbols from /usr/lib/libdl.so.1...done.
> > Reading symbols from /usr/lib/libmp.so.2...done.
> > Reading symbols from /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1...done.
> > Reading symbols from /usr/lib/libthread.so.1...done.
> > Reading symbols from /usr/lib/nss_files.so.1...done.
> > #0 0xff1456c8 in _smalloc () from /usr/lib/libc.so.1
> > (gdb) bt
> > #0 0xff1456c8 in _smalloc () from /usr/lib/libc.so.1
> > Segmentation Fault(coredump)
> >
> > Anyone know what is smalloc? I'm using g++ 301 compiler. thx
> 
> smalloc is probably a sub-function of malloc().  You have
> probably corrupted your heap.  This sort of problem is
> notoriously difficult to troubleshoot as the crash is
> usually nowhere near the event that causes the
> corruption.  You need to use a heap checker like
> Rational's Purify, or Electric Fence.
> 
> --
>                 Fletcher Glenn
>                 email f-g-l-e-n-n@quest.com (remove the dashes)

-- 
--------------------------------------------------
Rishad Omar                     Philips Research
Building: WAY			Prof. Holstlaan 4
Phone: +31 (0)40 27 45195       5656 AA  Eindhoven
Fax:   +31 (0)84 22 09385       The Netherlands
mailto:omar@natlab.research.philips.com
Technical Details
Message-ID: <3BF379F2.9AFBC7CF@natlab.research.philips.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!bnewspeer01.bru.ops.eu.uu.net!bnewsifeed01.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!read-nat.news.nl.uu.net!not-for-mail
References: <HQvI7.58567$Z2.869852@nnrp1.uunet.ca> <3BF29E69.E20C3958@quest.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,424856d1b364992b
X-Google-Attributes: gid11318c,public
X-Google-Thread: fc89c,424856d1b364992b
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 10ba33,424856d1b364992b
X-Google-Attributes: gid10ba33,public
X-Google-ArrivalTime: 2001-11-15 00:17:53 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!bnewspeer01.bru.ops.eu.uu.net!bnewsifeed01.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!read-nat.news.nl.uu.net!not-for-mail
Message-ID: <3BF379F2.9AFBC7CF@natlab.research.philips.com>
Date: Thu, 15 Nov 2001 09:16:50 +0100
From: Rishad Omar <omar@natlab.research.philips.com>
Organization: Philips Research
X-Mailer: Mozilla 4.06 [en] (WinNT; I)
MIME-Version: 1.0
Newsgroups: comp.unix.programmer,gnu.g++.help,gnu.gcc.help
Subject: Re: program crashes
References: <HQvI7.58567$Z2.869852@nnrp1.uunet.ca> <3BF29E69.E20C3958@quest.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 68
NNTP-Posting-Host: gw-ehv05.pnl.philips.com
X-Trace: 1005812223 read-nat.news.nl.uu.net 224 212.153.190.4
X-Complaints-To: abuse@nl.uu.net