[GiNaC-list] Segmentation Fault when calculate cos(cos(1/2))

翁湛阳 cosine at pcbcos.xyz
Mon Feb 6 14:23:55 CET 2023


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.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ginac.de/pipermail/ginac-list/attachments/20230206/13d44d5b/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.cpp
URL: <http://www.ginac.de/pipermail/ginac-list/attachments/20230206/13d44d5b/attachment.ksh>


More information about the GiNaC-list mailing list