Page 1 of 1

Attempted to read or write protected memory.

Posted: Thu Jul 24, 2008 8:36 am
by sush
Hi

We are switching from 1.2 to 1.5 and have some problems :

Code: Select all

 Attempted to read or write protected memory. This is often an indication that other memory is corrupt.	   at Ranorex.NativeMethods.RxElementGetChild(ElementStruct& element, Int32 index, ElementStruct& child)
   at Ranorex.Element.GetChild(Int32 index)
   at YouROpen.GuiTester.OutputWindow.DumpElementTree(Element element, String Compare, Int32 level, String& sMessage)
while searching in a 'WindowsForms10.Window.8.app.0.2' 'oBottomDockBar' with

Code: Select all

        private void DumpElementTree(Element element, string Compare, int level, ref string sMessage)
        {
            level++;
            int childCount = element.ChildCount;

            Logger.Log.Info("DumpElementTree - now in level : " + level ); //FIXME
            for (int index = 0; index < childCount; index++)
            {
                Element child = element.GetChild(index);
                if (child == null)
                {
                    continue;
                }
                Logger.Log.Info("DumpElementTree - now in level : " + level + "  child.Name: " + child.Name + " sMessage: " + sMessage); //FIXME
                if (child.Name.Contains(Compare))
                {
                    sMessage = child.Name.Replace(" " + Compare, "").Replace(" ", "");
                }

                DumpElementTree(child, Compare, level, ref sMessage);
            }
        }
It happens very random (One Testrun in 60) and seldom at the same Testcase.
Are there known Issues, Modifications in this function or do you have another suggestion ?

best regards.andreas

Posted: Fri Jul 25, 2008 2:59 pm
by Support Team
We are currently investigating this problem. However, as it is difficult to reproduce, it might take some time. For now, the best solutions is to encapsulate this method with a try-catch block.

Regards,
Alex
Ranorex Support Team

Posted: Thu Jul 31, 2008 3:42 pm
by Support Team
We've found a bug in the memory managment of the RanorexCore that could cause this AccessViolationException. The bug will be fixed in the next minor version of Ranorex.

Regards,
Alex
Ranorex Support Team

Re: Attempted to read or write protected memory.

Posted: Thu Jun 18, 2009 12:23 pm
by balajichandan
Currently I am using Ranorex 1.5. Can I know if this is already fixed in later versions of Ranorex. If yes, can we know the version with this fix.

Re: Attempted to read or write protected memory.

Posted: Fri Jun 19, 2009 3:52 pm
by Support Team
The latest available Ranorex 1.X version is 1.5.1.5519. Ranorex 1.X versions are available to existing Ranorex 1.X customers only and can be requested by sending an email to support_at_ranorex.com.

Regards,
Alex
Ranorex Support Team