New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: stack corruption with pcalls #704
Comments
Repetition steps (Ubuntu 20.04): # build LuaJIT
cd ~
git clone https://github.com/LuaJIT/LuaJIT
cd ~/LuaJIT/
git checkout v2.1
make
# download test lua files
cd ~/LuaJIT
wget https://sharex.thevacuumof.space/2021/05/luajit-bug.tar.gz
tar -zxvf luajit-bug.tar.gz
# build lpeg
cd ~/LuaJIT
wget http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz
tar -zxvf lpeg-1.0.2.tar.gz
cd ~/LuaJIT/lpeg-1.0.2
make LUADIR=../src/
# set LUA_CPATH
cd ~/LuaJIT/lpeg-1.0.2
export LUA_CPATH="./?.so;/usr/local/lib/lua/5.3/?.so;/usr/local/share/lua/5.3/?.so;$(pwd)/?.so"
echo $LUA_CPATH
# rpetition error
cd ~/LuaJIT/luajit-bug
~/LuaJIT/src/luajit json-decode-test.lua System version:
|
Fixed. Thanks! Oh my ... that sent me down a rabbit hole. The issue happens with |
Thanks a bunch! |
Originally reported at TypesettingTools/Aegisub#116
Calling LuaJSON's decode function on Linux via pcall with a trivial JSON file eventually produces a failure like the following:
Bisecting indicates this is caused by a32aead, testing with ddd0fd8 works correctly. HEAD in v2.1 still exhibits the issue as of today. I couldn't get this to work on anything other than Linux, but it works on both Ubuntu 20.04 and Arch.
Repro here: https://sharex.thevacuumof.space/2021/05/luajit-bug.tar.gz
Unfortunately, this isn't exactly a minimal repro since I didn't have much luck simplifying the LuaJSON portion. It also relies on lpeg being somewhere on your system to work. If you need something simpler I can take another swing at it, but I'm hoping that knowing the exact commit responsible for the regression will make this doable as-is.
The text was updated successfully, but these errors were encountered: