在EulerOS aarch64系统中,执行lua脚本报 bad light userdata pointer错误。
OpenResty中1.15.8.1,1.15.8.2,1.17.8.2版本全试过了,都不行,且只在EulerOS下面出现这个问题。

在nginx.conf中引入了如下内容
lua_package_path "/usr/local/openresty/nginx/extends/?.lua;;";
lua_package_cpath "/usr/local/openresty/lualib/?.so;;";
init_by_lua_file "/usr/local/openresty/nginx/extends/proxy_init.lua";

其中proxy_init.lua文件内容如下

  1. local fun, err = package.loadlib('libgsluaport51.so','luaopen_kernel')
  2. if err ~= nil then
  3. print("=== init so failed, err = ", err)
  4. end
  5. if fun == nil then
  6. print("=== fun is nil")
  7. end
  8. print(type(fun))
  9. fun()
  10. local result, errMsg = fun()
  11. print("=== fun result = ", result, ", errMsg = ", errMsg)
  12. print("GsKernel_Version ",kernel.GsKernel.Version())

在启动nginx的时候就报错了
nginx: [error] init_by_lua_file error: bad light userdata pointer
stack traceback:
[C]: in function 'fun'
/usr/local/openresty/nginx/extends/proxy_init.lua:9: in main chunk

使用lua proxy_init.lua执行没有问题,使用luajit proxy_init.lua执行也报同样的错误
当前操作系统是Linux b6f86775949b 4.19.36-vhulk1907.1.0.h748.eulerosv2r8.aarch64 #1 SMP Thu May 14 16:41:16 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

其他的操作系统不存在这样的问题。
在Linux host-172-15-103-118 4.18.0-147.el8.x86_64 #1 SMP Wed Dec 4 21:51:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux下正常启动nginx

这样的问题该怎么解决?小白求助

  • feng replied to this.

    feng 谢谢你的回答,使用1.19.3.1rc0版本后恢复正常,可以在ARM64上正常使用了

      Write a Reply...