[Mono-dev] Data Execution Prevention and dynamic methods codegen

Aras Pranckevicius aras at unity3d.com
Tue Apr 8 05:51:52 EDT 2008


We have a problem in that when Data Execution Prevention (DEP) on
Windows XP/Vista is on, some Mono scripts can't be executed.

When debugging the thing, it looks like sometimes mono-codeman
allocates memory through raw malloc instead of VirtualAlloc with
proper execute flags. Specifically for "dynamic" methods new_codechunk
in mono-codeman.c uses CODE_FLAG_MALLOC flag.

If I make new_codechunk always use CODE_FLAG_MMAP flag, the scripts
that were problematic under DEP start working properly. But I don't
know which methods have "dynamic" flag in Mono, and what implications
that change might have. Any ideas on how to make it properly?

Aras Pranckevičius
work: http://unity3d.com
home: http://aras-p.info

More information about the Mono-devel-list mailing list