Welcome! Log In Create A New Profile

Advanced

Re: Lua pcre inside nginx

Chaos Wang
May 04, 2011 11:38PM
NginX hooked pcre memory alloc/free functions pcre_malloc/free to use
its memory pool, in order to work around its memory leaking problem. As
a side effect, it reset this pool to NULL after every usage in core
without considering possible external references. If you don't set pcre
memory hooks to your own implementation, you will surely get the error.

ngx_lua has fixed this problem, and can use pcre related extensions
normally after v0.1.6rc5.

Ref:
* src/core/ngx_regex.c in NginX sources
* ngx_http_lua_patch.c in ngx_lua sources

On 2011年05月05日 03:03, Akins, Brian wrote:
> I wanted to use pcre inside a lua script using rex_pcre. However, I always
> get the error:
>
> failed to get memory (pattern offset: 15)
>
> The snippet of code always works in a standalone script.
>
> Ideas?
>


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Lua pcre inside nginx

Akins, Brian May 04, 2011 03:06PM

Re: Lua pcre inside nginx

Eugaia May 04, 2011 05:38PM

Re: Lua pcre inside nginx

Akins, Brian May 04, 2011 05:42PM

Re: Lua pcre inside nginx

Akins, Brian May 04, 2011 06:12PM

Re: Lua pcre inside nginx

Chaos Wang May 04, 2011 11:38PM

Re: Lua pcre inside nginx

Akins, Brian May 06, 2011 02:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 127
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready