luastate.call causes SIGSEGV error

Hi,

So I’m having trouble with calling a lua function from my java. What I’m trying to make is a listener that pool a state from my gamepad device every 50ms, so this is called periodically
 

luaState.pushInteger(keyState);  luaState.pushInteger(keyCode);  Log.d("Corona", "Calling callback LUA2");  luaState.call(2, 0); Log.d("Corona", "Finished Calling callback LUA");  

This actually works but after few minutes it’ll start to crash with the dreaded signal 11, code = 1 error.

Any idea why? I noticed that sigsegv error simply means bad address and the dump shows it happens on liblua.so

can you post a little bit more code? Not much to go on with what you have posted up there.

I’m interested in seeing the whole thing (how you are setting up the callback, what you are doing after luaState.call() etc.

Cheers.

not much on the code, the problem is already solved. Use asynchronous call to make sure it runs on runtime event rather than on activity thread.

Glad to hear you sorted it :slight_smile:

can you post a little bit more code? Not much to go on with what you have posted up there.

I’m interested in seeing the whole thing (how you are setting up the callback, what you are doing after luaState.call() etc.

Cheers.

not much on the code, the problem is already solved. Use asynchronous call to make sure it runs on runtime event rather than on activity thread.

Glad to hear you sorted it :slight_smile: