[GiNaC-devel] [GiNaC-list] Segmentation Fault when calculate cos(cos(1/2))
Vladimir V. Kisil
V.Kisil at leeds.ac.uk
Tue Feb 7 10:38:41 CET 2023
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 at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-wrong-numeric-info-on-transcendental-functions.patch
Type: text/x-diff
Size: 2252 bytes
Desc: Fix bug.patch
URL: <http://www.ginac.de/pipermail/ginac-devel/attachments/20230207/3eb8bfa4/attachment.bin>
More information about the GiNaC-devel
mailing list