Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDefault type Pin
thelonesquirrely20-Aug-09 7:59
thelonesquirrely20-Aug-09 7:59 
AnswerRe: Default type Pin
Graham Shanks20-Aug-09 8:11
Graham Shanks20-Aug-09 8:11 
AnswerRe: Default type Pin
Maximilien20-Aug-09 8:19
Maximilien20-Aug-09 8:19 
GeneralRe: Default type Pin
thelonesquirrely20-Aug-09 8:22
thelonesquirrely20-Aug-09 8:22 
GeneralRe: Default type Pin
Maximilien20-Aug-09 9:08
Maximilien20-Aug-09 9:08 
QuestionDoxygen help Pin
Pabolo20-Aug-09 7:35
Pabolo20-Aug-09 7:35 
QuestionDebugging Multiple Threaded App - Throwing Unhandled Exeception Pin
CodeMacDaddy20-Aug-09 4:44
CodeMacDaddy20-Aug-09 4:44 
AnswerRe: Debugging Multiple Threaded App - Throwing Unhandled Exeception Pin
Roger Stoltz20-Aug-09 6:01
Roger Stoltz20-Aug-09 6:01 
CodeMacDaddy wrote:
I believe the app is crashing because of the 3rd party lib
thread


It seems that way, if you are certain that you've surrounded your calls to the DLL with try/catch(...) blocks and you are not doing any new/delete stuff.
This seems to be your main problem if I understand your description correctly and unfortunately it also seems like you cannot do anything about it if you're not able to build the DLL.


CodeMacDaddy wrote:
I have access to the 3rd party lib code and have been
reviewing this "steaming pile" of poorly written code.


I can understand that you get frustrated during this tedious work trying to understand how it works, how it is suppose to work and why it doesn't.
However, it may not be as "poorly written" as you may think.
E.g. it's pointless to check if a memory allocation using new was successful in an exception-enabled application since if it fails it will throw an exception. Furthermore it's perfectly legal to call delete with a NULL pointer.


CodeMacDaddy wrote:
In a multiple thread application
if the child thread crashes or throws an exceptoin how can my
parent thread "trap" the exception ? Is this possible ?


No, as far as I know it's not possible since exceptions are thrown within their context. So you won't be able to catch an exception thrown in a thread that is created inside your third-party DLL.

As for the root cause of your problem I can only guess, but I would bet some money on a race condition. Wink | ;)
It's quite possible that the worker thread inside the DLL reads incoming messages and puts them in a buffer (m_buffer?). For some reason the connection should be closed down, the Baga object destroyed and the receiving thread should be terminated. If the shutdown sequence doesn't wait for the worker thread to finish, the buffer may be freed before the thread exits. The thread may then try to write to the buffer which has already been freed in the call chain of the shutdown sequence.
Be aware that I'm only guessing, but the above is a common mistake.

When your application comes to this halt, try and find something in the call stack for each thread that makes sense instead of simple addresses. It may help you to figure out what has been executed and what the root cause of your problem is.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


GeneralRe: Debugging Multiple Threaded App - Throwing Unhandled Exeception Pin
CodeMacDaddy20-Aug-09 8:14
CodeMacDaddy20-Aug-09 8:14 
AnswerRe: Debugging Multiple Threaded App - Throwing Unhandled Exeception Pin
Roger Stoltz20-Aug-09 22:19
Roger Stoltz20-Aug-09 22:19 
GeneralRe: Debugging Multiple Threaded App - Throwing Unhandled Exeception Pin
CodeMacDaddy21-Aug-09 8:30
CodeMacDaddy21-Aug-09 8:30 
AnswerRe: Debugging Multiple Threaded App - Throwing Unhandled Exeception Pin
KarstenK20-Aug-09 21:38
mveKarstenK20-Aug-09 21:38 
GeneralRe: Debugging Multiple Threaded App - Throwing Unhandled Exeception Pin
CodeMacDaddy21-Aug-09 8:31
CodeMacDaddy21-Aug-09 8:31 
QuestionOpening new document type in existing frame window Pin
Member 268155320-Aug-09 3:46
Member 268155320-Aug-09 3:46 
Questioncommunicate between 2 different applications using CORBA Pin
sola7720-Aug-09 1:44
sola7720-Aug-09 1:44 
AnswerRe: communicate between 2 different applications using CORBA Pin
Adam Roderick J20-Aug-09 1:48
Adam Roderick J20-Aug-09 1:48 
GeneralRe: communicate between 2 different applications using CORBA Pin
sola7720-Aug-09 1:54
sola7720-Aug-09 1:54 
GeneralRe: communicate between 2 different applications using CORBA [modified] Pin
Adam Roderick J20-Aug-09 2:39
Adam Roderick J20-Aug-09 2:39 
AnswerRe: communicate between 2 different applications using CORBA Pin
Cedric Moonen20-Aug-09 2:00
Cedric Moonen20-Aug-09 2:00 
GeneralRe: communicate between 2 different applications using CORBA Pin
sola7720-Aug-09 2:10
sola7720-Aug-09 2:10 
GeneralRe: communicate between 2 different applications using CORBA Pin
Cedric Moonen20-Aug-09 2:15
Cedric Moonen20-Aug-09 2:15 
GeneralRe: communicate between 2 different applications using CORBA Pin
sola7720-Aug-09 2:21
sola7720-Aug-09 2:21 
GeneralRe: communicate between 2 different applications using CORBA Pin
Cedric Moonen20-Aug-09 2:26
Cedric Moonen20-Aug-09 2:26 
GeneralRe: communicate between 2 different applications using CORBA Pin
sola7720-Aug-09 2:33
sola7720-Aug-09 2:33 
GeneralRe: communicate between 2 different applications using CORBA Pin
Garth J Lancaster20-Aug-09 12:12
professionalGarth J Lancaster20-Aug-09 12:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.