Segmentation fault need help

M

Marcia Hon

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)
 
?

=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=

Marcia Hon said:
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

Marcia Hon

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
 
P

Paul Pluzhnikov

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,
 
C

CBFalconer

Marcia said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top