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

Illegal instruction (core dumped) in aws ec2 #56

Open
guy-otonomo opened this issue Dec 6, 2022 · 2 comments
Open

Illegal instruction (core dumped) in aws ec2 #56

guy-otonomo opened this issue Dec 6, 2022 · 2 comments

Comments

@guy-otonomo
Copy link

bash-5.1# lua
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2020 Mike Pall. https://luajit.org/
JIT: ON SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
> json = require "rapidjson"
> print(json.encode({a=5}))
Illegal instruction (core dumped)
> uname -a
Linux 4e0e39d6702b 4.14.252-195.483.amzn2.x86_64 #1 SMP Mon Nov 1 20:58:46 UTC 2021 x86_64 Linux

Notes: we use rapidjson inside Kong.

  • kong:2.4.1-alpine (with cmake-3.15.5-r0): works.
  • kong:2.5.0-alpine (with cmake-3.21.3-r0): fails! (actually for any new version above 2.4.1).
  • When running in Docker on Mac, with cmake-3.21.3-r0: works.

Will be happy to provide any more info.

@xpol
Copy link
Owner

xpol commented Dec 7, 2022

I have no idea on that, but after a simple googling, I found this page maybe help:
https://groups.google.com/g/OpenResty/c/EC_ohjV5ROA

I think it's due to incorrect configuration flags passed when you compile the LuaJIT.
Have you tried loading other libraries?

And you can try to comment the SSE related lines
https://github.com/xpol/lua-rapidjson/blob/master/src/rapidjson.cpp#L10-L14

See if it helps.

@guy-otonomo
Copy link
Author

Well, not a simple search, because results are in Chinese 😅
Thanks for your help, it does seems to explain the issue (compiled version vs runtime version).
Other plugins seem to work OK BTW.

Commenting out those lines, should be done before building rapidjson, right? (we install it via luarocks, so this is going to be a hard one).
We should also try a machine in AWS that supports sse4_2.

Thanks again.

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