vipergc opened a new issue #7960:
URL: https://github.com/apache/trafficserver/issues/7960


   My environment is Lua-5.4.2 Luasocket-3.0-rc1, when I direct run lua script, 
it work success. When i run it within c language, 
   
   Error Msg is :
   PANIC: unprotected error in call to Lua API (error running script: error 
loading module 'socket.core' from file '/usr/local/lib/lua/5.4/socket/core.so': 
 undefined symbol: lua_gettop)
   Aborted(core dumped)
   
   Does anyone know why? 
   
   My code is follow:
   test.lua:
   #!/usr/local/bin/lua
   local socket = require("socket")
   print(socket._VERSION)
   
   main.c:
   int main(void)
   {
       lua_State *L;
       L = luaL_newstate();
       luaopen_base(L);
       luaL_openlibs(L);
   
       printf("lua enter\n");
       if (luaL_dofile(L, "test.lua"))
       {
           luaL_error(L, "error running script: %s", lua_tostring(L, -1));
       }
       printf("lua exit\n");
   
       while(1) pause();
       lua_close(L);
       return 0;
   }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to