Boo编译器偶尔抛出“试图读取或写入受保护的内存”

时间:2013-03-11 16:33:20

标签: .net memory-leaks dsl boo rhino-dsl

编译Boo脚本时,我有时会遇到以下异常:

A unexpexted thing happened, C:\Resources\temp\de4ee12533b34facbb80d007648a48f2.BackendRole\RoleTemp
output562348dc-eaec-41d3-9463-330b8bbe7ab8.bre(1,1): BCE0055: Boo.Lang.Compiler.CompilerError: Internal compiler error: Failed to create 'output562348dceaec-41d3-9463-330b8bbe7ab8.$Prepare$locals$3' type.. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type)
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
at System.Reflection.Emit.TypeBuilder.CreateType()
at Boo.Lang.Compiler.Steps.EmitAssembly.TypeCreator.HandleTypeCreation(TypeDefinition  type)
at Boo.Lang.Compiler.Steps.EmitAssembly.TypeCreator.CreateType(TypeDefinition type)
— End of inner exception stack trace —
at Boo.Lang.Compiler.Steps.EmitAssembly.TypeCreator.CreateType(TypeDefinition type)
at Boo.Lang.Compiler.Steps.EmitAssembly.TypeCreator.CreateTypes()
at Boo.Lang.Compiler.Steps.EmitAssembly.TypeCreator.Run()
at Boo.Lang.Compiler.Steps.EmitAssembly.CreateTypes(List`1 types)
at Boo.Lang.Compiler.Steps.EmitAssembly.DefineTypes()
at Boo.Lang.Compiler.Steps.EmitAssembly.Run()
at Boo.Lang.Compiler.CompilerPipeline.RunStep(CompilerContext context, ICompilerStep step)

这种情况有时只会发生,通常是在远程环境中(我只能看到那里的日志)。还没有找到在本地重现它以调试它,监视内存消耗等的方法。

有没有人有任何线索?编译Boo脚本时是否需要处理一些非托管资源?

0 个答案:

没有答案