sb-gmp strange results
Bug #1206191 reported by
Stas Boukarev
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Stephan Frank |
Bug Description
(sb-gmp:mpz-fac 6) => 259614100162939
And the low bits are actually correct:
(logand #xFFFFFF (sb-gmp:mpz-fac 6)) => 720
But what's even more strange, sometimes after doing (sb-gmp:mpz-pow 17 2) (which causes a memory fault, because it only checks the type of the second argument but not the first) or some other erroneous thing, (sb-gmp:mpz-fac 6) starts returning 720.
The correct result after errors can be explained that it first does __GMPZ_INIT, but __GMPZ_CLEAR is not protected by UNWIND-PROTECT.
Changed in sbcl: | |
status: | In Progress → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
After doing (with-alien ((fac (struct gmpint))) (__gmpz_init (addr fac))) several times, it starts returning 720 too.