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

Getting crash information

Hi,

I want to know that when my application is running outside of the debugger
(in debug or release build) can I set the application/project settings in a
way that when it crashes it tells me which method of which class it was
running while it crashed. And can it also give me the stack trace of when
the crash happened? I'm asking this cuz I'm running the app in a machine in
which I cant install the visual studio, but I do have the freedom of placing
as many files (debug dlls objs etc) as I want to.

Regards,

...ab
Feb 9 '07 #1
8 1760
"Abubakar" <em**********@yahoo.comwrote in message
news:eL**************@TK2MSFTNGP06.phx.gbl...
I want to know that when my application is running outside of the debugger
(in debug or release build) can I set the application/project settings in
a way that when it crashes it tells me which method of which class it was
running while it crashed. And can it also give me the stack trace of when
the crash happened?
If you don'y want to modify your application, one thing that you can do is
to make sure the Dr. Watson is set as the JIT debugger. It will create a
crash dump if you set that option. Run

drwtsn32.exe

for details.
I'm asking this cuz I'm running the app in a machine in which I cant
install the visual studio, but I do have the freedom of placing as many
files (debug dlls objs etc) as I want to.
Another option is to instrument your application to create a minidump:

http://msdn2.microsoft.com/en-us/library/ms680369.aspx

Regards,
Will
www.ivrforbeginners.com
Feb 9 '07 #2
Hi,
If you don'y want to modify your application, one thing that you can do is
Well I can change my application, modify the source, if it can help me catch
the bugs that crashes my application. In this case do u mean I'll have to
use the MiniDump* apis that u gave the link of?

regards,

...ab

"William DePalo [MVP VC++]" <wi***********@mvps.orgwrote in message
news:u8**************@TK2MSFTNGP03.phx.gbl...
"Abubakar" <em**********@yahoo.comwrote in message
news:eL**************@TK2MSFTNGP06.phx.gbl...
>I want to know that when my application is running outside of the
debugger (in debug or release build) can I set the application/project
settings in a way that when it crashes it tells me which method of which
class it was running while it crashed. And can it also give me the stack
trace of when the crash happened?

If you don'y want to modify your application, one thing that you can do is
to make sure the Dr. Watson is set as the JIT debugger. It will create a
crash dump if you set that option. Run

drwtsn32.exe

for details.
>I'm asking this cuz I'm running the app in a machine in which I cant
install the visual studio, but I do have the freedom of placing as many
files (debug dlls objs etc) as I want to.

Another option is to instrument your application to create a minidump:

http://msdn2.microsoft.com/en-us/library/ms680369.aspx

Regards,
Will
www.ivrforbeginners.com


Feb 11 '07 #3
"Abubakar" <em**********@yahoo.comwrote in message
news:Or**************@TK2MSFTNGP02.phx.gbl...
Well I can change my application, modify the source, if it can help me
catch
the bugs that crashes my application. In this case do u mean I'll have to
use the MiniDump* apis that u gave the link of?
As I said, you can use Dr Watson to catch the fault and create the crash
dump or in you do it in code. A sample of the latter approach is here:

http://www.codeproject.com/tools/minidump.asp

Just by the way, I know nothing of that sample except that it was the first
hit at Code Project.

Regards,
Will
www.ivrforbeginners.com

Feb 11 '07 #4
Here is what I did: I have installed the windbg on the machine where i'm
running my code and set it as the default jit debugger. Now my binaries are
all in release mode but i've placed the release pdb files along them. I've
also placed the source code in some directories. Now when my app crashes,
windbg takes over and now I specify the source directory of source paths and
double click the stack trace lines and there I'm in the debugger showing me
my beautiful code :) but still I'v no idea of what went wrong. I've a
question: What is a "(8524.8ef4): Access violation - code c0000005 (!!!
second chance !!!)" ? Maybe the stack got corrupted?

...ab

"William DePalo [MVP VC++]" <wi***********@mvps.orgwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
"Abubakar" <em**********@yahoo.comwrote in message
news:Or**************@TK2MSFTNGP02.phx.gbl...
>Well I can change my application, modify the source, if it can help me
catch
the bugs that crashes my application. In this case do u mean I'll have to
use the MiniDump* apis that u gave the link of?

As I said, you can use Dr Watson to catch the fault and create the crash
dump or in you do it in code. A sample of the latter approach is here:

http://www.codeproject.com/tools/minidump.asp

Just by the way, I know nothing of that sample except that it was the
first hit at Code Project.

Regards,
Will
www.ivrforbeginners.com



Feb 11 '07 #5
"Abubakar" <em**********@yahoo.comwrote in message
news:eU**************@TK2MSFTNGP02.phx.gbl...
What is a "(8524.8ef4): Access violation - code c0000005 (!!! second
chance !!!)" ? Maybe the stack got corrupted?
It is an attempt to access memory that isn't there. A pointer could be zero,
it could point to non-existent memory, it could point to read-only memory on
a write etc. The memory could be on the stack or on the heap or anywhere
else.

It's often difficult to determine where and why things went bad, but if
you've trapped the fault at the debuuger you should be able to determine
what is bad.

Regards,
Will
www.ivrforbeginners.com


Feb 11 '07 #6
Do optimizations effect debugging in release mode. Should I turn off all
optimizations, will that help me in debugging release binaries?

...ab

"William DePalo [MVP VC++]" <wi***********@mvps.orgwrote in message
news:O4**************@TK2MSFTNGP03.phx.gbl...
"Abubakar" <em**********@yahoo.comwrote in message
news:eU**************@TK2MSFTNGP02.phx.gbl...
>What is a "(8524.8ef4): Access violation - code c0000005 (!!! second
chance !!!)" ? Maybe the stack got corrupted?

It is an attempt to access memory that isn't there. A pointer could be
zero, it could point to non-existent memory, it could point to read-only
memory on a write etc. The memory could be on the stack or on the heap or
anywhere else.

It's often difficult to determine where and why things went bad, but if
you've trapped the fault at the debuuger you should be able to determine
what is bad.

Regards,
Will
www.ivrforbeginners.com


Feb 12 '07 #7
"Abubakar" <em**********@yahoo.comwrote in message
news:uT**************@TK2MSFTNGP06.phx.gbl...
Do optimizations effect debugging in release mode.
Yes. The code you execute is not exactly the code as it was written.
Should I turn off all optimizations, will that help me in debugging
release binaries?
Well, it can help.

But the first step is to determine what is the cause of the error. It could
be an optimizer bug. Or it could be a timing issue or it could be that the
bug corrupts different locations in debug and release mode.

Optimizer bugs aren't unknown but, IME, they don't occur as often as
application bugs. Rather than turning off optimizations you could try
optimizing for size instead of speed (or vice versa).

If you have a .pdb file for your release build - even optimized - then you
should be able to get close to the source of the error. You can use a pragma
to selectively turn off the optimizer in the module that contains the error.
And you can shrink the size of the unoptimized section of that module
iteratively until you find out where it breaks.

If you have an application problem you might want to look at tools like
PageHeap

http://support.microsoft.com/kb/286470

to diagnose memory problems. And you can always do what we did before we had
good debuggers - use printf() or WriteConsole() or the standard output
stream in C++ - to trace your application's execution.

Regards,
Will
www.ivrforbeginners.com


Feb 12 '07 #8
Hey I caught the bug! It was a threading problem, relating to an internal
(little) database that we access, I was not managing the locking of the
database efficiently. It was a rare bug though, I can only reproduce it on a
dual core machine :) wow.... this reminds me of the post that I have in
mind: about single core n dual core programming concerns .... I'll post it
sometime ..

thanks,

...ab

"William DePalo [MVP VC++]" <wi***********@mvps.orgwrote in message
news:ed****************@TK2MSFTNGP03.phx.gbl...
"Abubakar" <em**********@yahoo.comwrote in message
news:uT**************@TK2MSFTNGP06.phx.gbl...
>Do optimizations effect debugging in release mode.

Yes. The code you execute is not exactly the code as it was written.
>Should I turn off all optimizations, will that help me in debugging
release binaries?

Well, it can help.

But the first step is to determine what is the cause of the error. It
could be an optimizer bug. Or it could be a timing issue or it could be
that the bug corrupts different locations in debug and release mode.

Optimizer bugs aren't unknown but, IME, they don't occur as often as
application bugs. Rather than turning off optimizations you could try
optimizing for size instead of speed (or vice versa).

If you have a .pdb file for your release build - even optimized - then you
should be able to get close to the source of the error. You can use a
pragma to selectively turn off the optimizer in the module that contains
the error. And you can shrink the size of the unoptimized section of that
module iteratively until you find out where it breaks.

If you have an application problem you might want to look at tools like
PageHeap

http://support.microsoft.com/kb/286470

to diagnose memory problems. And you can always do what we did before we
had good debuggers - use printf() or WriteConsole() or the standard output
stream in C++ - to trace your application's execution.

Regards,
Will
www.ivrforbeginners.com


Feb 12 '07 #9

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

Similar topics

10
by: xixi | last post by:
i have db2 udb v8.1 on windows 64 bit 2003 server, after db2 server start , i found this in the db2diag.log, is this error? 2004-05-05-15.28.30.780000 Instance:DB2 Node:000...
5
by: NG | last post by:
Hi, We are having DB2-V7.2 DB on AIX 5.2 machine. Recently we upgraded our system to fixpack 13 and activated activate AIX asynchronous IO function. Our DB is going to crash recovery with...
8
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
4
by: arizvi | last post by:
Hi, My program crashes when it reaches a certain line. There is nothing wrong with that particular line as I have changed it to something simple like i=0, and it still crashes. If I remove...
1
by: tony | last post by:
hi. my NET application is using mixed c++ dll ( managed and unmanaged) in that dll , im calling api's of unamanged dll. my application crash with no exception or warning. its hard to...
15
by: Trapulo | last post by:
Very often my VS2005 pro crashes after a debug. I run ASP.NET debug, and all works well. Then I stop it, and all it's also ok. Then, when I try to edit some code, it crashes and I need to kill it,...
12
by: benjamin.krulewitch | last post by:
I'm debugging an issue with a C program that causes the computer to crash, and I'm attempting to log information immediately before the crash occurs. I us my BKprintLog function (see below) to...
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
11
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I have run into a situation that if a page/tab that uses the Ajax toolkit (using .net version 3.5) is closed before the Ajax enable controls complete loading, then IE locks up. Does it in both IE7...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...

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.