-
Notifications
You must be signed in to change notification settings - Fork 2k
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
lua incompatibility issue with latest Nginx version 1.24 #2218
Comments
The latest release of openresty is 1.21.4.2. You can use https://xray.openresty.com to get more info from the core dump file. |
As per lua community update(e2d0505) lua version is supporting latest Nginx v1.25+. So we tried with Nginx v1.25.1 but still we are seeing the same issue(worker process <process_number>exited on signal 11 (core dumped)) . Nginx Version - 1.25.1 Any help related to this issue? |
@AnitaThakur671 we need a minimal config that can reproduce this problem. |
@zhuizhuhaomeng Hello! I have met the same issue. I believe.
Dockerfile:
To build the test image: docker build -t nginx-test-lua -f Dockerfile . After building this image you can just run this sequence of commands to reproduce the problem.
docker run --rm --name nginx-test-lua -p 8080:80 -tid nginx-test-lua;
for i in $(seq 10); do curl localhost:8080/test/\?a=1; done;
docker exec nginx-test-lua nginx -s reload; sleep 2;
for i in $(seq 10); do curl localhost:8080/test/\?a=1 ; done
docker exec nginx-test-lua nginx -s reload; sleep 2;
for i in $(seq 10); do curl localhost:8080/test/\?a=1 ; done
docker logs nginx-test-lua | grep "signal 11";
docker stop nginx-test-lua My stdout for this command ⬆️ as an example:
Also maybe this link will be helpful - https://trac.nginx.org/nginx/ticket/2521. |
@danilutkin Thanks for your information. I have successfully reproduced this crash. While attempting to fix this bug, I discovered that someone has already raised a PR and resolved the issue (#2177). However, the lua-nginx-module-0.10.25 version does not include the bugfix. Perhaps you can try using the lua-nginx-module master branch to resolve this issue. |
Will this fix work(using the lua-nginx-module master branch) with Nginx v1.24.0 as well? |
Based on the information available at #2177, it appears that a Nginx version higher than 1.24.0 is required. Therefore, the answer is negative. Currently, OpenResty has extended support for Nginx version 1.25.1, making it a suitable choice for this issue. |
@swananan could you please explain me what is the issue? The #2177 seems to be included in 0.10.25 and lua should be able to handle "new style" variables. I'm happy to provide a fix (or, say, a better fix) i just don't quite understand the problem =) |
Hi @oxpa , v0.10.25 branch doesn't include #2177, which might seem a bit unusual, but it's true, and I am not familiar with lua-nginx-module release plan either. |
@swananan i think there is slight misunderstanding here. I'll have another go at #2182 then. |
Hi @oxpa . The crash mentioned in this issue has been resolved by #2177. However, it was also noted in #2177 that another memory overrun case needed attention. In my opition, this memory overrun case was addressed in https://hg.nginx.org/nginx/rev/b71e69247483. I guess I may have some misunderstanding here. I took a look at #2182, but I didn't quite get the point. It appears that ngx_http_variable_headers_internal iterates through the linked list, so inserting into either the tail or the header should be acceptable. Could you please provide more details regarding the specific issue that #2182 aims to address? Thank you! |
I looked through commits again and I think I'm wrong and the patch is, indeed, not included nor in 0.10.24 nor in 0.10.25. I'm truly surprised. ngx_http_variable_headers_internal would iterate over a list adding a separator and a space each time it adds a value. Anyways, #2182 indeed is not related to this issue. Also, if #2177 is not merged into lua then nginx should be pre 1.23.0. Nginx 1.23.0, afaik, introduces lists of headers which break lua. But as we saw previously - I can be wrong so don't hesitate to correct me ;) Kind regards. |
Oh, I understand now. #2182 changes the insertion from the head to the tail to address the memory overrun issue, and that makes sense. I didn't realize this because I saw that Nginx had already resolved this problem. Thanks for your explanation! |
Possibly a bug with nginx, there were some segfault fixes in 1.25.4 release: https://nginx.org/en/CHANGES openresty/lua-nginx-module#2218 Signed-off-by: Alex Kalenyuk <[email protected]>
* Rollback nginx from 1.24.0->1.22.1 to avoid segfaults when pulling https Possibly a bug with nginx, there were some segfault fixes in 1.25.4 release: https://nginx.org/en/CHANGES openresty/lua-nginx-module#2218 Signed-off-by: Alex Kalenyuk <[email protected]> * Run make rpm-deps to udpate dependencies for all arches Ensure the dependencies are up to date so we can easily merge with s390x PRs in the future. Signed-off-by: Alex Kalenyuk <[email protected]> --------- Signed-off-by: Alex Kalenyuk <[email protected]> Co-authored-by: Alex Kalenyuk <[email protected]>
* Rollback nginx from 1.24.0->1.22.1 to avoid segfaults when pulling https Possibly a bug with nginx, there were some segfault fixes in 1.25.4 release: https://nginx.org/en/CHANGES openresty/lua-nginx-module#2218 Signed-off-by: Alex Kalenyuk <[email protected]> * Run make rpm-deps to udpate dependencies for all arches Ensure the dependencies are up to date so we can easily merge with s390x PRs in the future. Signed-off-by: Alex Kalenyuk <[email protected]> --------- Signed-off-by: Alex Kalenyuk <[email protected]> Co-authored-by: Alex Kalenyuk <[email protected]>
* Rollback nginx from 1.24.0->1.22.1 to avoid segfaults when pulling https Possibly a bug with nginx, there were some segfault fixes in 1.25.4 release: https://nginx.org/en/CHANGES openresty/lua-nginx-module#2218 Signed-off-by: Alex Kalenyuk <[email protected]> * Run make rpm-deps to udpate dependencies for all arches Ensure the dependencies are up to date so we can easily merge with s390x PRs in the future. Signed-off-by: Alex Kalenyuk <[email protected]> --------- Signed-off-by: Alex Kalenyuk <[email protected]> Co-authored-by: Alex Kalenyuk <[email protected]>
Hi team,
We are trying to upgrade Nginx version from v1.22 to v.124 and facing compatibility issues with lua version.
After Nginx version upgrade to v1.24 it keeps crashing with errors like this:
|LOG_LINE| 26/Jul/2023:12:43:22 +0000 [edge.access.marriott_default:-:REQUEST ID=] { host: "10.221.70.200", remote_addr: "10.221.70.1", request: "GET /healthCheck HTTP/1.1", status: 200, referer: "-", request_time: 0.000, connection: "1342", connection_requests: "1", location: "", upstream_location_response: "-", bytes_sent: "247", client_ip: "-", x_dynaTrace: "-" }
2023/07/26 12:43:22 [alert] 184#0: worker process 201 exited on signal 11 (core dumped)
|LOG_LINE| 26/Jul/2023:12:43:32 +0000 [edge.access.marriott_default:-:REQUEST ID=] { host: "10.221.70.200", remote_addr: "10.221.70.1", request: "GET /healthCheck HTTP/1.1", status: 200, referer: "-", request_time: 0.000, connection: "1344", connection_requests: "1", location: "", upstream_location_response: "-", bytes_sent: "247", client_ip: "-", x_dynaTrace: "-" }
2023/07/26 12:43:25 [alert] 184#0: worker process 198 exited on signal 9
Suspecting this to be a lua issue, we have tried different versions of lua, but to no avail.
Following table shows key combinations we have tried:
nginx lua-nginx-module resty core status
1.24.0 0.10.22 v.0.1.24 not working
1.24.0 0.10.23 v0.1.25 not working
1.24.0 0.10.24 v0.1.25 not working
1.24.0 0.10.24 v0.1.26 not working
We also tried to analyze the core files which are dumped into the working directory of Nginx and we are getting the
below errors -
Core was generated by `nginx: worker process'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 ngx_http_variable_headers_internal (r=0x1f414a0, v=0x1f42990, data=, sep=sep@entry=44 ',') at src/http/ngx_http_variables.c:840
840 src/http/ngx_http_variables.c: No such file or directory.
Ensure you have provided the following details while reporting a problem:
Due to this issue we are blocked from upgrading Nginx version.
requesting help to resolve this issue.
Thanks.
The text was updated successfully, but these errors were encountered: