Re: dc(1) fails with big number failure on 2^64

2012-11-08 Thread Jakub Lach
I can confirm something similar. $ dc 18446744073709551616 18446744073709551616 / ps dc: big number failure 306b06b: No error: 0 FreeBSD 9.1-PRERELEASE #0 r242513 amd64, clang -- View this message in context: http://freebsd.1045724.n5.nabble.com/dc-1-fails-with-big-number-failure-on-2-64

Re: dc(1) fails with big number failure on 2^64

2012-11-08 Thread Michiel Boland
On 11/08/2012 03:06, Jan Mikkelsen wrote: Hi, I am seeing this in dc: janm@gray: dc $ dc 18446744073709551616 18446744073709551616 / ps dc: big number failure 306b06b: No such file or directory That number is 2^64. The error is coming from BN_check in bdiv(), which is complaining about the

Re: dc(1) fails with big number failure on 2^64

2012-11-08 Thread Michiel Boland
On 11/08/2012 19:32, Michiel Boland wrote: [...] No fix, but I see a problem in the BN_add_word function in /usr/src/crypto/openssl/crypto/bn/bn_word.c Small test case:- #include openssl/bn.h #include limits.h int main() { BIGNUM *n; n = BN_new(); BN_set_word(n,

Re: dc(1) fails with big number failure on 2^64

2012-11-08 Thread Jan Mikkelsen
Hi, Great, the test case is very useful. I have applied the following patch to crypto/bn/bn_word.c, which fixes the problem for me. --- //depot/vendor/freebsd/9.1-local/src/crypto/openssl/crypto/bn/bn_word.c 2012-08-13 00:32:35.0 1000 +++

dc(1) fails with big number failure on 2^64

2012-11-07 Thread Jan Mikkelsen
Hi, I am seeing this in dc: janm@gray: dc $ dc 18446744073709551616 18446744073709551616 / ps dc: big number failure 306b06b: No such file or directory That number is 2^64. The error is coming from BN_check in bdiv(), which is complaining about the number at the top of the stack being