[GiNaC-list] Problem in factor

Jens Vollinga jens.vollinga at googlemail.com
Mon Nov 19 21:46:54 CET 2012


Hi,

thanks for reporting this problem.

Yes, the problem is inside GiNaC, not CLN. Actually, there seems to be a 
quick fix: replace in line 1512 of factor.cpp the cl_I's by cl_R's ...

But what I currently don't understand is what other implications this 
fix has. And why did this problem go unnoticed for so long? I have to 
investigate a little bit more. This may take some time.

Regards,
Jens


On 19.11.2012 20:14, Ulrich Loup wrote:
> Hello list,
>
> we use GiNaC::factor in our program to factorize univariate and multivariate
> polynomials. This works quite well on our instances, however we encounter
> strange segfaults sometimes, e.g. in the following cases:
>
> factor(-5474155567807987/200000000000000+174247781/20000000*x^2-1989199947807987/200000000000000*x);
> factor(-5474155567807987/20000000000000+174247781/10000000*x^2-1989199947807987/200000000000000*x);
> factor(-5474155567807987/200000000000000+174247781/1000000*x^2-1989199947807987/200000000000000*x);
> factor(-5474155567807987/200000000000000+174247781/10*x^2-1989199947807987/200000000000000*x);
> factor(-5474155567807987/200000000000000+174247781/2*x^2-1989199947807987/200000000000000*x);
> factor(-5474155567807987+174247781/10000000*x^2-1989199947807987/200000000000000*x);
> factor(174247781/10000000*x^2-1989199947807987/200000000000000*x);
> factor(174247781*x^2-1989199947807987/200000000000000*x);
>
> The latter calls are just modifications of the original first call, but all of
> them fail. I did not manage to pinpoint a commonality which could give a clue
> to the actual cause of the error.
>
> With a debugger, we traced the error to a call to CLN's * operator (in
> factor.cpp:1512), in particular, the method the<cl_I>( ... ). However, the
> actual problem might already be in GiNaC. I suspect, there is a problem with
> computing the content of the input by GiNaC::unitcontprim 10 lines above the
> error occurrence, but I'm not sure.
>
> We used ginac-1.6.2 and cln-1.3.2-r1 on a Gentoo Linux machine.
>
> Does anyone have an idea what is going wrong here?
>
> Best regards,
>
> Ulrich.
>
>
> _______________________________________________
> GiNaC-list mailing list
> GiNaC-list at ginac.de
> https://www.cebix.net/mailman/listinfo/ginac-list
>



More information about the GiNaC-list mailing list