-
Notifications
You must be signed in to change notification settings - Fork 2k
pcre #72
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
Comments
On Sun, Nov 27, 2011 at 12:43 AM, Vittly
Could you please give me a minimized sample that can reproduce this Thanks! |
Seems that it is a memory leak because application could work properly all day and in the end of day I see that all regexs crashes. I think it is important that all regexs I use contains captures '(...)'. To reproduce the error try thomething like |
On Sun, Nov 27, 2011 at 1:26 PM, Vittly
Thanks for the report! But I still need further information:
Also, could you try adding the "o" regex option to your regex? As in
content_by_lua " Thanks! |
Ok. uname -a would 'o' option work with 'j'? Or I need to replace 'j' by 'o' for a while? |
On Sun, Nov 27, 2011 at 1:49 PM, Vittly
"pcre 8.2" is actually referring to pcre 8.20 here, right? Which version of ngx_lua are you using? v0.3.1rc34?
The "j" option should always be used with "o", or the regex will be Thanks! |
"pcre 8.2" is actually referring to pcre 8.20 here, right? Yes! ok I ll add 'o' to 'j' |
On Sun, Nov 27, 2011 at 1:26 PM, Vittly
I've tried a slightly modified version of your example which is buggy
with ngx_lua v0.3.1rc36 and nginx 1.0.10 and pcre 8.20 (with and Could you please try out my example as is on your side? It'll be easier for me to fix this issue if you can help me reproduce BTW, pcre jit is disabled by default in pcre 8.20's build system. You
--with-pcre-opt="--enable-jit" ... You should pass --enable-utf8 too if you want to enable the UTF-8 Thanks! |
I know about this flags and it wasn't simple task. For example your method " ./configure --with-pcre=/path/to/your/pcre/source/tree |
You also could add to your documentation that r34 installs only if $CFLAGS = -Wno-error (in nginx makefile). Pleeeease:) |
On Sun, Nov 27, 2011 at 11:15 PM, Vittly
Can you try the latest rc36 release? I think I've fixed this issue in -agentzh |
On Sun, Nov 27, 2011 at 11:01 PM, Vittly
This is unfortunate. Then I'd recommend building pcre separately and
assuming that your pcre is installed into /opt/pcre820jit as I am ;)
This is just a sample meant to reproduce the issue that you have. It's Best, |
I have done 1 000 000 requests for ngx.re.match(ngx.req.get_headers()['User-Agent'],...) but it does not go down. Then I ve told my friends (which cause the errors before) to request this "regex" location but during the day there was not any errors at all. Main application logic now use 'jo' flags and similary do not crash. |
On Mon, Nov 28, 2011 at 12:15 PM, Vittly
Good to know :) But I still want to fix the case that "o" is not
You definitely lost content_by_lua directive and the parentheses did Please send me the exact config snippet that you actually run and that Thanks! |
I've faced the issue during playing with shared dictionaries. I have only few regex'es (something about 3 or 4) in my code, all with and only with "o" option. |
Yes, I also could not reproduce the error:( |
On Tue, Nov 29, 2011 at 11:52 AM, Vittly
Okay, I've finally designed a use case that can reproduce this error:
Then GET /re will yield the following error message in my error.log:
Another use case can also lead to similar issues is as follows:
I've already fixed this pcre malloc/free issues in my local copy of Thanks for reporting this issue! |
…() failed: failed to get memory" due to incorrect pcre_malloc and pcre_free handling. thanks Vittly for reporting this in github issue #72.
Good! Let me know when next version would finished, I ll try it and close the issue |
Please try out the v0.3.1rc37 release hopefully this issue is fixed completely now :) https://github.com/chaoslawful/lua-nginx-module/tags Thanks! |
@agentzh Is it possible that the bug will occur in expressions like |
On Wed, Nov 30, 2011 at 4:08 AM, Vladimir Protasov
I don't think so :) But you may have issues when signal the nginx to
Please consider upgrading ngx_lua (or ngx_openresty in general) to the Thanks! |
@agentzh I'm always on the latest version and I'll try to provide feedback. |
On Wed, Nov 30, 2011 at 7:50 PM, Vladimir Protasov
The latest version (v0.3.1rc37) of ngx_lua should not have this issue.
Fair enough :) Regards, |
30.11.2011, 16:01, "agentzh (章亦春)" [email protected]:
Best regards, |
Any update on this issue? |
I have been using ngx.re with 'jo' few month and all is ok. But I don't know anything about its status without these options. I am happy with 'jo' so I am closing the issue |
Hi again! As I said earlier I am using pcre 8.2 with 'j' and 'u' flags in ngx.match. From time to time I got 'pcre_compile() failed to get memory...' is it bug of lua_nginx or nginx or pcre? What should I do? Do not use pcre?
The text was updated successfully, but these errors were encountered: