[GiNaC-list] Problem in factor

Ulrich Loup loup at cs.rwth-aachen.de
Mon Nov 19 20:14:52 CET 2012


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.




More information about the GiNaC-list mailing list