lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Turns out it was my fault after all, I forgot about the NX bit! I was
allocating memory for the callback trampolines with lua_newuserdata,
which uses malloc, which allocates on a page without execute
permission... I took a trampoline allocator from Python ctypes that
uses mmap behind the scenes and now it works.

I uploaded a new rockspec and updated http://alien.luaforge.net. The
version got bumped to 0.3.2. Sorry for the noise. :-) I forgot I had
ssh access to a x64 machine, or would have tested on it too.

--
Fabio Mascarenhas

On Feb 13, 2008 6:35 AM, Thomas Harning <harningt@gmail.com> wrote:
> Fabio Mascarenhas wrote:
> Just a note: on AMD64 it appears that test_libc.lua works.
> The normal tests do not, though... it segfaults @ _testfunc_callback_i_if ()
>
> BT:
> #0  0x00000000005157e8 in ?? ()
> #1  0x00002ae74fc98544 in _testfunc_callback_i_if (value=262144,
> func=0x5157e8)
>     at tests/alientest.c:155
> #2  0x00002ae74f88fbe0 in ffi_call_unix64 () from
> /usr/local/lib/lua/5.1/alien.so
> #3  0x00002ae74f88f629 in ffi_call (cif=0x7fff5b247810,
>     fn=0x2ae74fc98530 <_testfunc_callback_i_if>, rvalue=0x7fff5b24784c,
>     avalue=0x7fff5b2477a0) at src/x86/ffi64.c:428
> #4  0x00002ae74f88e74b in alien_function_call () from
> /usr/local/lib/lua/5.1/alien.so
>
>
> Tried tracking it down to make sense of it...  it almost looks like the
> function address is being truncated to 32-bits...
>