this post was submitted on 23 Oct 2026
447 points (98.7% liked)
Technology
89964 readers
3293 users here now
This is a most excellent place for technology news and articles.
Our Rules
- Follow the lemmy.world rules.
- Only tech related news or articles.
- Be excellent to each other!
- Mod approved content bots can post up to 10 articles per day.
- Threads asking for personal tech support may be deleted.
- Politics threads may be removed.
- No memes allowed as posts, OK to post as comments.
- Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
- Check for duplicates before posting, duplicates may be removed
- Accounts 7 days and younger will have their posts automatically removed.
Approved Bots
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Depends on how you handle the OOM error though, aborting the process is fine while "try to recover and continue" is the problem.
In lua you will typically lua_pcall() the entry function written in Lua, but it will often call back into your C functions to do various tasks. Now if your C functions do anything with the lua stack, that might cause OOM, but now your lua_pcall() will catch that - or any sort of error catching inside Lua itself - and you'll be looking at an accidental recovery situation.
At least that was how things looked like when I last poked around Lua a few months ago.
So as far as I know, it's actually not trivial to make Lua safely abort on OOM, and it's not the default behavior. I also don't think there are lua_push* function alternatives available using the default C API that don't longjmp in a likely often unsafe manner out of your C code if you use them and you hit OOM.
Summed up, I would expect many Lua integrations to have the same problem.