-
Notifications
You must be signed in to change notification settings - Fork 291
Module compilation error with NGINX 1.21.5 #261
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
Have the same issue, looks like it's related to a change in nginx (now nginx is built with the PCRE2 library by default). |
@simonepittis @monitmanllc please check this - #260 Long story short: use |
@defanator Thank you for the info appreciate it, I have used --without-pcre2 and compiled as expected. Have a good afternoon. |
yes, works! |
How is it working after compiling with the --without-pcre2 flag? Are you having any of the reported memory allocation problems? What version of Nginx are you compiling with? Thanks for the help and info. |
Are you getting any problems with memory allocation or leaks after compiling and testing? |
@Danrancan tested now without "--without-pcre2" and works fine. no performance issue and no memory issue. :-) |
Thank you very much @simonepittis! This is exactly what I needed to know! |
Wait, I just re-read this. You say you tested it WITHOUT "--without-pcre2". Was that a mistake? or do you actually mean that you did NOT use the "--without-pcre2" arguement, and it is still working? If so, that implies there was an update that I don't know about correct? Otherwise, i believe you made a grammatacal mistake and meant to say.. "tested now with "--without-pcre2" and works fine." Could you please clarify? |
After:
git clone --depth 1 https://github.com/SpiderLabs/ModSecurity-nginx.git
wget http://nginx.org/download/nginx-1.21.5.tar.gz
tar zxf nginx-1.21.5.tar.gz
cd nginx-1.21.5
./configure --with-compat --add-dynamic-module=../ModSecurity-nginx
make modules
I can see this error:
make -f objs/Makefile modules
make[1]: Entering directory '/root/nginx-1.21.5'
cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/modsecurity/include -I objs -I src/http -I src/http/modules
-o objs/addon/src/ngx_http_modsecurity_module.o
../ModSecurity-nginx/src/ngx_http_modsecurity_module.c
../ModSecurity-nginx/src/ngx_http_modsecurity_module.c: In function 'ngx_http_modsecurity_pcre_malloc_init':
../ModSecurity-nginx/src/ngx_http_modsecurity_module.c:78:9: error: 'pcre_malloc' undeclared (first use in this function); did you mean 'old_pcre_malloc'?
78 | if (pcre_malloc != ngx_http_modsec_pcre_malloc) {
| ^~~~~~~~~~~
| old_pcre_malloc
../ModSecurity-nginx/src/ngx_http_modsecurity_module.c:78:9: note: each undeclared identifier is reported only once for each function it appears in
../ModSecurity-nginx/src/ngx_http_modsecurity_module.c:82:25: error: 'pcre_free' undeclared (first use in this function); did you mean 'pkey_free'?
82 | old_pcre_free = pcre_free;
| ^~~~~~~~~
| pkey_free
../ModSecurity-nginx/src/ngx_http_modsecurity_module.c: In function 'ngx_http_modsecurity_pcre_malloc_done':
../ModSecurity-nginx/src/ngx_http_modsecurity_module.c:102:9: error: 'pcre_malloc' undeclared (first use in this function); did you mean 'old_pcre_malloc'?
102 | pcre_malloc = old_pcre_malloc;
| ^~~~~~~~~~~
| old_pcre_malloc
../ModSecurity-nginx/src/ngx_http_modsecurity_module.c:103:9: error: 'pcre_free' undeclared (first use in this function); did you mean 'pkey_free'?
103 | pcre_free = old_pcre_free;
| ^~~~~~~~~
| pkey_free
make[1]: *** [objs/Makefile:1232: objs/addon/src/ngx_http_modsecurity_module.o] Error 1
The text was updated successfully, but these errors were encountered: