Networking Forums

Networking Forums > Computer Networking > Linux Networking > Segmentation fault need help

Reply
Thread Tools Display Modes

Segmentation fault need help

 
 
Marcia Hon
Guest
Posts: n/a

 
      02-15-2004, 05:40 PM
Hi,

I am trying to run a program except I get the following segmentation fault.
I don't know how to solve it. Please if you know could you please help.

Thanks, Marcia



Program received signal SIGSEGV, Segmentation fault.

0x0a6e6962 in ?? ()

(gdb) bt

#0 0x0a6e6962 in ?? ()

Cannot access memory at address 0xa6d6461

(gdb)


 
Reply With Quote
 
 
 
 
=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=
Guest
Posts: n/a

 
      02-15-2004, 10:38 PM
"Marcia Hon" <(E-Mail Removed)> writes:

> Hi,
>
> I am trying to run a program except I get the following segmentation fault.
> I don't know how to solve it. Please if you know could you please help.
>
> Thanks, Marcia
>
> Program received signal SIGSEGV, Segmentation fault.
>
> 0x0a6e6962 in ?? ()
>
> (gdb) bt
>
> #0 0x0a6e6962 in ?? ()
>
> Cannot access memory at address 0xa6d6461


You have a corrupted stack. Look for buffer overflows in
automatically allocated memory. Another typical cause is freeing
automatic memory. It could also be caused by using an uninitialized
pointer. A memory debugger like Electric Fence or (for PC) valgrind
is useful for finding such bugs.

--
Måns Rullgård
(E-Mail Removed)
 
Reply With Quote
 
Marcia Hon
Guest
Posts: n/a

 
      02-15-2004, 10:46 PM
Thanks.

I don't know how to solve it your way. I would like to learn. I, however,
solved it by sequentially putting printfs throughout the program!

Thanks again for your help.
Marcia


 
Reply With Quote
 
Paul Pluzhnikov
Guest
Posts: n/a

 
      02-16-2004, 01:20 AM
(E-Mail Removed) (Måns Rullgård) writes:

> "Marcia Hon" <(E-Mail Removed)> writes:


> > (gdb) bt
> > #0 0x0a6e6962 in ?? ()


Note that this is ASCII: "\nnib", doing "x/s $esp" may reveal the
rest of the string which overflowed its buffer.

> You have a corrupted stack.


Most definitely.

> Look for buffer overflows in automatically allocated memory.


Yes. I would bet 10:1 that this is a simple strcpy() into an
automatic char array that is too small.

> Another typical cause is freeing automatic memory.


That would cause a SIGSEGV *in* malloc/free, not a jump to ASCII.

> It could also be caused by using an uninitialized pointer.


Or it could be that.

> A memory debugger like Electric Fence or (for PC) valgrind
> is useful for finding such bugs.


EFence will not help with this kind of bug at all, valgrind might
(if this is an uninitialized pointer, but not otherwize).

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a

 
      02-16-2004, 07:13 PM
Marcia Hon wrote:
>
> I am trying to run a program except I get the following segmentation fault.
> I don't know how to solve it. Please if you know could you please help.


You are getting out of hand. Please STOP the excessive
cross-posting, and STOP posting OT matter, and START posting
cut-down compilable complete programs not exceeding 100 lines when
you need help. Failing this I suggest wholesale PLONKING, after
which you will not be able to get help anywhere.

For you, anything over one newsgroup is excessive crossposting.

--
Chuck F ((E-Mail Removed)) ((E-Mail Removed))
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
telnet: "segmentation fault" everytimes antiw Linux Networking 9 10-14-2006 09:22 PM
segmentation fault in tcptraceroute Alex Bransky Linux Networking 2 10-13-2004 04:03 PM
Shell command gets Segmentation Fault Hagit Linux Networking 2 01-02-2004 01:13 PM
Apache2 segmentation fault when using SSLVerifyClient Stephan B. Linux Networking 1 12-15-2003 11:38 AM
segmentation fault Steven Luk Linux Networking 3 12-10-2003 02:55 AM



1 2 3 4 5 6 7 8 9 10 11