-
Notifications
You must be signed in to change notification settings - Fork 113
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
_G write guard whines about zlib being global and could cause race conditions #48
Comments
Maybe because we use the old https://github.com/brimworks/lua-zlib/blob/master/lua_zlib.c#L1263 Feel free to issue a pull request if this change fixes your issue. Thanks! |
I had the same issue and could fix it by replacing the lua_newtable(L);
luaL_setfuncs(L, zlib_functions, 0); It works when importing from openresty (luajit), but not from standalone Lua 5.1 |
Perhaps a little "macro magic" could solve this problem? Pull requests are welcomed :). |
I had the same issue with lua-zlib-1.2 |
If you use OpenResty, maybe can refer to this openresty/openresty#510 as a workaround. |
when I do this
nginx error log would show:
[warn] 30914#30914: *24397 [lua] _G write guard:12: writing a global lua variable ('zlib') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
stack traceback:
[C]: at 0x7f165255b755
[C]: in function 'require'
any light ?
The text was updated successfully, but these errors were encountered: