hellomotor / crashrpt

Automatically exported from code.google.com/p/crashrpt
0 stars 0 forks source link

crashrpt debug build #153

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I use debug dll and lib of crashrpt for debug version of my project. I properly 
call crInstall() function. Then, I call crInstallToCurrentThread2 function with 
parameter 0 in the begining of every thread function. I also call 
crUninstallFromCurrentThread() function end of every thread function. I think 
this was how it is supposed to be.

However, it always throws assertion in the crUninstallFromCurrentThread. I 
traced the code and GetCurrentProcessCrashHandler returns null which is in the 
crInstallToCurrentThread2. It says "Crash handler was already installed for 
current thread." and returns 1. Since handler returns NULL, it falls into 
ATLASSERT(pCrashHandler!=NULL) in the crUninstallFromCurrentThread.

I am using Visual Studio 2008 with SP1. My operating system is Windows XP. Am I 
missing something or do I have to use release dll and lib always?

Thanks in advance.

Original issue reported on code.google.com by akkayaca...@gmail.com on 30 May 2012 at 1:26

GoogleCodeExporter commented 9 years ago
The problem may be because you call crInstallToCurrentThread2() for the main 
thread. The crInstall() function installs the handlers for the main thread, so 
you should not install them twice.

Original comment by zexspect...@gmail.com on 30 May 2012 at 6:09

GoogleCodeExporter commented 9 years ago
I checked my code one more time. I call crInstall() only once in the beginning 
of app. Then, I call crInstallToCurrentThread2() for every single thread. 
However, as I indicated I use dll and lib file which are produced by using 
debug build configuration. If they had been produced by release build 
configuration, this assertion would have  never shown up. I checked 
documentation of crashrpt but I couldn't find anything about debug build 
configuration.

Original comment by akkayaca...@gmail.com on 4 Jun 2012 at 8:03

GoogleCodeExporter commented 9 years ago
Please clarify what do you mean by saying "I call crInstallToCurrentThread2() 
for every single thread"? You should call the crInstallToCurrentThread2() for 
all threads _EXCEPT_ the main one, but not for every single thread.

For example, see how the crInstallToCurrentThread2() function is called here
http://crashrpt.sourceforge.net/docs/html/simple_example.html

Another thing you may check is to see the thread ID of the thread where 
assertion is rised. You may do this using the Threads window in your Visual 
Studio IDE. If the thread where your exception is rised is the main thread, 
that means you call crInstallToCurrentThread2() for the main thread, however 
you should not do that.

Original comment by zexspect...@gmail.com on 5 Jun 2012 at 9:09

GoogleCodeExporter commented 9 years ago
Closing this issue, because there is no reply from the reporter.

Original comment by zexspect...@gmail.com on 22 Aug 2012 at 10:18