I have a c++ application which does authentications.The scenario is like testing maximum number of authentications it can do in a time period like 15 mins.So while testing its performance on a quad core machine with a performance testing software called "Load Runner",I am facing an issue
I am getting lot of exceptions, I am catching them but the hard part is ,I can't find the type of that exception.So to simulate the Load runner behaviour I wrote a multithreaded program and did authentications in parallel,this time inorder to find where the exception is coming I removed the generic catch block and let the application crash and I also configured windbg as postmortem debugger.So the application crashed and in the stack trace i found it is crashing in "xerces" dll(an xml parser i used). So now i know the type of exception and I tried to catch these exceptions by using these catch blocks
catch (const XMLException& toCatch)
{
char* message = XMLString::transcode(toCatch.getMessage());
cout << "xerces exception :" << message;
XMLString::release(&message);
return -1;
}
catch (const DOMException& toCatch)
{
char* message = XMLString::transcode(toCatch.msg);
cout <<"xerces DOMexception :" << message;
XMLString::release(&message);
return -1;
}
but still it was going to the generic catch block,I tried "bad_alloc" also(just to give it a try), it didnt catch it too.
I followed the recommendations given by xerces for thread safety. But still Im getting these exceptions. What is puzzling me is what on earth is the type of that exception? Does that even has a type at all?
EDIT:I can see my application crashing in xerces dll,since it is a thirdparty dll i dont know what i can do to fix it. Windbg reports like this after each time it crashes
FAULTING_IP:
xerces_c_3_1_vc80!xercesc_3_1::DOMImplementationRegistry::getDOMImplementation+31
120e2681 8b30 mov esi,dword ptr [eax]
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 120e2681 (xerces_c_3_1_vc80!xercesc_3_1::DOMImplementationRegistry::getDOMImplementation+0x00000031)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 00000000
Attempt to read from address 00000000
What Can I do in this case?What do you guys recommend?
The exception you posted seems to be an access violation (0xc00000005). A C++ exception will not catch these unless you have structured exception handling turned on (SEH) when you built your application.
But the other issue is that you know what the exception is, so how do you fix it? That is a different thing altogether. From the looks of it, the xerces code is attempting to dereference a NULL pointer.
You should have handy a debuggable version of the xerces library (which comes with full source code), and attempt to duplicate the crash using that version. Then at least you can see exactly what is happening at the crash location and how it occurred.
User contributions licensed under CC BY-SA 3.0