[IronPython] Unexpected error in 2.0B2

Curt Hagenlocher curt at hagenlocher.org
Mon May 5 06:45:58 CEST 2008

Interestingly, the code works correctly when the flag -X:SaveAssemblies is
used.  It also doesn't happen if the same code exists in an external
assembly that's called by IronPython.  This suggests that the issue is in
the dynamic code generation in the DLR and is not directly related to any
kind of CAS issues, but I haven't yet been able to find any code changes
that could explain the different behavior.
On Fri, May 2, 2008 at 5:59 PM, Curt Hagenlocher <curt at hagenlocher.org>

> The following code works for me under B1, but throws an exception under
> B2:
> import clr
> import System
> name = System.Reflection.AssemblyName()
> name.Name = 'Test'
> assemblyBuilder =
> System.AppDomain.CurrentDomain.DefineDynamicAssembly(name,
> System.Reflection.Emit.AssemblyBuilderAccess.Run)
> The stack trace is, of course, entirely inside the CLR.
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "mscorlib", line unknown, in DefineDynamicAssembly
>   File "mscorlib", line unknown, in InternalDefineDynamicAssembly
>   File "mscorlib", line unknown, in nCreateDynamicAssembly
>   File "mscorlib", line unknown, in CheckGrantSetHelper
> SystemError: Object reference not set to an instance of an object.
> Unfortunately, nCreateDynamicAssembly is an InternalCall, so I can't see
> exactly what it's doing.  The only object reference in CheckGrantSetHelper
> is to a PermissionSet, presumably one of the three that are passed to
> nCreateDynamicAssembly.  Based on the methods higher in the stack, I expect
> that all three PermissionSets passed to nCreateDynamicAssembly are null, but
> this would have been true under B1 as well.
> Have there been security-related changes made that could cause this
> problem?
> --
> Curt Hagenlocher
> curt at hagenlocher.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080504/c8d159d1/attachment.html>

More information about the Ironpython-users mailing list