473,396 Members | 1,666 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,396 software developers and data experts.

Segmantation fault

I have a function that runs, but gets a segmentation fault if I make very minor changes. For example adding a print statment somwhere into the function works, adding the same print statment twice at the same position leads to a segmentation fault when the code is executed. Does anyone know what this could be ? Are segmentation fault errors always memory allocation errors ?

Thanks
Oct 19 '06 #1
4 1996
arne
315 Expert 100+
I have a function that runs, but gets a segmentation fault if I make very minor changes. For example adding a print statment somwhere into the function works, adding the same print statment twice at the same position leads to a segmentation fault when the code is executed. Does anyone know what this could be ? Are segmentation fault errors always memory allocation errors ?

Thanks
A segmentation fault typically occurs if a program tried to access a memory location it should not access. In many cases this is due to improper pointer usage. You may post your code (as far simplified as possible) so that others can try to reproduce and analyze the problem?
Oct 19 '06 #2
Thanks, posting the code is difficult, it has about 1000 pages.I just wanted to double check if segmentation faults can occur due to different probelms than memory access. Do you know of other cases ?


A segmentation fault typically occurs if a program tried to access a memory location it should not access. In many cases this is due to improper pointer usage. You may post your code (as far simplified as possible) so that others can try to reproduce and analyze the problem?
Oct 19 '06 #3
arne
315 Expert 100+
Thanks, posting the code is difficult, it has about 1000 pages.I just wanted to double check if segmentation faults can occur due to different probelms than memory access. Do you know of other cases ?
I see. No, better do not post your code then ;-).
You may refer to
http://c-faq.com/strangeprob/segv.html
for causes of segmentation violations.
Oct 19 '06 #4
Cool, I'll have a look. Thanks

I see. No, better do not post your code then ;-).
You may refer to
http://c-faq.com/strangeprob/segv.html
for causes of segmentation violations.
Oct 19 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dave | last post by:
I have a multithrading program(daemon server) written by c++(GCC) under AIX4.X, I get segmentation fault problem when it runs several hours with heavy load. I want to know which compilation option...
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...
0
by: Matt S | last post by:
Hello, I'm trying to build a C# client to consume an AXIS Web Service (running SOAP over HTTP). The Web Service encodes full server-side exception traces in the Soap Fault > Detail element...
3
by: Moshe Kravchik | last post by:
Hi! We have a Web Service written in ATL Server and a client written in Java using Axis. When something goes wrong on the server side, it returns an HRESULT of the error which is translated into...
0
by: relaxedrob | last post by:
Hi All, I have a portType such as this: <portType name="CMLeJobSoapGetEmpBrand"> <operation name="EJobGetEmpBrand"> <input message="tns:EJobEmpBrdReq" name="EJobEmpBrdReq"/> <output...
10
by: Saurabh | last post by:
Hi all, I am working on RedHat Linux GCC 3.0. I am trying to convert a long to string through sprintf. but i m getting segmantation fault. I tried snprintf also but no avail.here is the piece...
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...
3
by: =?Utf-8?B?TWFucHJlZXQgU3VzaGls?= | last post by:
I am having a Webservice within which i am throwing SOAP Exceptions and therefore whenever something wrong happens a SOAP fault comes up in the response - see below: <?xml version="1.0"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.