[Cuis-dev] VM crash when trying to interface to LuaJIT (Access Violation Exception)

Michał Olszewski m.olszewski at nexat.pl
Fri Jun 11 08:44:01 PDT 2021


Hello,

I'm new to the list. I've been messing for some time with Squeak but I 
found it too bloated, so I decided to switch to Cuis since it's "lean 
and mean" and this really helps learning Smalltalk (or anything in 
general...). I'm having my own goals and for this I need to interface to 
Lua, specifically LuaJIT.

The problem is that VM crashes, with Access Violation Exception, when it 
tries to create new Lua state via FFI. It seems like it only happens 
when I call it from Cuis. I tested it by compiling standalone C 
application with the call and it works fine.

I'm invoking 'luaL_newstate' via FFI's ExternalLibraryFunction, not via 
pragma send. The prototype that appears in debugger is: 'cdecl: 
CLuaState* 'luaL_newstate'() module: 'lua51'. "CLuaState" is the dummy 
struct representing "lua_State".

Some extra info: OS is Windows 8 64 bit; VM, image and lua51.dll is 64 
bit; DLL has been compiled using MSVC via vcpkg package manager (maybe 
it's the compiler's issue?).

I could attach crash dump but I'm not sure if it will be any helpful.

I wrote a bit too long post but I tried to provide as much info as 
possible.



More information about the Cuis-dev mailing list