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

Cannot load incompatible bytecode (compiling bytecode with luajit) #61

Open
Source61 opened this issue Feb 27, 2023 · 1 comment
Open

Comments

@Source61
Copy link

Steps to reproduce (include any configuration/script required to reproduce)

  1. Compile otclient
  2. Compile a lua module such as /modules/corelib/math.lua to bytecode using LATEST LuaJIT version
  3. Run otclient and check otclient.log

Expected behaviour

Should run without an issue

Actual behaviour

Complains about incompatible bytecode and exits.

Environment

Windows 10 with Debian 12 WSL.
Modified OTClient version from 2-3 years ago. Never touched src/framework/luaengine/*.
Should be the latest version, 0.6.6.
The issue seems to have started happening after I upgraded all the software on the WSL one day about 6-9 months ago and likely LuaJIT was upgraded as well, never had this issue before and been using LuaJIT compilation for years.
I've also tried upgrading to the most recent LuaJIT (and all other) vcpkg libraries to no avail.

This issue incidentally happened around the same time (9 months ago) neovim/neovim#18169
https://stackoverflow.com/questions/72875661/i-got-this-error-after-upgrading-neovim-to-version-0-7-2-2

@Erza
Copy link

Erza commented Feb 27, 2023

LuaJIT bytecode is not guaranteed to have compatibility between versions, even if it's just minor version differences, like for example LuaJIT 2.0.5 and 2.1.0. It should be generated & ran with identical versions or you are most likely going to get errors like this.

Your problem is probably here

Modified OTClient version from 2-3 years ago

might be linked with an older version, or your bytecode was generated with an older version

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