[GiNaC-devel] segmentation fault in substituting.

Chris Dams C.Dams at science.ru.nl
Thu Sep 30 17:09:05 CEST 2004


Dear Christian,

On Thu, 30 Sep 2004, Christian Bauer wrote:

> > I found that basic::subs_one_level sometimes gives a segementation fault.
>
> Do you have a test case?

Do you have any doubts then, after reading my description?

Not that many of GiNaCs classes with a non-trivial eval method actually
use basic::subs, do they? As a matter of fact, my new integral class seems
to be the first. Well okay then, here is a program that needs the patch in
order not to segfault on my system. In this case the integral evals into
zero.

#include <iostream>
#include <ginac/ginac.h>

using namespace std;
using namespace GiNaC;

int main(int argc, char** argv)
{  symbol x("x"),y("y");
   ex f=integral(x,0,y,sin(x));
   f=f.subs(y==0,subs_options::no_pattern);
   cout << f << endl;
   return 0;
}

Best,
Chris




More information about the GiNaC-devel mailing list