Re: Sandbox causes hang!

Nigel Atkinson <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <1296477440.1760.0.camel@rincewind>
At a quick glance your 'foo' function looks like it might be calling
itself...

Nigel

On Mon, 2011-01-31 at 12:05 +0100, Kristoffer Danielsson wrote:
> Luabind 0.9.1 and Lua 5.1.4. Consider this sandbox code:
>  
> "load = nil\n
> loadfile = nil\n
> dofile = nil\n
> package.loadlib = nil\n
> package.loaders[3] = nil\n
> package.loaders[4] = nil\n
> package.path =
> 'C:/Users/Test/Desktop/MyApp/Scripts/?;C:/Users/Test/MyApp/Scripts/?.lua;C:/Users/Test/Desktop/MyApp/Scripts/'\n
> "
>  
> After executing that, I run this script (located in C:\Users\Test
> \Desktop\MyApp):
> require 'mylib.test' -- C:\Users\Test\Desktop\MyApp\mylib\test.lua
> does exist!
>  
> function foo()
>    return mylib.test.foo()
> end
>  
> Then I call "foo":
> luabind::call_function<string>(L, "foo");
>  
> The script that hangs! It seems to get stuck in the for-loop in
> lvm.c(385):
>  
> case OP_GETGLOBAL: {
> TValue g;
> TValue *rb = KBx(i);
> sethvalue(L, &g, cl->env);
> lua_assert(ttisstring(rb));
> Protect(luaV_gettable(L, &g, rb, ra)); // I keep getting here.
> Forever...
> continue;
> 
>  
> What's wrong with my sandbox code? If I remove the assignment of
> "package.path", it works! Also, the above seems to work for some
> scripts with the same logic. Don't get it...
>  
> Please help!
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
> February 28th, so secure your free ArcSight Logger TODAY! 
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________ luabind-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luabind-user



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.