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

Crash on startup "invalid escape sequence" when using LuaJIT #15

Open
OgelGames opened this issue Nov 9, 2020 · 5 comments
Open

Crash on startup "invalid escape sequence" when using LuaJIT #15

OgelGames opened this issue Nov 9, 2020 · 5 comments

Comments

@OgelGames
Copy link

2020-11-09 21:14:21: ERROR[Main]: ModError: Failed to load and run script from ...\worldmods\inspector\init.lua:
2020-11-09 21:14:21: ERROR[Main]: ...\worldmods\inspector\init.lua:56: invalid escape sequence near '"'

I cannot find what changed to cause this, but I was able to get it to work by replacing the escapes (\u{2007} and \u{253c}) on these lines with spaces:

local padding = string.rep("\u{2007}", maxDigits - valueStr:len())

local shapeDesc = {"X","\u{253c}","*","#","#","?unknown?","?unknown?","?unknown?"}

@BuckarooBanzay
Copy link
Member

Interesting, this is on startup, right?
This may be caused by a platform issue, i had no trouble with the latest -dev version and linux 😕
something, something, windows-encoding-issue perhaps?
Also: lua/luajit-version?

@OgelGames
Copy link
Author

Interesting, this is on startup, right?

Yes, I can't start without making the above changes.

This may be caused by a platform issue, i had no trouble with the latest -dev version and linux 😕
something, something, windows-encoding-issue perhaps?

Well I do use Windows (10), so possibly.

Also: lua/luajit-version?

Lua 5.1, LuaJIT 2.0.5.

@BuckarooBanzay
Copy link
Member

Lua 5.1, LuaJIT 2.0.5.

I found this statement here (luapower/ui0#2)

Unicode escape sequences were added in LuaJIT 2.1. Seems like you're using LuaJIT 2.0. Either convert the code or use the latest LuaJIT.

looks like the problem is "just" the old luajit version

@OgelGames
Copy link
Author

looks like the problem is "just" the old luajit version

Hmm... I was sure it was working fine with MT 5.3.0, maybe I somehow only used the official build back then... I'll try updating and rebuilding MT tommorow.

@OgelGames OgelGames changed the title Crash in 5.4.0-dev Crash on startup "invalid escape sequence" when using LuaJIT Dec 2, 2020
@OgelGames
Copy link
Author

I couldn't work out how to change LuaJIT to the latest version, but I did try compiling without LuaJIT and it worked fine, so that seems to be what is causing this error. (I compiled the stable-5 branch of Minetest with LuaJIT and it had the same problem)

I also found the reason that I had LuaJIT 2.0.5 is because that is the stable version (2.1 is beta) that vcpkg installs: https://github.com/microsoft/vcpkg/blob/master/ports/luajit/CONTROL#L2

So if Minetest does require LuaJIT 2.1, then shouldn't be mentioned in the compiling section of the readme? https://github.com/minetest/minetest#a-using-vcpkg-to-install-dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants