Welcome! Log In Create A New Profile

Advanced

Re: Segfault in NGINX - testcase

Maxim Dounin
March 20, 2010 04:34PM
Hello!

On Sat, Mar 20, 2010 at 04:43:56AM -0400, double wrote:

> Hello,
>
> The root node of the nginx-rbtree is *always* NULL, because
> "ngx_rbtree_insert()" provides that feature. Only if the rbtree
> has 2 elements and you delete the root node, then "parent" of the
> root-node points to the deleted element. Why not fixing it?

As you already pointed out, there is at least one place where
root->parent becomes non-NULL (and I'm not sure it's the only
place where it happens). And this doesn't cause any harm as nginx
doesn't assume it should be NULL.

While I tend to think that it's good idea to keep it NULL at least
with NGX_DEBUG defined (to simplify debugging) - there is no bug
here. The bug is in your tree traversal code which tries to use
assumption that root->parent == NULL. And even if your patch will
be applied (it's up to Igor anyway) - your tree traversal code
should be fixed if you are planning to use it somewhere in
production.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
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: 313
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