Skip to content
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

sandbox doesn't know this Lua version #198

Open
JuanCabre opened this issue Sep 12, 2023 · 4 comments
Open

sandbox doesn't know this Lua version #198

JuanCabre opened this issue Sep 12, 2023 · 4 comments
Labels
fixed-upstream Fixed in vanilla; will be fixed in xNetHack the next time vanilla is merged in..

Comments

@JuanCabre
Copy link

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.

@entrez
Copy link
Contributor

entrez commented Sep 12, 2023

If you apply NetHack/NetHack@b35d8a3 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?)

@JuanCabre
Copy link
Author

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

@entrez
Copy link
Contributor

entrez commented Sep 12, 2023

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@b4f3a0f 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@b35d8a3 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.

@JuanCabre
Copy link
Author

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.

@copperwater copperwater added the fixed-upstream Fixed in vanilla; will be fixed in xNetHack the next time vanilla is merged in.. label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-upstream Fixed in vanilla; will be fixed in xNetHack the next time vanilla is merged in..
Projects
None yet
Development

No branches or pull requests

3 participants