home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.admin:10608 comp.sys.sun.apps:3043 comp.sys.sun.misc:6412
- Newsgroups: comp.sys.sun.admin,comp.sys.sun.apps,comp.sys.sun.misc
- Path: sparky!uunet!gatech!asuvax!ennews!ennews.eas.asu.edu!mann
- From: mann@emma.la.asu.edu (Mark Mann)
- Subject: Re: SEGV inside malloc() - This shouldn't happen!
- In-Reply-To: mike@sdd.comsat.com's message of 21 Jan 93 17:20:08 GMT
- Message-ID: <MANN.93Jan21131125@emma.la.asu.edu>
- Sender: news@ennews.eas.asu.edu (USENET News System)
- Organization: Mars Observer TES Project, ASU, Tempe AZ
- References: <mike.727636808@sdd.comsat.com>
- Distribution: na
- Date: Thu, 21 Jan 1993 20:11:25 GMT
- Lines: 20
-
- In article <mike.727636808@sdd.comsat.com> mike@sdd.comsat.com (Mike Stennett) writes:
- > I am currently porting a program to a SparcStation 2 running SUN/OS 4.1.2.
- > The program is written in C, Pascal, and Fortran. I am using all SUN
- > compilers. My problem is I am getting segmentation faults within malloc.
- > Now I have been writing C programs for 4 years and know that malloc should
- > never cause a segmentation faults.
- > [...]
-
- I have found that malloc() will fail with a segmentation fault when you
- trash its tables. This usually happens when you write beyond the end
- of an array. You haven't written out far enough to cause a segmentation
- violation yourself, but just far enough to make garbage out of malloc()'s
- tables. So... next time you call malloc() and it tries to access the
- garbage you created... SEGV or somesuch.
-
- Hope this helps some.
-
- --
- Mark Mann Mars Observer Thermal Emission Spectrometer Project
- (602) 965-0106 Mark.Mann@tes.la.asu.edu
-