We're hitting a sporadic access violation when using the Fiddler OM in our test automation. I have not been able to find anything indicating this is an issue with our code, but I'm still digging
Inside our internal event handler, the relevant code is:
session["https-Client-Certificate"] = "FiddlerCert.cer"; <-- this has me wondering if it's possible for a corrupt or invalid cert to cause the below crash
session.bBufferResponse = true;
string requestBody = session.GetRequestBodyAsString(); <-- crash happens here
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Text.UTF8Encoding.GetChars(Byte*
bytes, Int32 byteCount, Char* chars, Int32 charCount, DecoderNLS baseDecoder)
at System.String.CreateStringFromEncoding(Byte*
bytes, Int32 byteLength, Encoding encoding)
at System.Text.UTF8Encoding.GetString(Byte[]
bytes, Int32 index, Int32 count)
at System.Text.Encoding.GetString(Byte[] bytes)
at
Fiddler.Utilities.GetStringFromArrayRemovingBOM(Byte[] arrInput, Encoding
oDefaultEncoding)
at Fiddler.Session.GetRequestBodyAsString()
at <INTERNAL NAMESPACE REMOVED>.FiddlerApplication_BeforeRequest(Session
session)
at Fiddler.SessionStateHandler.Invoke(Session
oSession)
at
Fiddler.FiddlerApplication.DoBeforeRequest(Session oSession)
at Fiddler.Session._executeObtainRequest()
at Fiddler.Session.InnerExecute()
at Fiddler.Session.Execute(Object
objThreadState)
at
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at
System.Threading.ThreadPoolWorkQueue.Dispatch()
at
System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Has anyone seen this before, or know of a fix or workaround? I'd like to think that even in the case of a corrupt/bad/missing certificate, an AV wouldn't happen, but without the Fiddler source, there's no great way for me to prove that (yes, I could disassemble, but I haven't yet).