From 2b7ab11003f41a332fa0d04c902c0dd2aad1a220 Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Fri, 27 Oct 2017 09:32:52 -0700 Subject: [PATCH 01/10] tests: suppressed a valgrind false positive in the latest nginx core. --- valgrind.suppress | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/valgrind.suppress b/valgrind.suppress index ab1e4bb..946e534 100644 --- a/valgrind.suppress +++ b/valgrind.suppress @@ -157,3 +157,12 @@ fun:epoll_ctl fun:do_preload fun:dl_main } +{ + + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:ngx_alloc + fun:ngx_set_environment + fun:ngx_single_process_cycle +} From b572087c65a53deb15aee3aedd64e5a5d5f89d0a Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Fri, 27 Oct 2017 12:02:15 -0700 Subject: [PATCH 02/10] tests: minor tweaks in valgrind.suppress. --- valgrind.suppress | 1 - 1 file changed, 1 deletion(-) diff --git a/valgrind.suppress b/valgrind.suppress index 946e534..9027123 100644 --- a/valgrind.suppress +++ b/valgrind.suppress @@ -37,7 +37,6 @@ fun:main Memcheck:Leak fun:malloc fun:ngx_alloc - fun:(below main) } { From a5e8ba1d4a051ace4328ffc15bb3f27a3af031e3 Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Fri, 27 Oct 2017 13:13:30 -0700 Subject: [PATCH 03/10] tests: valgrind.suppress: removed too aggressive suppressions in nginx mem pools and luajit lj_str_new. --- valgrind.suppress | 110 ++++++++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 58 deletions(-) diff --git a/valgrind.suppress b/valgrind.suppress index 9027123..fe102b8 100644 --- a/valgrind.suppress +++ b/valgrind.suppress @@ -1,29 +1,29 @@ { - -Memcheck:Param -socketcall.sendmsg(msg.msg_iov[i]) -fun:sendmsg -fun:ngx_write_channel -fun:ngx_signal_worker_processes -fun:ngx_master_process_cycle -fun:main + + Memcheck:Param + socketcall.sendmsg(msg.msg_iov[i]) + fun:sendmsg + fun:ngx_write_channel + fun:ngx_signal_worker_processes + fun:ngx_master_process_cycle + fun:main } { - -Memcheck:Addr4 -fun:ngx_init_cycle -fun:ngx_master_process_cycle -fun:main + + Memcheck:Addr4 + fun:ngx_init_cycle + fun:ngx_master_process_cycle + fun:main } { - -Memcheck:Param -socketcall.sendmsg(msg.msg_iov[i]) -fun:__sendmsg_nocancel -fun:ngx_write_channel -fun:ngx_signal_worker_processes -fun:ngx_master_process_cycle -fun:main + + Memcheck:Param + socketcall.sendmsg(msg.msg_iov[i]) + fun:__sendmsg_nocancel + fun:ngx_write_channel + fun:ngx_signal_worker_processes + fun:ngx_master_process_cycle + fun:main } { @@ -34,45 +34,39 @@ fun:main } { - Memcheck:Leak - fun:malloc - fun:ngx_alloc + Memcheck:Param + socketcall.sendmsg(msg.msg_iov[i]) + fun:__sendmsg_nocancel + fun:ngx_write_channel + fun:ngx_signal_worker_processes + fun:ngx_master_process_cycle + fun:main } { - -Memcheck:Param -socketcall.sendmsg(msg.msg_iov[i]) -fun:__sendmsg_nocancel -fun:ngx_write_channel -fun:ngx_signal_worker_processes -fun:ngx_master_process_cycle -fun:main -} -{ - -Memcheck:Param -socketcall.sendmsg(msg.msg_iov[i]) -fun:__sendmsg_nocancel -fun:ngx_write_channel -fun:ngx_master_process_cycle -fun:main -} -{ - -Memcheck:Param -socketcall.sendmsg(msg.msg_iov[i]) -fun:__sendmsg_nocancel -fun:ngx_write_channel -fun:ngx_pass_open_channel -fun:ngx_start_worker_processes -fun:ngx_master_process_cycle -fun:main -} -{ - -Memcheck:Param -epoll_ctl(event) -fun:epoll_ctl + + Memcheck:Param + socketcall.sendmsg(msg.msg_iov[i]) + fun:__sendmsg_nocancel + fun:ngx_write_channel + fun:ngx_master_process_cycle + fun:main +} +{ + + Memcheck:Param + socketcall.sendmsg(msg.msg_iov[i]) + fun:__sendmsg_nocancel + fun:ngx_write_channel + fun:ngx_pass_open_channel + fun:ngx_start_worker_processes + fun:ngx_master_process_cycle + fun:main +} +{ + + Memcheck:Param + epoll_ctl(event) + fun:epoll_ctl } { nginx-core-process-init From 927e1e114a316a50497d7222114378304f31a5ee Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Fri, 27 Oct 2017 13:53:21 -0700 Subject: [PATCH 04/10] tests: added new valgrind false positives in the latest nginx core. --- valgrind.suppress | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/valgrind.suppress b/valgrind.suppress index fe102b8..50011ab 100644 --- a/valgrind.suppress +++ b/valgrind.suppress @@ -159,3 +159,13 @@ fun:ngx_set_environment fun:ngx_single_process_cycle } +{ + + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:ngx_alloc + fun:ngx_set_environment + fun:ngx_worker_process_init + fun:ngx_worker_process_cycle +} From 89ecdb0bd03bb3af4554796e70590e683fa79210 Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Sat, 26 May 2018 11:00:48 -0700 Subject: [PATCH 05/10] doc: installation: added missing dependency, ngx_devel_kit. --- README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 443c5c3..d6c888c 100644 --- a/README.md +++ b/README.md @@ -263,23 +263,23 @@ You're recommended to install this module (as well as the Nginx core and many ot Alternatively, you can install this module manually with the Nginx source: Grab the nginx source code from [nginx.org](http://nginx.org/), for example, -the version 1.9.7 (see [nginx compatibility](#compatibility)), and then build the source with this module: +the version 1.13.6 (see [nginx compatibility](#compatibility)), and then build the source with this module: ```bash +wget 'http://nginx.org/download/nginx-1.13.6.tar.gz' +tar -xzvf nginx-1.13.6.tar.gz +cd nginx-1.13.6/ - $ wget 'http://nginx.org/download/nginx-1.9.7.tar.gz' - $ tar -xzvf nginx-1.9.7.tar.gz - $ cd nginx-1.9.7/ +# Here we assume you would install you nginx under /opt/nginx/. +./configure --prefix=/opt/nginx \ + --add-module=/path/to/ngx_devel_kit \ + --add-module=/path/to/array-var-nginx-module - # Here we assume you would install you nginx under /opt/nginx/. - $ ./configure --prefix=/opt/nginx \ - --add-module=/path/to/array-var-nginx-module - - $ make -j2 - $ make install +make -j2 +make install ``` -Download the latest version of the release tarball of this module from [array-var-nginx-module file list](https://github.com/openresty/array-var-nginx-module/tags). +Download the latest version of the release tarball of this module from [array-var-nginx-module file list](https://github.com/openresty/array-var-nginx-module/tags), and the latest tarball for [ngx_devel_kit](https://github.com/simplresty/ngx_devel_kit) from its [file list](https://github.com/simplresty/ngx_devel_kit/tags). Also, this module is included and enabled by default in the [OpenResty bundle](http://openresty.org). @@ -304,6 +304,10 @@ Compatibility The following versions of Nginx should work with this module: +* **1.13.x** (last tested: 1.13.6) +* **1.12.x** +* **1.11.x** (last tested: 1.11.2) +* **1.10.x** * **1.9.x** (last tested: 1.9.7) * **1.8.x** * **1.7.x** (last tested: 1.7.10) From 95e9fd6a96821c9e3ea9e892773ae462461a7f5c Mon Sep 17 00:00:00 2001 From: Johnny Wang Date: Thu, 8 Jul 2021 19:03:39 +0800 Subject: [PATCH 06/10] travis-ci: bump the NGINX core to 1.19.9, remove clang compiler mode from travis to save credits. (#7) --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 086ab81..eb23e16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ language: c compiler: - gcc - - clang env: global: @@ -21,8 +20,8 @@ env: - NGX_BUILD_JOBS=$JOBS - TEST_NGINX_SLEEP=0.006 matrix: - - NGINX_VERSION=1.9.15 - - NGINX_VERSION=1.11.2 + - NGINX_VERSION=1.17.8 + - NGINX_VERSION=1.19.9 addons: apt: From 353f9161d27e7553070b7d007578e10a7f54e3ec Mon Sep 17 00:00:00 2001 From: Johnny Wang Date: Fri, 15 Oct 2021 23:10:34 +0800 Subject: [PATCH 07/10] travis-ci: upgrade dist of travis-ci to ubuntu bionic. (#8) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index eb23e16..ad6de7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ sudo: required -dist: trusty +dist: bionic os: linux @@ -61,4 +61,4 @@ script: - export NGX_BUILD_CC=$CC - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - nginx -V - - prove -r t + - prove -I. -r t From 32188f86599b47f7cd34340e5a2985bd9d550bf8 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Mon, 23 May 2022 15:54:38 +0500 Subject: [PATCH 08/10] optimize: fix potential null pointer dereference found by coverity (#9) 568 dd("array var map: array size: %d", (int) array->nelts); 569 CID 258181 (#1 of 1): Dereference null return value (NULL_RETURNS)7. dereference: Dereferencing array_it, which is known to be NULL. 570 array_it->not_found = 0; 571 array_it->valid = 1; --- src/ngx_http_array_var_module.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ngx_http_array_var_module.c b/src/ngx_http_array_var_module.c index 0b715b1..76c4df7 100644 --- a/src/ngx_http_array_var_module.c +++ b/src/ngx_http_array_var_module.c @@ -553,6 +553,9 @@ ngx_http_array_var_map(ngx_http_request_t *r, ngx_str_t *res, value = array->elts; array_it = ngx_http_get_indexed_variable(r, conf->array_it_index); + if (array_it == NULL) { + return NGX_ERROR; + } if (conf->in_place) { new_array = array; From 2c1bfef213b254b7aa5cb0681a46205be03b0763 Mon Sep 17 00:00:00 2001 From: lijunlong Date: Thu, 23 Nov 2023 19:35:09 +0800 Subject: [PATCH 09/10] tests: update nginx to 1.25.3. --- .travis.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad6de7d..676b2c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,9 @@ sudo: required -dist: bionic +dist: focal + +branches: + only: + - "master" os: linux @@ -20,8 +24,8 @@ env: - NGX_BUILD_JOBS=$JOBS - TEST_NGINX_SLEEP=0.006 matrix: - - NGINX_VERSION=1.17.8 - - NGINX_VERSION=1.19.9 + - NGINX_VERSION=1.25.3 + #- NGINX_VERSION=1.21.4 addons: apt: @@ -42,7 +46,7 @@ cache: - download-cache install: - - git clone https://github.com/openresty/nginx-devel-utils.git + - git clone https://github.com/openresty/openresty-devel-utils.git - git clone https://github.com/openresty/openresty.git ../openresty - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module @@ -57,7 +61,7 @@ script: - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1) - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - cd ../test-nginx && sudo cpanm . && cd .. - - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH + - export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:$PATH - export NGX_BUILD_CC=$CC - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - nginx -V From aa6b05871130e737b1843a07a1e9ef1f82bc8f49 Mon Sep 17 00:00:00 2001 From: lijunlong Date: Sat, 17 Aug 2024 20:13:31 +0800 Subject: [PATCH 10/10] feature: update nginx to .1.27.1. --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 676b2c9..5be4c36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,7 @@ env: - NGX_BUILD_JOBS=$JOBS - TEST_NGINX_SLEEP=0.006 matrix: - - NGINX_VERSION=1.25.3 - #- NGINX_VERSION=1.21.4 + - NGINX_VERSION=1.27.1 addons: apt: