jirentabu / crashrpt

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

_crash_handlers designed to be used in application level #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think it should be used in thread level rather than application.
First:CrashHandler map in CrashRpt.DLL will not share with multi-process.Every 
Application(process) has a CrashHandler map itself.
Second:The MSDN (See http://msdn.microsoft.com/en-
us/library/ms680634(VS.85).aspx)says:"Issuing SetUnhandledExceptionFilter 
replaces the existing top-level exception filter for all existing and all 
future threads in the calling process.",which means SetUnhandledExceptionFilter 
is a thread-concerned function.

Forgiven my English.

Original issue reported on code.google.com by zhangyin...@gmail.com on 8 Sep 2009 at 2:53

GoogleCodeExporter commented 9 years ago
Suppose there are two threads A and B in One process(suppose pid = 123 ).
When A's CrashHandler Destoryed,the m_pid(123) of A will be removed from 
g_CrashHandlers.m_map.B's CrashHandler needs to be destoryed too,when it 
destory,there 
will no 123(m_pid) in g_CrashHandlers.

See:
std::map<int, CCrashHandler*>::iterator it = g_CrashHandlers.m_map.find(m_pid); 
g_CrashHandlers.m_map.erase(it);

Original comment by zhangyin...@gmail.com on 8 Sep 2009 at 3:11

GoogleCodeExporter commented 9 years ago
Sry,I read code of old version.
I discover the new version is thread-oriented, and I think m_pid is not 
essential need.

Original comment by zhangyin...@gmail.com on 8 Sep 2009 at 3:31

GoogleCodeExporter commented 9 years ago
1. CrashHandler map is not shared between several processes. As FAQ states, you 
can't
use crashrpt across process boundaries. You should install exception handlers 
in a
process once. Typically you do that in the *main()* function. We don't plan to 
change
this design, because we can't imagine how you can share exception handlers 
between
several processes.

2. The SetUnhandledExceptionFilter() works on per-process basis. This means you
should call it once in your main() function. No need to call this function in 
every
worker thread you have. You can write a simple test application to ensure that.

3. The current implementation uses m_pid, but you can't share CrashHandlers 
between
several processes. Just ignore this implementation detail.

Original comment by zexspect...@gmail.com on 8 Sep 2009 at 3:35

GoogleCodeExporter commented 9 years ago
After commenting/discussing, I hope we agreed this is not an issue.

Original comment by zexspect...@gmail.com on 2 Nov 2009 at 5:35