home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / sgi / 18198 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.1 KB

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