[alexandria-devel] Bug in gaussian-random

Andy Peterson andy.arvid at gmail.com
Mon Feb 4 18:14:13 UTC 2013


Hello,

Four months ago, I reported a bug in gaussian-random when either optional
parameter min or max is nil but not both are nil. The docstring has been
modified since then but the code is still the same and the bug remains. In
such a situation it is possible to enter an infinite loop.

This is easy to demonstrate by the call (gaussian-random 0 nil). You may
need to repeat the call a few times because the bug depends on the values
returned by the first call to the local function gauss.  An infinite loop
will occur if gauss returns a negative number.

I have attached a patch which fixes the bug.

Sincerely,

Andy Peterson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/alexandria-devel/attachments/20130204/8e1defbc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gaussian-random.patch
Type: application/octet-stream
Size: 2789 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/alexandria-devel/attachments/20130204/8e1defbc/attachment.obj>


More information about the alexandria-devel mailing list