This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] w32 callbacks w/DEP enabled [ping]


2nd send:

When Data Execution Protection (DEP) is enabled, w32 callback memory must be allocated via VirtualAlloc, with the execution bit set. Otherwise access violation exceptions are thrown when the callback trampoline instructions are executed. I switch some local code over to ffi_closure_alloc thinking this was working (since the appropriate code is in dlmalloc already). Turns out none of it is being used, so I wound up with a bunch of crashing tests.

This patch enables the right bits when building for windows.

I notice that the mmap (vs vanilla malloc) stuff is otherwise only enabled for linux; it should probably be part of the configury to detect whether the mmap stuff is required or might be required on a particular platform.

Attachment: diff.txt
Description: Text document



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]