Attempted to read or write protected memory.

Class library usage, coding and language questions.
sush
Posts: 2
Joined: Fri Aug 31, 2007 2:56 pm
Location: Graz/Austria
Contact:

Attempted to read or write protected memory.

Post by sush » Thu Jul 24, 2008 8:36 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Fri Jul 25, 2008 2:59 pm

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Thu Jul 31, 2008 3:42 pm

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

balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Re: Attempted to read or write protected memory.

Post by balajichandan » Thu Jun 18, 2009 12:23 pm

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Attempted to read or write protected memory.

Post by Support Team » Fri Jun 19, 2009 3:52 pm

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
.
Image