[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT2 crashes with luabind or wxLua
- From: Mike Pall <mikelu-1004@...>
- Date: Fri, 16 Apr 2010 20:17:57 +0200
John Labenski wrote:
> On Thu, Apr 15, 2010 at 8:17 AM, Mike Pall <mikelu-1004@mike.de> wrote:
> > Yang Fan wrote:
> >> Also I found wxLua's class member methods working with LuaJIT2
> >> have the same problem.
> >
> > As far as I could glean from the sources, it throws Lua errors deep
> > inside some C++ mess. Might be a similar issue.
>
> wxLua should only call luaL_error() from within C callbacks from Lua.
> When the Lua program is first executed you are running it from a C++
> wxApp class member function and when it is idle you are sitting in a
> C++ event loop which may call your Lua callback functions that may
> call luaL_error(). wxLua does not use any C++ try/catch/exceptions
> anywhere nor does wxWidgets.
But maybe you're using RAII? In any case, MSVC happily added SEH
handlers for thousands of C++ functions inside wxlua.exe
(disassemble it and count around 18000 uses of "fs:").
If you're using this with plain Lua (longjmp-style unwinding) and
_any_ of these functions throws a Lua error, the SEH chain gets
corrupted. Are you 100% sure this cannot happen? :-)
--Mike