473,399 Members | 2,478 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,399 software developers and data experts.

executable and GDB

Hai,
I'm trying compile a project. Every thing is perfectly compiled and
linked NO errors what so ever.
but then if i run the executable it crashes with segmentation
fault(i'm using Linux) but here's a twist to the problem when i try to
debug the program using gdb, the program never crashes, it runs to
completion with out any problem at all...
I've never come across any thing like this, and cannot figure out
wht's wrong...
please help..

thanx in advance....

--
my project page: www.parl.clemson.edu/esd
Nov 14 '05 #1
5 1571
Krishna Sagiraju wrote:
Hai,
I'm trying compile a project. Every thing is perfectly compiled and
linked NO errors what so ever.
but then if i run the executable it crashes with segmentation fault(i'm
using Linux) but here's a twist to the problem when i try to debug the
program using gdb, the program never crashes, it runs to completion with
out any problem at all...
I've never come across any thing like this, and cannot figure out wht's
wrong...
please help..

get a core dump(ulimit -c unlimited), and debug the core
gdb --core=/path/to/core /path/to/program
Issue the bt command to get a backtrace, should help you along.

For the future,comp.unix.programmer or comp.os.linux.development.apps is
more suitable for such questions.
Nov 14 '05 #2
Krishna Sagiraju <sa******@gmail.com> wrote:
I'm trying compile a project. Every thing is perfectly compiled and
linked NO errors what so ever.
but then if i run the executable it crashes with segmentation
fault(i'm using Linux) but here's a twist to the problem when i try to
debug the program using gdb, the program never crashes, it runs to
completion with out any problem at all...
I've never come across any thing like this,


<http://www.catb.org/~esr/jargon/html/H/heisenbug.html>

You've probably failed to initialised a variable (probably a pointer).
My guess is that the debugger automatically initialised it to null, and
ignores null pointer dereferences - not very helpful, as you've
experienced.
The solution, of course, is to assign a proper value to each pointer
before you dereference it.

Richard
Nov 14 '05 #3
Groovy hepcat Krishna Sagiraju was jivin' on Tue, 19 Oct 2004 01:00:25
-0400 in comp.lang.c.
executable and GDB's a cool scene! Dig it!
I'm trying compile a project. Every thing is perfectly compiled and
linked NO errors what so ever.
but then if i run the executable it crashes with segmentation
fault(i'm using Linux) but here's a twist to the problem when i try to
debug the program using gdb, the program never crashes, it runs to
completion with out any problem at all...


SHOW US THE CODE!!!

How can anyone help you debug your code when we can't see it? If it
is too long to post, then cut it down to the smallest *complete*
program (meaning something that can be expected to compile and run)
that shows the problem. You may even find the problem while cutting it
down. Also tell us briefly what it is supposed to do and how it is
supposed to do it, as well as exactly what actually happens.
Until you do this, all we can do is guess.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
Nov 14 '05 #4
Peter Shaggy Haywood wrote:
Groovy hepcat Krishna Sagiraju was jivin'
I'm trying compile a project. Every thing is perfectly compiled
and linked NO errors what so ever. but then if i run the
executable it crashes with segmentation fault (i'm using Linux)
but here's a twist to the problem when i try to debug the program
using gdb, the program never crashes, it runs to completion with
out any problem at all...


SHOW US THE CODE!!!


What kind of expert are you if you can't point specifically to the
faulty statement with that clear exposition?

There is a one-off error in line 232. What's the problem?

--
"I support the Red Sox and any team that beats the Yankees"
"Any baby snookums can be a Yankee fan, it takes real moral
fiber to be a Red Sox fan" - "I listened to Toronto come back
from 3:0 in '42, I watched Boston come back from 3:0 in '04"
Nov 14 '05 #5
Groovy hepcat CBFalconer was jivin' on Thu, 21 Oct 2004 07:22:23 GMT
in comp.lang.c.
Re: executable and GDB's a cool scene! Dig it!
Peter Shaggy Haywood wrote:
Groovy hepcat Krishna Sagiraju was jivin'
I'm trying compile a project. Every thing is perfectly compiled
and linked NO errors what so ever. but then if i run the
executable it crashes with segmentation fault (i'm using Linux)
but here's a twist to the problem when i try to debug the program
using gdb, the program never crashes, it runs to completion with
out any problem at all...


SHOW US THE CODE!!!


What kind of expert are you if you can't point specifically to the
faulty statement with that clear exposition?

There is a one-off error in line 232. What's the problem?


Um..., okay.
Seriously, though, am i the only regular here who gets tired of
telling newbies to post their code? Anyone with any sense at all would
show the people they're asking for help the thing they need that help
to fix. That makes sense to me; but apparently not to the multitudes
of new posters who come and go here day after day.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
Nov 14 '05 #6

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

Similar topics

1
by: Jay Haslup | last post by:
I am trying to figure out how to get the CMD (dos) window to come up when I call a executable. I have this working on a Win2000/apache machine and am trying to use the same code on a identical...
17
by: Filipe Martins | last post by:
Hello. I've read somewhere that the executable is smaller if we use a source file for each function! So, I tested this with gcc and it seams to confirm! What seams to happen is that if we call...
7
by: Johnny | last post by:
How do I create a link on a Web page on my hard drive that will run an executable file on my hard drive? For example, let's say I create runpoodle.htm and save it to my hard drive, and let's...
8
by: suresh_C# | last post by:
Dear All, What is difference between Portable Executable (PE) file and a Assembly? Thanks, Mahesh
34
by: priyanka | last post by:
Hi, I was wondering if we could parse or do something in the executable( whose source language was C). How can I use some scripting language like perl/python to find out the information about...
28
by: Tim Daneliuk | last post by:
I have a program wherein I want one behavior when a file is set as executable and a different behavior if it is not. Is there a simple way to determine whether a given named file is executable...
3
by: Jeffrey Froman | last post by:
Hello All, I have two python versions installed, one in /usr/bin, and one in /usr/local/bin. However, when invoking python without a full path, I get the wrong executable with the right...
2
by: NasirMunir | last post by:
I am trying to run an executable using shell. The executable look for certain files in the same directory and then run on those files. My problem: I have created a form which asks from the user to...
3
by: Mo | last post by:
Hi, Is there a way to include an executable (xxx.exe) file inside a c# console project so that the resulting project binary have only one final executable file? My c# console application is...
16
by: Erwin Moller | last post by:
Why is a binary file executable? Is any binary file executable? Is only binary file executable? Are all executable files binary? What is the connection between the attribute of binary and that of...
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?
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
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
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,...

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.