TheSwamp

Code Red => .NET => Topic started by: bikelink on March 23, 2010, 11:47:17 AM

Title: crash mda/reentrancy and trouble managed/unamanged ?
Post by: bikelink on March 23, 2010, 11:47:17 AM
Hi people.. I'm here with another  very nice trouble..   :realmad:

In my application under stress autocad shows always  MDA Reentrancy and
crash with this error:

(this is showed in outbut debug)
The program '[3436] acad.exe: Managed' has exited with code -1073741819 (0xc0000005).


this is in xml/dmp

<AppCDATA>
- <![CDATA[ Command: ;Gruppo di comandi;Gruppo di comandi;Gruppo di comandi;Gruppo di comandi;Gruppo di comandi
Clr Data:
   in AcGeEntity3d.{dtor}(AcGeEntity3d* )
   in Autodesk.AutoCAD.Geometry.Entity3d.DeleteUnmanagedObject()
   in Autodesk.AutoCAD.Runtime.DisposableWrapper.!DisposableWrapper()
   in Autodesk.AutoCAD.Runtime.DisposableWrapper.Dispose(Boolean )
   in Autodesk.AutoCAD.Runtime.DisposableWrapper.Finalize()

  ]]>
</AppCDATA>


In autocad application I loop many times between differents Documents/drawings,
The code reads solids , create regions, polylines (in memory  without append to database)  checks interference and creates datatable (system.datatable)
I'm pretty sure that all resource allocated are Disposed correctly (Solid3d , ecc..)
It's looks like as trouble from managed/unmanaged code (GC) and I can't be able to catch the exception
also if I have all try catch blocks.
I go crazy!
any suggestion to avoid this crash ?
I thinking to write the code in c++ about solid3d in order to free and managed the memory...but I would like to reserve me this as last
chance.



Thanks in advance
Giuliano
Title: Re: crash mda/reentrancy and trouble managed/unamanged ?
Post by: Glenn R on March 23, 2010, 12:23:33 PM
Do you have 'using' statements wrapping ALL of your 'in memory' objects that you create (the regions, polylines etc.)? This will make sure they are disposed of correctly.

Without seeing code, I'm only able to guess...
Title: Re: crash mda/reentrancy and trouble managed/unamanged ?
Post by: bikelink on March 23, 2010, 01:15:31 PM
I use to write "using" in all my blocks...for transactions, dbobjects ecc..
In order to show the code i could post very many rows... nothing secrets but very long codes..
If i check the single program blocks with huge loop i haven't bug... it's seems like the GC don't syncronise correctly the memory.