[IronPython] IronPython kills CLR

Szymon Kobalczyk s.kobalczyk at softwaremind.pl
Tue Jan 10 21:36:39 CET 2006

I finally found why my NUnit suite doesnt work anymore. It occurs that 
its caused by following test case:

            string script = @"
class Rectangle1(object):
    def __init__(self, width, height):
        self.width = width
        self.height = height
    def getArea(self):
        return self.width * self.height
    area = property(getArea, None, None, None)

r = Rectangle1(10, 100)
print r.area";

            PythonEngine engine = new PythonEngine();

            object code = engine.Compile(script);

Executing this in NUnit just kills the process with no error. When I 
execute it with debugger I get following exception:

 >    IronPython.dll!IronPython.Runtime.Frame.TryGetLocal(string name = 
"property", out object ret = null) Line 65 + 0x12 bytes    C#
     IronPython.dll!IronPython.Runtime.Frame.GetGlobal(string name = 
"property") Line 90 + 0xe bytes    C#
     snippets.dll!moduleHolder_0.Rectangle1$maker0() + 0x158 bytes   
     snippets.dll!moduleHolder_0.input() + 0xb6 bytes   
frame = {IronPython.Runtime.Frame}) Line 165 + 0xd bytes    C#

FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the 
error was at 0x79e7bd7e, on thread 0xc04. The error code is 0xc0000005. 
This error may be a bug in the CLR or in the unsafe or non-verifiable 
portions of user code. Common sources of this bug include user 
marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

If I execute the same script using IronPythonConsole it works fine. 
Please confirm if this issue would occur only when we use python 
properties (hopefully we don't have any yet in production code) or there 
are other cases to avoid.

Szymon Kobalczyk.

More information about the Ironpython-users mailing list