[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Strange crash when calling lua_call()
- From: Alberto Fabiano <alberto@...>
- Date: Mon, 8 Apr 2013 20:01:09 -0300
On Apr 8, 2013 3:50 AM, "Satz Klauer" <email@example.com
I have some C-code, that connects LUA to an existing application.
There are some new LUA-functions defined and announced via
lua_register() so that a user can call into the application out of its
Beside of that the user can define a callback function within
LUA-script that can be called out of the application asynchronously,
means out of an own thread. Here the C-code fetches the function by
calling lua_getfield(), builds up the parameters of this function to
be called via lua_pushxxx() and then calls lua_call() - which
My first idea: it is a threading/race condition problem, so I
encapsulated all LUA-to-C-functions and the C-to-LUA-callback with one
mutex. So now calling form LUA to my C-code and constructing the call
from my C-code back to LUA is done exclusively, none of these calls
can overlap anymore.
Unfortunately the same crash still happens. It can't be reproduced
easily, it happens only from time to time.
Any ideas what could be wrong?