BUG #1718: geqo_selection.c:linear()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

BUG #1718: geqo_selection.c:linear()

Bug Finder

The following bug has been logged online:

Bug reference:      1718
Logged by:          Bug Finder
Email address:      [hidden email]
PostgreSQL version: 8.0.3
Operating system:   Linux
Description:        geqo_selection.c:linear()
Details:

In geqo_selection.c, function linear() may
return a value equals to pool_size, and cause
geqo_selection() to visit invalid array member.

In linear(), assume bias is 2, and geqo_rand()
returns 1. Then index will equal to pool_size.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Reply | Threaded
Open this post in threaded view
|

Re: BUG #1718: geqo_selection.c:linear()

Tom Lane-2
"Bug Finder" <[hidden email]> writes:
> In geqo_selection.c, function linear() may
> return a value equals to pool_size, and cause
> geqo_selection() to visit invalid array member.

Good catch.  I wonder whether roundoff error couldn't lead to trying to
call sqrt() with a value slightly less than zero, too.  Repaired in our
CVS for next releases --- thanks for the report!

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings