home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!lll-winken!snll-arpagw!hilary
- From: hilary@snll-arpagw.llnl.gov (Hilary Jones)
- Newsgroups: comp.sys.mips
- Subject: Problem with malloc?
- Summary: It gives a segment violation sometimes.
- Message-ID: <297@snll-arpagw.llnl.gov>
- Date: 13 Aug 92 23:38:40 GMT
- Distribution: all
- Organization: Sandia National Labs, Livermore, CA
- Lines: 15
-
- I have a problem with malloc(). The code I am running makes many calls
- to malloc for small amounts of memory at a time. [Actually the program
- is calling calloc, but I think I have isolated the problem to malloc().]
- By "many calls" I means perhaps 20 or 100. The amounts of memory range
- from 4 bytes to several hundred. There is never much memory allocated
- at any one time before it all gets returned. Every now and then, the
- program aborts with a segment violation. The problem is not repeatable;
- if I rerun the program from scratch, the problem might not occur, or it
- might occur at a different call to malloc.
-
- Has anybody seen this problem? Is there a fix? I am running RISC/os 4.51
- on an RS2030. For what it's worth, my disk isn't very reliable -- but I
- have never seen a diagnostic when this problem occurs.
-
- Hilary
-