BUG #1718: geqo_selection.c:linear()

Started by Bug Finderalmost 21 years ago2 messagesbugs
Jump to latest
#1Bug Finder
bug@zedware.org

The following bug has been logged online:

Bug reference: 1718
Logged by: Bug Finder
Email address: bug@zedware.org
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.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bug Finder (#1)
Re: BUG #1718: geqo_selection.c:linear()

"Bug Finder" <bug@zedware.org> 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