[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: "*toclose" vs. sandboxes / embedded environments
- From: Andrew Gierth <andrew@...>
- Date: Mon, 17 Dec 2018 17:15:14 +0000
>>>>> "Soni" == Soni \"They/Them\" L <email@example.com> writes:
>> I'm not sure that helps. It certainly presents a problem of how to
>> unwind the C stack safely, especially in the case where Lua code has
>> called a C function that calls a Lua callback.
Soni> where you'd use pcall/error you use coroutine.create+pcallk/yield
Soni> instead. when it yields, throw it away, and you never(?) run the
Soni> toclose that way.
But even that is a whole lot of extra bookkeeping - for example I would
then have to know, for each thread, whether it is inside a pcall()
(since in that case I really do still need to throw the error). It would
probably (I haven't worked it all out) also mean either disabling access
to coroutine.create from the Lua code, or wrapping it in order to keep
track of new threads.