Re: Static lib and lua5.1.dll (crash on lua_close_())
Kristoffer Danielsson <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
Beware of _SECURE_SCL=0 setting! http://msdn.microsoft.com/en-us/library/aa985896(VS.80).aspx > From: [email protected] > To: [email protected] > Date: Tue, 18 May 2010 07:28:24 +1200 > Subject: Re: [luabind] Static lib and lua5.1.dll (crash on lua_close_()) > > I was about to suggest that your Lua dll and luabind/your program might > be using differing versions of the CRT, but if you have made sure the > compiler settings for each are identical, that is probably not the case. > > You could always try using Lua as a static lib perhaps. Even just to > see if it fixes your bug. It's as easy as dropping most of the Lua > source into your project. > > Nigel > > On Mon, 2010-05-17 at 11:48 -0500, Mark Mruss wrote: > > Hi Kristoffer, > > > > Yes this is a multi-threaded application, in reality there is only one > > main thread and there should only be one instance of the lua runtime. > > (shared dll) > > > > I'm actually using luabind in a dll that will be loaded by my main > > application. I've tried to set all of the compile settings so that the > > luabind.lib matches the compile settings that I used to compile lua, > > but so far all I get are crashes. > > > > I can load lua dll modules without any problems so I think that using > > luabind in a dll should work. > > > > mark. > > > > On Fri, May 14, 2010 at 3:57 PM, Kristoffer Danielsson > > <[email protected]> wrote: > > > Just guessing here, but is this a multi-threaded application? Really weird > > > crashes might occur if lua is used erroneously in a multithreaded > > > application. > > > > > >> Date: Fri, 14 May 2010 15:54:17 -0500 > > >> From: [email protected] > > >> To: [email protected] > > >> Subject: Re: [luabind] Static lib and lua5.1.dll (crash on lua_close_()) > > >> > > >> Hi Everyone, > > >> > > >> I'm not sure that there is anyone else around as I haven't had a > > >> response to any of my last three emails but this is where the crash is > > >> coming from: > > >> > > >> In: > > >> > > >> LUA_API void lua_close (lua_State *L) { > > >> > > >> The line: > > >> > > >> while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); > > >> > > >> Which (after drilling all the way down) get to: > > >> > > >> int luaD_precall (lua_State *L, StkId func, int nresults) { > > >> > > >> And then the crash seems to happen around: > > >> > > >> lua_unlock(L); > > >> n = (*curr_func(L)->c.f)(L); /* do the actual call */ > > >> > > >> Does this seem familiar to anyone else? Does anyone have any ideas > > >> about this crash and how it relates to laubind? > > >> > > >> If I do not open luabind then the crash does not happen. > > >> > > >> Thanks (if there is anyone out there), > > >> > > >> mark. > > >> > > >> > > >> > > >> On Sun, May 9, 2010 at 7:56 AM, Mark Mruss <[email protected]> wrote: > > >> > Hi Everyone, > > >> > > > >> > I asked this in a separate email, but I thought that it might get more > > >> > traction if I ask it by itself. > > >> > > > >> > Does anyone know what the bjam commands would be to compile luabind as > > >> > a static library that links against the lua dll? > > >> > > > >> > I'm getting a crashe on lua_close() and it smells like the crashes > > >> > that one gets when there are two instances of the lua runtime being > > >> > used. > > >> > > > >> > I can get my application to crash as long as I call: > > >> > > > >> > luabind::open(pLuaState); > > >> > > > >> > luabind appears to be working, but when the program closes I always > > >> > get a crash, whether I bind to any of my C++ or not (as long as I have > > >> > the above call). > > >> > > > >> > I'm using the following in a bat file to compile luabind: > > >> > > > >> > "C:\Program Files\boost\boost_1_42\bin\bjam.exe" -d+02 > > >> > toolset=msvc-9.0 runtime-link=static link=static threading=multi > > >> > --debug-build define=LUA_BUILD_AS_DLL define=_MBCS > > >> > > > >> > Am I crazy? Am I doing something wrong? Any help would be appreciated > > >> > as I would like to use luabind but I keep running into road blocks. > > >> > > > >> > mark. > > >> > > > >> > > >> > > >> ------------------------------------------------------------------------------ > > >> > > >> _______________________________________________ > > >> luabind-user mailing list > > >> [email protected] > > >> https://lists.sourceforge.net/lists/listinfo/luabind-user > > > > > > ________________________________ > > > Chatta från inkorgen. Se möjligheterna med Hotmail! Klicka här! > > > ------------------------------------------------------------------------------ > > > > > > > > > _______________________________________________ > > > luabind-user mailing list > > > [email protected] > > > https://lists.sourceforge.net/lists/listinfo/luabind-user > > > > > > > > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > > luabind-user mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/luabind-user > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > luabind-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/luabind-user _________________________________________________________________ Klicka här! http://new.windowslivemobile.msn.com/SE-SE/windows-live-hotmail/default.aspx ------------------------------------------------------------------------------ _______________________________________________ luabind-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luabind-user