home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / sun / admin / 10608 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.6 KB

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