473,387 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Segmentation fault need help

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)
Nov 14 '05 #1
4 2098
"Marcia Hon" <ho**@rogers.com> 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
mr*@kth.se
Nov 14 '05 #2
mr*@kth.se (Måns Rullgård) writes:
"Marcia Hon" <ho**@rogers.com> 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.
Nov 14 '05 #3
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 (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 14 '05 #4
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
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Anks | last post by:
i am unable to find why following code is giving segmentation fault.... way to produce seg fault: run the program... give input 12345678....enter any key except 'x'.... again give 12345678 as...
16
by: laberth | last post by:
I've got a segmentation fault on a calloc and I don'tunderstand why? Here is what I use : typedef struct noeud { int val; struct noeud *fgauche; struct noeud *fdroit; } *arbre; //for those...
3
by: Zheng Da | last post by:
Program received signal SIGSEGV, Segmentation fault. 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 (gdb) bt #0 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 #1 0x40094c54 in malloc...
5
by: Fra-it | last post by:
Hi everybody, I'm trying to make the following code running properly, but I can't get rid of the "SEGMENTATION FAULT" error message when executing. Reading some messages posted earlier, I...
27
by: Paminu | last post by:
I have a wierd problem. In my main function I print "test" as the first thing. But if I run the call to node_alloc AFTER the printf call I get a segmentation fault and test is not printed! ...
5
by: silverburgh.meryl | last post by:
Hi, I have a segmentation fault in line 66 of GroupResult.h and I can't figure out why that causes any problem, I appreciate if anyone can help. line 66 of Result.h: 66 size_t size()...
7
by: pycraze | last post by:
I would like to ask a question. How do one handle the exception due to Segmentation fault due to Python ? Our bit operations and arithmetic manipulations are written in C and to some of our...
3
by: madunix | last post by:
My Server is suffering bad lag (High Utlization) I am running on that server Oracle10g with apache_1.3.35/ php-4.4.2 Web visitors retrieve data from the web by php calls through oci cobnnection...
8
by: Bryan | last post by:
Hello all. I'm fairly new to c++. I've written several programs using std::vectors, and they've always worked just fine. Until today. The following is a snippet of my code (sorry, can't...
3
by: Anna | last post by:
Could you please help me? I got a segmentation fault message while trying to assign a pointer = pointer like this: bufferlist=(buffer_t*)buffernew; What's the error by doing this? Here is the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.