home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!emory!ogicse!das-news.harvard.edu!husc-news.harvard.edu!husc8.harvard.edu!mlevin
- From: mlevin@husc8.harvard.edu (Michael Levin)
- Newsgroups: comp.sys.sgi
- Subject: why is malloc() core dumping me?
- Message-ID: <1992Dec18.132718.18673@husc3.harvard.edu>
- Date: 18 Dec 92 18:27:17 GMT
- Article-I.D.: husc3.1992Dec18.132718.18673
- Distribution: usa
- Organization: Harvard University Science Center
- Lines: 16
- Nntp-Posting-Host: husc8.harvard.edu
-
-
- I have a C program on an SGI Iris, which is core-dumping
- ("segmentation fault"). I have localized this problem to a single
- statement (by means of putting "printf()"s around it - we have no
- visual debugger). The statement is:
- p = (char *) malloc(1024);
- where p is a char *.
- the same problem happens if I do malloc(1024) (no p=).
- The weird thing is that I am not even de-referencing the
- pointer - it is core-dumping within the malloc itself.
- Why might this be happenning? I have never heard of such a thing on
- any other system. If something is wrong (no more mem, etc.) shouldn't
- it just return NULL?
- Please reply to mlevin@husc8.harvard.edu.
-
- Mike Levin
-