home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / aix / 8809 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.7 KB  |  42 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!mcs.kent.edu!Chaos.mcs.kent.edu!jhuang
  3. From: jhuang@Chaos.mcs.kent.edu (Jing Huang)
  4. Subject: Debuging Segmentation Violation Fault
  5. Message-ID: <1992Aug14.040021.25316@mcs.kent.edu>
  6. Keywords: Segmentation Violation
  7. Sender: news@mcs.kent.edu (News Administrator)
  8. Nntp-Posting-Host: chaos.mcs.kent.edu
  9. Organization: Kent State University
  10. Date: Fri, 14 Aug 1992 04:00:21 GMT
  11. Lines: 29
  12.  
  13.     Dear netters, I have always wanted to ask this question. To me, the
  14. most horrifying error a program can have is "segmentation violation". I never
  15. have any clear idea about how to debug this kind of fault. Can someone give
  16. me some advice from his own experience on how to solve this fault?
  17.  
  18.     I have this HUGE C program (20,000 lines). Everything worked fine
  19. until the other day I added a few (about 10) lines to it. Then all of a sudden,
  20. it keeps giving me this "segmentation violation". I ran "dbx" to see if I can
  21. get some clue, it gave me something like:
  22.  
  23. segmentation violation in malloc_y at 0xd00d43f0
  24. 0xd00d43f0 (malloc_y+0x2a8) 7c7c45aa       stsi   r3,r28,0x8
  25.  
  26.     From these two lines, all I can guess is that the fault is related to
  27. "malloc". But "malloc" is used more than dozens of times throughout the 
  28. program, how am I supposed to know "who steps on whose toe and where".
  29.  
  30.     I am desperate. Could someone tell me what other things I should do
  31. beyond these two lines? Or maybe what books or manuals should I read to get
  32. more information? What do those address-like (?) numbers all mean?
  33.  
  34.     Many thanks in advance.
  35.  
  36. --
  37. Jing Huang  |  jhuang@Chaos.mcs.kent.edu
  38. Department of Physics
  39. Kent State University
  40. Kent, OH 44242
  41.  
  42.