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

bug: correct offset vector memory allocation size for PCRE2 #11019

Open
GithubCopilotX opened this issue Mar 9, 2024 · 4 comments
Open

bug: correct offset vector memory allocation size for PCRE2 #11019

GithubCopilotX opened this issue Mar 9, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@GithubCopilotX
Copy link

Current Behavior

found here:
openresty/lua-nginx-module#2291
openresty/stream-lua-nginx-module#341

Expected Behavior

No response

Error Logs

No response

Steps to Reproduce

found here:
openresty/lua-nginx-module#2291
openresty/stream-lua-nginx-module#341

Environment

  • APISIX version (run apisix version):
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@shreemaan-abhishek
Copy link
Contributor

please add some description as well instead of just adding links.

@shreemaan-abhishek shreemaan-abhishek added the bug Something isn't working label Mar 11, 2024
@GithubCopilotX
Copy link
Author

GithubCopilotX commented Mar 11, 2024

This memory corruption causes nginx crash and can reproduce under "--with-no-pool-patch" build by running t/048-match-dfa.t TEST 9. The error only happens when there is consecutive regex calls and first call is traditional mode with captures and second call is DFA mode. Check the details in the test.

test log
ok 1 - t/048-match-dfa.t TEST 9: multiple match calls with captures and DFA. - status code ok ok 2 - t/048-match-dfa.t TEST 9: multiple match calls with captures and DFA. - response_body - response is expected (repeated req 0, req 0) t/048-match-dfa.t TEST 9: multiple match calls with captures and DFA. - Can't connect to 127.0.0.1:1984: Connection refused Retry connecting after 0.675 sec t/048-match-dfa.t TEST 9: multiple match calls with captures and DFA. - Can't connect to 127.0.0.1:1984: Connection refused Retry connecting after 0.825 sec

error.log
[notice] 1683757#0: using the "epoll" event method [notice] 1683757#0: openresty/1.25.3.1 (no pool) [notice] 1683757#0: built by gcc 13.2.1 20231011 (Red Hat 13.2.1-4) (GCC) [notice] 1683757#0: OS: Linux 6.7.4-100.fc38.x86_64 [notice] 1683757#0: getrlimit(RLIMIT_NOFILE): 1024:524288 free(): invalid next size (fast)

@moonming
Copy link
Member

Can we wait for the new release of OpenResty to fix this bug?

@GithubCopilotX
Copy link
Author

Can we wait for the new release of OpenResty to fix this bug?

sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants