Welcome! Log In Create A New Profile

Advanced

Segfault in NGINX - testcase

March 19, 2010 04:19PM
Hello,

NGINX will segfault, if you delete the root node in an rbtree with
two elements. Testcase:
http://doppelbauer.name/nginx-testcase.c

A patch is attached below.

Thanks a lot
Markus Doppelbauer


*** a/core/ngx_rbtree.c 2010-03-19 21:07:14.342916081 +0100
--- b/core/ngx_rbtree.c 2010-03-19 21:07:56.642187263 +0100
*************** ngx_rbtree_delete(ngx_thread_volatile ng
*** 187,193 ****
if (subst == *root) {
*root = temp;
ngx_rbt_black(temp);
!
/* DEBUG stuff */
node->left = NULL;
node->right = NULL;
--- 187,194 ----
if (subst == *root) {
*root = temp;
ngx_rbt_black(temp);
! temp->parent = NULL; /* parent of root node should be NULL */
!
/* DEBUG stuff */
node->left = NULL;
node->right = NULL;
Subject Author Posted

Segfault in NGINX - testcase

double March 19, 2010 04:19PM

Re: Segfault in NGINX - testcase

Maxim Dounin March 19, 2010 09:10PM

Re: Segfault in NGINX - testcase

double March 20, 2010 04:43AM

Re: Segfault in NGINX - testcase

Maxim Dounin March 20, 2010 04:34PM

Re: Segfault in NGINX - testcase

double March 20, 2010 04:48PM

Re: Segfault in NGINX - testcase

double March 25, 2010 02:08PM

Re: Segfault in NGINX - testcase

double March 25, 2010 03:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 60
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready