-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Closed
Labels
Milestone
Description
If Lua throws an error inside app.transaction it is causing undefined behavior, eventually leading to segmentation fault.
It can be as simple as:
app.transaction(function()
assert(crash)
end)This causes a lot of random undefined behavior, mostly related to the undo history not working anymore or getting corrupted. Weird things can happen with selections too. If you continue in this state segmentation fault happens eventually.
It is possible to avoid it if you run your code inside a protected call like this:
app.transaction(function()
local status, err = pcall(function()
assert(crash)
end)
if status == false then
print(err)
end
end)In this case the error is printed and nothing breaks.
I am on Linux, but I've briefly tried this on Windows as well and observed exact same behavior.
Aseprite and System version
- Aseprite version: 1.3-beta-14-x64 (steam), 1.2.34.1-x64 (steam)
- System: archlinux 5.17.3-arch1-1
PureAsbestos and behreajj