Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/modules/lua



Alexander Nasonov wrote:
> > +#define exit(EXIT_FAILURE) return
> 
> You only need to make a change in one place in ldo.c:
> 
> @@ -105,7 +110,11 @@ void luaD_throw (lua_State *L, int errco
>        lua_unlock(L);
>        G(L)->panic(L);
>      }
> +#if defined(_KERNEL)
> +    panic("luaD_throw(), errcode=%d", errcode);
> +#else
>      exit(EXIT_FAILURE);
> +#endif
>    }
>  }

I'm having a private discussion with Chris Badura about the above panic
call.

He made me realise that I assume that Lua kernel framework always
executes scripts in a protected environment (pcall or xpcall) but I
don't actually know whether it's the case. If it's not, than Lua script
can indeed panic the kernel.

On the other hand, ignoring it and continuing as if nothing happened is
even crazier idea.

We just need to make sure that all entry points to Lua are protected and
hope that the above panic will never trigger.

Alex


Home | Main Index | Thread Index | Old Index