Re: LuaJIT Crash When Returning Null Pointer from FFI

  • From: Mike Pall <mike-1407@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 17 Jul 2014 12:21:29 +0200

Jim Burnes wrote:
> In any case the print statement never actually executes.  It appears to be
> crashing in the assembly code that interfaces back into the Lua program
> (FFI code I'm guessing).

Well, a *complete* self-contained example would help. Not some
snippets taken out of context. Simply by the process of reducing
it to that, one often finds the problem.

Returning a NULL pointer is fine, as well as printing it (it'll
print as: cdata<...>: NULL).

Also, build LuaJIT with debug symbols enabled, otherwise the
debugger output isn't very useful.

--Mike

Other related posts: