473,396 Members | 2,037 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.

Compilation issues generating SEGMETATION FAULT

4
Hi,

I´m compiling a C++ program with g++ 2.9.5 on SunOS 5.8. I have made a project with NetBeans 5.5.1 and getting from it the make files.

The compilation and linking process ocurrs succesfully. At run time, the porgram fails whit "SEGMENTATION FAULT".

I have acces to the originals make files (gererated with Autoconf / Automake), using this file the program executes succesfully.

This seems to be a good "turn around" for the problem, but i need to include new classes to the program.

When i add the files requireds for this classes to the compilation, the program crashes again in run time...

does anybody know any compilation detail that could be the cause of this behavior???

NOTE: I have made the same test with g++ 3.4.2 (MinGW) on WinodwsXP, g++ 3.4.5 (MinGW) on Windows 2000 and g++ 4.1 on SUSE 10 with the same results...

Thanks ....
Aug 8 '07 #1
7 1525
JosAH
11,448 Expert 8TB
Hi,

I´m compiling a C++ program with g++ 2.9.5 on SunOS 5.8. I have made a project with NetBeans 5.5.1 and getting from it the make files.

The compilation and linking process ocurrs succesfully. At run time, the porgram fails whit "SEGMENTATION FAULT".

I have acces to the originals make files (gererated with Autoconf / Automake), using this file the program executes succesfully.

This seems to be a good "turn around" for the problem, but i need to include new classes to the program.

When i add the files requireds for this classes to the compilation, the program crashes again in run time...

does anybody know any compilation detail that could be the cause of this behavior???

NOTE: I have made the same test with g++ 3.4.2 (MinGW) on WinodwsXP, g++ 3.4.5 (MinGW) on Windows 2000 and g++ 4.1 on SUSE 10 with the same results...

Thanks ....
While gcc (or g++ for that matter) version 2.9.5 is a very old and bad version,
I do suspect that the fault in your own code. Not knowing what your code is all
about, I can't give you an answer. You do have to supply some details and a bit
of relevant code mayhap?

kind regards,

Jos
Aug 8 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
"SEGMENTATION FAULT".
Almost always this is memory corruption. Check every place you are using pointers or arrays and verify you are not overruning the end of the array and that the pointers contain valid addresses.
Aug 8 '07 #3
dupin
4
While gcc (or g++ for that matter) version 2.9.5 is a very old and bad version,
I do suspect that the fault in your own code. Not knowing what your code is all
about, I can't give you an answer. You do have to supply some details and a bit
of relevant code mayhap?

kind regards,

Jos
Jos,
I understand what you mean, but I´m talking about 600 000 + lines of code wiht more than three years in production enviroment with no problems.

The detail i seem is most rare is tha two compilation ways (two diferent make files) can´t produce two binarys that behaive in such a way.

Other fact is: Once i find a tregger point in the code for the problem, (ever the first static inicialization), just comenting it moves the problen to the next static initialization.

I would like to remark. This code has years in production, and the olnly difference i introduce is the make file.

Thanks..
Aug 8 '07 #4
RRick
463 Expert 256MB
Welcome to the world of porting. SW that has run for years on one system can be a bear to get it to run on another system or compiler.

Your static variable problem sounds like a difference in compilers. C++ has changed a lot over the years and you'll probably have to make changes to the source code to get it compile with newer compilers. Find out what is wrong and fix it. Commenting out the code is only delaying the problem until later (as you found out).

Your problem could also be in the makefile. Lots of times, system variables are defined in the makefile and when you change platforms or compilers the variables change and cause havoc.

One trick is to get the logs of the compilation on a machine that works. then compare these logs to the new logs that are giving you trouble. Check the compiler flags real closely between the two systems.
Aug 9 '07 #5
dupin
4
Thanks every one...

Believe it or not, i've found in your answers exactly what i looking for.
Aug 11 '07 #6
JosAH
11,448 Expert 8TB
Thanks every one...

Believe it or not, i've found in your answers exactly what i looking for.
Care to share your new knowledge?

kind regards,

Jos
Aug 11 '07 #7
dupin
4
Sorry.... I forget to share...

All that answers have perfect sense in this case, but only one of them´s can be prove. I actually was looking for some experts and unpartial opinions about this issue that help me to argument the posbility of a bug in the application.

Now, i think that i have this tool on mi hand's thanks to all of you....

I have not for certain if some action woulb be take to find and repair the bug. but i woul share with you, everihting i can about this rare case. I'm very shure that the answer y so simlple but so hide that we all laugth a lot when we know it..

Thanks again..
Aug 13 '07 #8

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

Similar topics

20
by: Shiv Kumar | last post by:
Is there a known problem or caveat with ASP.NET sessions on a multi-processor machine? Are sesions bound to a CPU or are they application wide? My machine.config is the default and my web.config...
2
by: David | last post by:
I was experimenting with generating a Word file using ASP.NET, and lauching the web app did not cause any problems. Then out of the blue, this is happening to every asp.net app that I attempt to...
3
by: Robert | last post by:
I have a number of web projects converted from 1.1 to 2.0 in VS2005. I am methodically seeing the error below: The element 'compilation' has invalid child element 'compilers'. List of...
3
by: Michael Hoehne | last post by:
Hi, I'm currently facing a problem with a mixed environment using .NET 1.1 and ..NET 2.0 web services. We have a client application (the "client", system 1) running on .NET 2.0/WinXP, calling...
0
by: Stimp | last post by:
I've created an aspx page called HistoryManage.aspx. The page works fine on my local machine but when I load it off the web I get the following strange error... Compilation Error...
11
by: John Williams | last post by:
I've written a simple program to do XOR encryption as my first foray into understanding how encryption works. The code compiles fine, however it segmentation faults on every run. using gdb to...
35
by: mwelsh1118 | last post by:
Why doesn't C# allow incremental compilation like Java? Specifically, in Java I can compile single .java files in isolation. The resulting individual .class files can be grouped into .jar files....
9
by: Raxit | last post by:
Hi, we are designing some stuff , that will generate c++ program(s) What we want is we wanted to execute that generated code.... i.e. 1. Xml based language 2. C++ code generated from 1....
82
by: raashid bhatt | last post by:
is there any standards that tell us how c code has to be compiled into machine code
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...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.