sandbox doesn't know this Lua version
Hello,
I am having the problem that I cannot start a game. Once I choose the race and role, I get an error box saying Oops. Right after that, I get a second error box saying:
Program initialization has failed
Report error to 'wizard'
sandbox doesn't know this Lua version: this = 50406 != expected 50404
This happens both with the downloaded binaries or after compiling it myself.
If you apply Nethack/Nethack@b35d8a34ede0adf4c4154984226ad3fc27860d84 you should be able to compile and run it without this issue. You could also remove the NHL_SANDBOX define in config.h I guess, though it's probably safer to do it the other way since you'd lose whatever protection the sandbox is meant to offer (I think it's supposed to prevent malicious execution of something or other from lua files).
But I'm a little confused because looking at the Makefile it seems like it should be specifically downloading and using Lua 5.4.4 instead of 5.4.6 -- do you have a lib/lua-5.4.6 directory in the repo? (Or maybe it's using the system Lua version?)
Thanks for your reply. I will apply the patch and see if it works. I forgot to mention I am compiling it in Windows using VS 2022. Perhaps that might be relevant.
I do not have a lib folder, but I just checked under submodules/lua/lua.h and it is indeed version 5.4.6. In the file, it reads:
#define LUA_VERSION_MAJOR_N 5
#define LUA_VERSION_MINOR_N 4
#define LUA_VERSION_RELEASE_N 6
That does help; it seems like the Windows build (at least the recommended way to build it from the text files) uses a git submodule instead of downloading the specified lua version directly. NetHack/NetHack@b4f3a0fac292848d8ee414c3abc37928d6a638af updated the submodule to point to 5.4.6 but the "this is the expected version" code was only updated two weeks later with the commit I mentioned. I think xnethack merged the upstream code at some point between the two, so anyone using that git submodule will have this problem. It should be fixed with the next vanilla merge, at the latest, and in the meantime applying NetHack/NetHack@b35d8a34ede0adf4c4154984226ad3fc27860d84 manually should fix it. [You could also follow the alternate "Via zip download" instructions in sys/windows/Install.windows which avoid the submodule, though I think it may miss another couple VScode-specific submodules/ references that would need changing in sys/windows/vs/dirs.props.] I don't have any write permissions on the repo so @copperwater will have to figure out what to do when he's around (I would think at least the Windows binaries should be removed until a fix is in place, if they have this issue).
By the way, someone previously reported the Windows tiles version was crashing on startup (#95) -- if that's what you're building, keep an eye out for that and please report back if that happens to you too. If you run into it and you've also built NetHack-3.7 on your system it'd be helpful to know if the same thing is happening there.
Ah great! I'm glad to hear my error helped you to identify a problem! It seems it'll solve itself soon. Thanks again for the help.
I also agree that it's a good idea to remove the windows binaries until the issue is fixed. At the moment they are broken.