Bug?: (a^b).unit(a) -> SIGSEGV
Hi, Notice that (a^b).unit(a) leads to Segmentation fault. I have failed to track down the source of this fault in GiNaC --- I would expect that this expression should throw an exception "invalid expression in unit()", but something gets wrong elsewhere. Any ideas? Pearu For your convinience, here is a sample program: #include <iostream> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main() { symbol a("a"),b("b"); ex e = power(a,b); cout << "e="<<e<< endl; cout << "e.unit(a)="<<e.unit(a)<< endl; return 0; }
hi ginac-fans, we apologize that the ginac-mailing list was abused to distribute spam mails with faked sender-address. please stay indulgent until we find a way to suppress this rubbish - we are working on it. on behalf of the ginac-authors: Hubert Spiesberger Institut fuer Physik WA ThEP Johannes-Gutenberg-Universitaet Mainz D-55099 Mainz Phone: +49-6131.39.23682 Fax: +49-6131.39.24611
On Mon, 26 Nov 2001, Hubert Spiesberger wrote:
we apologize that the ginac-mailing list was abused to distribute spam mails with faked sender-address. please stay indulgent until we find a way to suppress this rubbish - we are working on it.
Yeah, and we are not alone. de.admin.net-abuse.mail is full of reports about this junk. If you know German, i recommend reading some of the threads there where people have successfully reverse-translated this using babelfish.altavista.com. Enjoy. :-/ -richy. -- Richard Kreckel <Richard.Kreckel@Uni-Mainz.DE> <http://wwwthep.physik.uni-mainz.de/~kreckel/>
Hi! On Sun, Nov 25, 2001 at 02:21:44PM +0200, Pearu Peterson wrote:
Notice that (a^b).unit(a) leads to Segmentation fault. [...] Any ideas?
My guess is that it enters an infinite recursion in unit() because lcoeff(a^b,a) = a^b, and unit() expects the coefficient to not contain the specified variable any more. Technically, unit() is being called with illegal arguments as it expects a polynomial and doesn't do any checking for speed reasons. Maybe power::degree() should throw an exception if it has a non-integer exponent instead of returning 0? I'm not sure whether this will break anything... Bye, Christian -- / Coding on PowerPC and proud of it \/ http://www.uni-mainz.de/~bauec002/
participants (4)
-
Christian Bauer
-
Hubert Spiesberger
-
Pearu Peterson
-
Richard B. Kreckel