[GiNaC-list] archiving custom functions

grey_earl at web.de grey_earl at web.de
Thu Sep 30 17:16:05 CEST 2010


>>Hello all,
>>
>>I was trying to archive custom functions (functions done with the macros as detailed in the tutorial, archiving also as in the tutorial). Archiving works fine, viewing the archives with viewgar -d gives me a complete output, without the -d switch viewgar complains about a non-existent function (logically!).
>>
>>When I try to read them in, however, I get a segmentation fault. Therefore my question: do I have to do anything special to make this work, or could it be a bug in the compiler? (which I cannot change, unfortunatly)
>>
>>Thanks
>
>I tried now on another system with a newer compiler, and also get a segmentation fault, so it seems it's not a compiler bug. I'm using the newest CLN and GiNaC, self-compiled and also openSuSE packages, both don't work.
>Looking through the source code, unarchiving a function should also work with custom functions, since they search for the function serial by name. My guess would be that the unarchiving code mistakes my function for a symbol which isn't passed, tries to create it and somehow segfaults there, but this is only an uninformed guess, I haven't dug that deep into the source code.


After doing a gdb backtrace, I see that it crashes on l. 310 of ex.cpp, which is

const ex & tmpex = other.eval(1);

and it seems that GiNaC goes into an infinite loop trying to construct an expression from basic.

backtrace:

#0  GiNaC::ex::construct_from_basic (other=@0x6b4890) at ex.cpp:293
#1  0x0000000000416509 in GiNaC::symbol::eval (this=0x6b4890, level=1) at /usr/local/include/ginac/ex.h:255
#2  GiNaC::ex::construct_from_basic (other=@0x6b4890) at ex.cpp:293
#3  0x0000000000416509 in GiNaC::symbol::eval (this=0x6b4890, level=1) at /usr/local/include/ginac/ex.h:255
#4  GiNaC::ex::construct_from_basic (other=@0x6b4890) at ex.cpp:293
#5  0x0000000000416509 in GiNaC::symbol::eval (this=0x6b4890, level=1) at /usr/local/include/ginac/ex.h:255
...
(at least 10k of those lines)

I am calling hold() in the eval() function of my custom function, so in principle this should work, no?
___________________________________________________________
WEB.DE DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für 
nur 19,99 €/mtl.!* http://produkte.web.de/go/DSL_Doppel_Flatrate/2


More information about the GiNaC-list mailing list