Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > program that ain't crash inside debugger

Reply
Thread Tools

program that ain't crash inside debugger

 
 
console kid
Guest
Posts: n/a
 
      03-31-2011
Hi all, I'm using GNU G++ for my development.
I have write a simple test case.The program runs and exited normally
inside
the debugger (GDB) but when I tries to run it without debugger it
crashes.
I can't pinpoint the error.

Any new idea how to overcome this problem? Any debugging tip is fine.
 
Reply With Quote
 
 
 
 
Puppet_Sock
Guest
Posts: n/a
 
      03-31-2011
On Mar 31, 8:20*am, console kid <(E-Mail Removed)>
wrote:
> Hi all, I'm using GNU G++ for my development.
> I have write a simple test case.The program runs and exited normally
> inside
> the debugger (GDB) but when I tries to run it without debugger it
> crashes.
> I can't pinpoint the error.
>
> Any new idea how to overcome this problem? Any debugging tip is fine.


Your issue is not directly a language question.
You would be likely to get more and better help
if you went to a news group that had to do with
your compiler, and maybe your operating system
and hardware.

However: Crashes of this sort have generic causes.
Look for things like:
- running off the end of an array or block of
allocated memory, front or back
- using an invalid pointer such as a pointer
to memory that has been deallocated
- bad casts, especially of pointers
- off-by-one errors where you reference the
next or previous item in a series when that
item does not exist or does not behave as you want
- referencing resources (of any kind) before they
are allocated and initialized, or after they
are deallocated
- using a variable's content before it is initialized

There are a few more, but I've only had one
cup of coffee this AM.

And there are generic solutions. For example,
reduce your use of arrays by switching to the
standard library container classes.

For long term improvement, get books like
Effective C++ by Scott Meyers.
Socks
 
Reply With Quote
 
 
 
 
Default User
Guest
Posts: n/a
 
      03-31-2011

"console kid" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all, I'm using GNU G++ for my development.
> I have write a simple test case.The program runs and exited normally
> inside
> the debugger (GDB) but when I tries to run it without debugger it
> crashes.
> I can't pinpoint the error.
>
> Any new idea how to overcome this problem? Any debugging tip is fine.


Frequently, debugger runs will do things like initialize automatic
variables. I'd look for one that was used without intializing.



Brian


 
Reply With Quote
 
console kid
Guest
Posts: n/a
 
      03-31-2011
any idea how could I pinpoint the error?
It's silent inside the debugger and it crashes when I
laugh it independently.How can I debug this?

Any tools that I can use like ollydebug or something else?
 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      03-31-2011
On 3/31/2011 1:51 PM, console kid wrote:
> any idea how could I pinpoint the error?
> It's silent inside the debugger and it crashes when I
> laugh it independently.How can I debug this?


How about adding some debug printouts? In the old days that *was* the
debugger... And yes, that can mess up your program too by changing the
way the code is optimized.

V
--
I do not respond to top-posted replies, please don't ask
 
Reply With Quote
 
Drew Lawson
Guest
Posts: n/a
 
      03-31-2011
In article <(E-Mail Removed)>
console kid <(E-Mail Removed)> writes:
>any idea how could I pinpoint the error?


I seem to recall that some environments support ways to force any
crash to leave a core dump file. If you can do that, then you can
debug the post-crash state of the program.

Otherwise, the details of the crash could point somewhere. How do
you know it crashes? Are there any details (addresses, etc.) in
the message?

Still, all of this also would be more meaningful in a group specific
to your toolset and/or OS.

--
Drew Lawson | It's not enough to be alive
| when your future's been deferred
 
Reply With Quote
 
Balog Pal
Guest
Posts: n/a
 
      03-31-2011
"console kid" <(E-Mail Removed)>
> any idea how could I pinpoint the error?
> It's silent inside the debugger and it crashes when I
> laugh it independently.How can I debug this?
>
> Any tools that I can use like ollydebug or something else?


run it with valgrind
 
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
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Need Help getting a debugger going for IE - any free debugger aflat362 Javascript 7 12-07-2006 10:51 PM
How to call string member function inside debugger? wenmang@yahoo.com C++ 1 06-30-2006 02:27 PM
Neither IE-Debugger or Mozilla/Venkman debugger can step through dynamically added code? Robert Oschler Javascript 1 09-05-2005 07:17 AM
CRASH - DirectX End-User runtime - CRASH - What to to ? reply@newsgroup.please Computer Support 1 01-05-2004 02:55 PM



Advertisments