home *** CD-ROM | disk | FTP | other *** search
- From: chan@hpfcmgw.FC.HP.COM (Chan Benson)
- Date: Tue, 18 Aug 1992 21:47:19 GMT
- Subject: Re: Re: Debuging Segmentation Violation Fault
- Message-ID: <9770001@hpfcmgw.FC.HP.COM>
- Organization: HP Fort Collins, CO
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!hpscdc!hplextra!hpfcso!hpfcmgw!chan
- Newsgroups: comp.unix.aix
- References: <1992Aug14.121619.26071@watson.ibm.com>
- Lines: 29
-
- > |> I have this HUGE C program (20,000 lines). Everything worked fine
- > |> until the other day I added a few (about 10) lines to it. Then all of a sudden,
- > |> it keeps giving me this "segmentation violation". I ran "dbx" to see if I can
- > |> get some clue, it gave me something like:
- > |>
- > |> segmentation violation in malloc_y at 0xd00d43f0
- > |> 0xd00d43f0 (malloc_y+0x2a8) 7c7c45aa stsi r3,r28,0x8
- > |>
- > |> From these two lines, all I can guess is that the fault is related to
- > |> "malloc". But "malloc" is used more than dozens of times throughout the
- > |> program, how am I supposed to know "who steps on whose toe and where".
- > |>
- > |> I am desperate. Could someone tell me what other things I should do
- > |> beyond these two lines? Or maybe what books or manuals should I read to get
- > |> more information? What do those address-like (?) numbers all mean?
- > ...
- >
- > Usually malloc fails when it can't honor your request for storage.
- > i.e. you've requested a huge amount of memory (or even worse, a
- > negative amount--which I believe translates into a huge amount as
- > well!).
-
- Nice try, but if malloc is giving a segmentation violation that usually
- means that the program wrote beyond the boundary of a previously malloc'ed
- area (thus trashing malloc's allocation info). These bugs are difficult
- to find without a debug version of the malloc library.
-
- -- Chan Benson
- HP Fort Collins
-