Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > regarding core dump

Reply
Thread Tools

regarding core dump

 
 
news.fe.internet.bosch.com
Guest
Posts: n/a
 
      02-06-2006
Hi,

I have c++ application which dumps core only static mode and not in
debug mode , I used gdb debugger to know which function is reason for
core dump , is there other ways to find it out.

Mohan


 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      02-06-2006
news.fe.internet.bosch.com wrote:
> I have c++ application which dumps core only static mode and not in
> debug mode , I used gdb debugger to know which function is reason for
> core dump , is there other ways to find it out.


If debugging doesn't help (which is possible), I use the tried-and-true
bisection method: introduce output statements clearly before (a) and after
(b) the place where it might be failing, then place yet another point in
the middle (c) and see which ones you actually get. If it's only (a),
move the (c) up, if it's both (a) and (c), move (c) down. Yes, I know,
seems like neither (b) nor (a) are actually necessary, but I say, put them
in anyway, perhaps when you feel like it you might want to tighten the
range by moving (a) down and/or (b) up.

Yes, having output in your program does change its behaviour and will, no
doubt, affect the result of the program execution to the point when the
failure may actually never show up. Well, you'll have to deal with that
then, I guess.

Victor
--
Please remove capital As from my address when replying by mail
 
Reply With Quote
 
 
 
 
Daniel T.
Guest
Posts: n/a
 
      02-06-2006
In article <ds7csc$ln7$(E-Mail Removed)>,
"news.fe.internet.bosch.com" <(E-Mail Removed)> wrote:

> Hi,
>
> I have c++ application which dumps core only static mode and not in
> debug mode , I used gdb debugger to know which function is reason for
> core dump , is there other ways to find it out.


Chances are, you are overwriting memory somewhere in your code. Knowing
in which function the core dump occurs will in no way let you know what
code has the error. You need to go through your code (by hand) and find
the spot where you went past the bounds of an array, or assigned to an
invalid pointer.

Sorry for the bad news...

--
Magic depends on tradition and belief. It does not welcome observation,
nor does it profit by experiment. On the other hand, science is based
on experience; it is open to correction by observation and experiment.
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      02-06-2006
news.fe.internet.bosch.com wrote:

> Hi,
>
> I have c++ application which dumps core only static mode and not in
> debug mode , I used gdb debugger to know which function is reason for
> core dump , is there other ways to find it out.



A common cause for debug/release disparity has to do with
initialization of automatic variables. Many implementations will
default initialize to 0 (or equivalent) in debug but leave the vars
uninitialized in release mode. A good first step is to go through and
make sure all variables are initialized one way or another.

Otherwise, I'd proceed as Victor suggested.



Brian

--
Please quote enough of the previous message for context. To do so from
Google, click "show options" and use the Reply shown in the expanded
header.
 
Reply With Quote
 
=?iso-8859-1?q?Stephan_Br=F6nnimann?=
Guest
Posts: n/a
 
      02-06-2006
news.fe.internet.bosch.com wrote:
> Hi,
>
> I have c++ application which dumps core only static mode and not in
> debug mode , I used gdb debugger to know which function is reason for
> core dump , is there other ways to find it out.
>
> Mohan


After having the other suggestions that have been posted I got the
following idea:
print the addresses of all variables in the "faulty" function and
compare against the values when debugging: check for unreasonable
differences.

Regards, Stephan

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dump complete java VM state as core dump (not via OS) possible? halfdog Java 12 02-21-2013 06:14 AM
Core Solo & Core Duo are not Core microarchitecture; 65nm Pentium M chips bigal Hardware 0 03-22-2006 11:24 AM
Cisco AP1200 core dump B Thompson Cisco 7 11-26-2005 03:59 AM
Read Core Dump file ns Cisco 8 05-26-2005 03:07 AM
Regarding core dump invincible C Programming 1 04-05-2005 07:20 AM



Advertisments