Welcome! Log In Create A New Profile

Advanced

Re: [BUG] memory leak risk in rbtree operation with hash collision

Maxim Dounin
February 27, 2012 05:18PM
Hello!

On Mon, Feb 27, 2012 at 05:52:45PM +0800, lanshun zhou wrote:

> The algorithm of many rbtree lookup functions in nginx requires
> that nodes with the same hash value are linked together, but
> sometimes this may be broken with the rebalance of the tree
> after new nodes inserted. See the following example, the number
> contains hash value and node key, 51 shares the same hash value
> with 52. After the inserting of 63 and the rebalancing of the
> tree, they are separated. Then 51 is "lost" from the tree. every
> lookup for 51 returns null and new nodes are always alloced
> until one of them is linked with 52 again.

Good catch, thanx.

Patch committed with minor style fixes.

Maxim Dounin

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

[BUG] memory leak risk in rbtree operation with hash collision Attachments

lanshun zhou 1834 February 27, 2012 04:54AM

Re: [BUG] memory leak risk in rbtree operation with hash collision

Maxim Dounin 664 February 27, 2012 05:18PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 187
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