0

I have a UI application (Implemented in Java) which launches multiple process (implemented in C++). Interaction between Java Process and C++ process is over TCP.

C++ process internally loads several dlls. However due to programmer errors dlls might crash which leads to C++ process crash.

Upon crashing I want UI process to Identify which C++ process crashed and the dll that is leading to the crash, So that I can inform users about the root case and avoid loading the dll.

Is there any way in Java by which i can achieve above functionality. E.g. Can I get a crash report from the process which i can parse and indentify dll that is leading to crash ?

My application runs on Windows , Mac & Linux.

Many Thanks in advance

  • maybe this can help you throwing java exceptions from c++ code http://codemesh.com/products/junction/faqs_usage/faq_throwing_exceptions.html if not take a look to JNI http://stackoverflow.com/questions/230689/best-way-to-throw-exceptions-in-jni-code – ZaoTaoBao May 24 '16 at 06:22
  • @ZaoTaoBao : Thanks for your response. Im not using JNI hence will not be able to throw exception from C++. However we will not be able to catch all crashs (e.g crash due to heap issues) in which case we no exception can be thrown. Im using TCP to communicate between Java & C++ process. Java process launches C++ process and has reference to C++ process. From Java process I can check if C++ process isAlive, However when C++ process crashes I want to know the route cause (faulty dll) that is leading to the crash. – Vinod Allu May 24 '16 at 06:58
  • That will be OS specific, either in the way the Java process collects system informations about crashes (eg: the Windows Event viewer) or in the way C++ processes catch their own crash (eg: Windows Structured Exception Handling). The way to go, in my humble opinion: correct the crashing code. – manuell May 24 '16 at 07:46
  • The lib which leads to crash is not in my control, hence looking for way to avoid Identify lib which crashed and avoid using the lib for further processing. if there is a way C++ process can catch their own crash (including heap issues ) that would be great. However Im looking for solution on Mac, Windows & Linux. What are the standard practices on Mac & Linux ? – Vinod Allu May 26 '16 at 03:26

0 Answers0