Segmentation Fault when calculate cos(cos(1/2))
Dear GiNaC Team, When I tried to use GiNaC to calculate cos(cos(1/2)),I got a Segmentation Fault. My environment is as following: CPU: Intel i7-10750H Windows10 21H2 gcc version 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh) GiNaC 1.8.5 CLN 1.3.6 GMP 6.2.1 ArchLinux(in VMwave) Kernel: 6.1.9-arch1-1 GiNaC 1.8.4 installed by pacman CLN 1.3.6 installed by pacman gcc version 12.2.1 20230111(GCC) Relative code file is attached The program crash at line 8.I tried to compile and run the same program at ArchLinux(GCC 12.2.1 GiNaC 1.8.4 CLN 1.3.6),and also got a segmentation fault. Besides , I tried to use ginsh to execute “cos(cos(1/2));” in ArchLinux ,it gave a error: Internal error: statement in file float/misc/cl_F_extendsqrt.cc, line 30 has been reached!! The same error also occurred at Windows,but it just exit without the information above. After that, I built some lower version of GiNaC in Windows10 and re-run my code.I found the bug disappeared at GiNaC 1.8.3 . After reading the commit history I rollback ginac\inifcns_trans.cpp to version 1.8.3 and rebuilt ,the bug disappeared. All my best, -Weng Zhanyang.
Dear Weng Zhanyang, Thanks for reporting the bug, it was introduced by me. Although expression like cos(numeric(1, 2)) is not a symbolic, it neither is numeric in the sense of CLN library (as it is erroneously produced now). I am attaching a patch to fix this. Best wishes, Vladimir -- Vladimir V. Kisil http://www1.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Maps https://doi.org/10.1142/p835 Soft: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter notebooks: https://github.com/vvkisil?tab=repositories
On Mon, 6 Feb 2023 13:23:55 +0000, 翁湛阳 <cosine@pcbcos.xyz> said:
WZ> Dear GiNaC Team, When I tried to use GiNaC to calculate WZ> cos(cos(1/2)),I got a Segmentation Fault. My environment is as WZ> following: CPU: Intel i7-10750H Windows10 21H2 gcc version WZ> 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh) GiNaC 1.8.5 CLN 1.3.6 WZ> GMP 6.2.1 WZ> ArchLinux(in VMwave) Kernel: 6.1.9-arch1-1 GiNaC 1.8.4 installed WZ> by pacman CLN 1.3.6 installed by pacman gcc version 12.2.1 WZ> 20230111(GCC) WZ> Relative code file is attached The program crash at line 8.I WZ> tried to compile and run the same program at ArchLinux(GCC WZ> 12.2.1 GiNaC 1.8.4 CLN 1.3.6),and also got a segmentation fault. WZ> Besides , I tried to use ginsh to execute “cos(cos(1/2));” in WZ> ArchLinux ,it gave a error: Internal error: statement in file WZ> float/misc/cl_F_extendsqrt.cc, line 30 has been reached!! WZ> The same error also occurred at Windows,but it just exit without WZ> the information above. WZ> After that, I built some lower version of GiNaC in Windows10 and WZ> re-run my code.I found the bug disappeared at GiNaC 1.8.3 WZ> . After reading the commit history I rollback WZ> ginac\inifcns_trans.cpp to version 1.8.3 and rebuilt ,the bug WZ> disappeared. WZ> All my best, WZ> -Weng Zhanyang.
participants (2)
-
Vladimir V. Kisil
-
翁湛阳