Bug in double_approx() for cl_RA on x86_64
Hello. I've run into a bug in the following routine: src/float/dfloat/conv/cl_RA_to_double.cc : double_approx() A test case is attached. It is supposed to print the rational number 2/3 as a string, a float, and a double. On any 32-bit machine I've tried, it works perfectly. However, on 64-bit machines, I find that the conversion to double generates a segmentation fault. My version is cln-1.2.2. However, looking at the revision history of the relevant file, I don't see what would have fixed this in 1.3.0, so presumably the bug could still be there. It'd be great if someone could look into this. Thanks. Igor
Hi! Igor Khavkine wrote:
Hello. I've run into a bug in the following routine:
src/float/dfloat/conv/cl_RA_to_double.cc : double_approx()
A test case is attached. It is supposed to print the rational number 2/3 as a string, a float, and a double. On any 32-bit machine I've tried, it works perfectly. However, on 64-bit machines, I find that the conversion to double generates a segmentation fault.
My version is cln-1.2.2. However, looking at the revision history of the relevant file, I don't see what would have fixed this in 1.3.0, so presumably the bug could still be there.
It'd be great if someone could look into this. Thanks.
Thanks a lot for sending this concise bug report! I had a quick look at it and found an assumption in cl_RA_to_double.cc which can indeed become invalid on 64-bit systems. I'll do proper testing before committing. In the meantime, could you, please, test if the attached patch works in your cases? Thanks in advance! -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
On Sun, Aug 30, 2009 at 11:02 PM, Richard B. Kreckel <kreckel@ginac.de> wrote:
Thanks a lot for sending this concise bug report! I had a quick look at it and found an assumption in cl_RA_to_double.cc which can indeed become invalid on 64-bit systems. I'll do proper testing before committing. In the meantime, could you, please, test if the attached patch works in your cases? Thanks in advance!
Hi, Richard. I've just tested your patch and it removes the bug I was seeing before. Thanks a lot for the prompt fix! Sorry about the late reply. My eye was not on the list. Thanks again. Igor
participants (2)
-
Igor Khavkine
-
Richard B. Kreckel