lua-users home
lua-l archive

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


PS: Maybe you mean Calling a "Lua service function variable", which
meanwhile does not exit any more/ has been collected by GC?

(I have this problem a bit with communication DMA from Lua strings, in
tasks with restricted runtime... in this case you have to tell the Lua
user, that it is important the Lua string (and so its task) will
"live" as long as DMA / communication process is running. Otherwise
"stupid stuff" would be communicated... . So if your C code somehow
assumes that Lua function pointers reside stable at some memory
address, but this memory range has been stripped by GC / used for
something else meanwhile, then of course the C application could crash
I think...).

...

Am Sa., 3. Dez. 2022 um 07:30 Uhr schrieb bil til <biltil52@gmail.com>:
>
> Am Fr., 2. Dez. 2022 um 19:41 Uhr schrieb Aleksandr Zenkov
> <webmaster@feardc.net>:
>
> Thank you for detail infos , sounds like an interesting and
> challenging "coroutine/threading" application.
>
> > So my next question is.. What type of security change was made in Lua
> > 5.4.3 to start panicking once a C++ code tried to call a piece of Lua
> > code that does not exist? I mean, such a security checks never existed
>
> But can you explain in more detail, how a user could try to "call a
> piece of Lua that does not exist"?
>
> You mean, run to the end of the main program by some label ::End::, as
> e. g. "goto End", and then Lua finished and somehow "runs into
> Nirwana"?
>
> Or you mean, invoking some C function from Lua, and this C function
> then would invoke Lua Code which does not exist / possibly mixing up
> the Lua stack? (but in this case you usually can be happy if such a
> panic message would appear I think...)