This is a migrated thread and some comments may be shown as answers.

System.AccessViolationException:Attempted to read or write protected memory.

3 Answers 277 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott Davis
Top achievements
Rank 1
Scott Davis asked on 21 Apr 2010, 11:58 PM

Hi,

I am reposting this thread because it fails to open when I click on it, even though other threads open fine:


I am getting the following exception thrown:

ExecuteCommand failed!
InError set by the client. Client Error:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at mshtml.HTMLWindow2Class.IHTMLWindow2_get_location()
   at ArtOfTest.InternetExplorer.IECommandProcessor.SetCurrentDocumentMarkup(BrowserCommand& response)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessInformationCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Information',Info:'DocumentMarkup',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_5b9018b6-a3c7-4783-b359-b959491b385e',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at mshtml.HTMLWindow2Class.IHTMLWindow2_get_location()
   at ArtOfTest.InternetExplorer.IECommandProcessor.SetCurrentDocumentMarkup(BrowserCommand& response)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessInformationCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.


Some other details from the command:
ActionType: ArtOfTest.WebAii.Messaging.Process.BrowserActionType.NotSet
CommandType: ArtOfTest.WebAii.Messaging.Process.BrowserCommandType.Information



The call stack when the exception is thrown shows that the framework is making 2 native code transitions, potentially the source of the memory corruption...?

ArtOfTest.WebAii.dll!ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(ArtOfTest.WebAii.Messaging.Process.BrowserCommand request = {BrowserCommand (Type:'Information',Info:'DocumentMarkup',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_5b9018b6-a3c7-4783-b359-b959491b385e',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')}) + 0x352 bytes
  ArtOfTest.WebAii.dll!ArtOfTest.WebAii.Core.Browser.ExecuteCommand(ArtOfTest.WebAii.Messaging.Process.BrowserCommand request = {BrowserCommand (Type:'Information',Info:'DocumentMarkup',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_5b9018b6-a3c7-4783-b359-b959491b385e',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')}, bool performDomRefresh = false, bool waitUntilReady = false) + 0x42 bytes
  ArtOfTest.WebAii.dll!ArtOfTest.WebAii.Core.Browser.RefreshDomTree() + 0x113 bytes
  ArtOfTest.WebAii.dll!ArtOfTest.WebAii.ObjectModel.Element.Refresh(bool forceDomTreeRefresh = true) + 0x33 bytes
  [Native to Managed Transition]
  [Managed to Native Transition]
  ArtOfTest.Common.dll!ArtOfTest.Common.WaitAsync.CallRefreshIfNeeded<ArtOfTest.WebAii.ObjectModel.Element>(ArtOfTest.WebAii.ObjectModel.Element target = {[Element: 'div:221' (id=ctl00_ctl00_Fcph_Mcph_portalBody_portalTabStrip)]}) + 0x261 bytes
  ArtOfTest.Common.dll!ArtOfTest.Common.WaitAsync._worker_DoWork<ArtOfTest.WebAii.ObjectModel.Element,object>(object waitParam = {ArtOfTest.Common.WaitAsync.WaitParams<ArtOfTest.WebAii.ObjectModel.Element,object>}) + 0x228 bytes
  mscorlib.dll!System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(object state) + 0x2f bytes
  mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x51 bytes
  [Native to Managed Transition]
  [Managed to Native Transition]
  mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x67 bytes
  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x45 bytes
  mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback tpWaitCallBack) + 0x53 bytes
  mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(object state) + 0x59 bytes
  [Appdomain Transition]


Not sure what I can do about this?

Cheers,
Scott


3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 22 Apr 2010, 10:41 PM
Hello Scott Davis,

I was able to pull up my last reply on the other thread. I do apologize for the webiste problems. We were having some issues with the forums. They should be all resolved now.

Thank you for detailed information. Which step in your test failed and is it the same step that always fails)? Am I correct in assuming that your test normally passes but only occasionally fails at unexpected times? How frequently?

Does this happen while you are running your test under the debugger, or while executing the test normally? This type of exception does sometimes happen normally and our framework automatically catches it and recovers from it. So if this is happening in the debugger with catch all thrown exceptions turned on, you may simply be catching a non-problem.

At the end of your message you mention you're using Beta. Which Beta version are you using? We did just release WebAii testing framework 2010.1.4.12 last week. You may want to give that version a try.

Can you send us your test to study?

All the best,
Cody
the Telerik team


Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Scott Davis
Top achievements
Rank 1
answered on 26 Apr 2010, 06:15 AM

> Which step in your test failed and is it the same step that always fails)? Am I correct in assuming that your test normally passes but only occasionally fails at unexpected times? How frequently?
Yes, this is correct.Usually it runs fine, but probably one in four times it throws this exception, at a random point.

> Does this happen while you are running your test under the debugger, or while executing the test normally?
Under the debugger with all .NET exceptions set to be caught.

> At the end of your message you mention you're using Beta. Which Beta version are you using? We did just release WebAii testing framework 2010.1.4.12 last week. You may want to give that version a try.
I just upgraded to 2010.1.4.12 and am still seeing the issue.

> Can you send us your test to study?
Unfortunately not, it is quite involved.

> This type of exception does sometimes happen normally and our framework automatically catches it and recovers from it. So if this is happening in the debugger with catch all thrown exceptions turned on, you may simply be catching a non-problem.
Ok, I will switch it off an assume it isn't a problem.

Thanks!
Scott
0
Cody
Telerik team
answered on 26 Apr 2010, 05:41 PM
Hi Scott Davis,

Ok, good approach. Let me know if you continue having reliability problems outside of a debugging environment.

Greetings,
Cody
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Scott Davis
Top achievements
Rank 1
Answers by
Cody
Telerik team
Scott Davis
Top achievements
Rank 1
Share this question
or