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

cjson.so: undefined symbol: lua_checkstack #117

Open
LordNoteworthy opened this issue Nov 2, 2024 · 2 comments
Open

cjson.so: undefined symbol: lua_checkstack #117

LordNoteworthy opened this issue Nov 2, 2024 · 2 comments

Comments

@LordNoteworthy
Copy link

LordNoteworthy commented Nov 2, 2024

Hello @aarzilli

Environment:

  • Golang: 1.23
  • Lua: 5.4.6
  • golua: last version

I am building a static go binary with the following command:

go build -tags "luaa lua54 yara_static" -o behavior-svc  cmd/behavior/behavior.go

Compilation works fine, except that when my Lua file try to require a module (require 'rapidjson' or lua-cjson that I installed via luarocks, it fails with:

{"level":"error","ts":1730523563.6323617,"caller":"behavior/behavior.go:41","msg":"failed to run the server: error loading module 'cjson' from file 'cjson.so' undefined symbol: lua_checkstack",}

Running the lua script though lua interpreter directly works fine.

Do you know why this is failing ?

Cheers.

@aarzilli
Copy link
Owner

aarzilli commented Nov 2, 2024

Presumably the linker is picking up a static build of lua (as in libluasomething.a).

@LordNoteworthy
Copy link
Author

LordNoteworthy commented Nov 2, 2024

Just some context: It used to work in go v1.20, when I upgraded to v1.23, I started seeing this issue.

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