Hi, I have program that crashes when it uses the collect function of the ex class. The strange error I receive is: Not a 32-bit integer: -9223372028264841216 I am able to print both the expression and the symbol I am going to use for the collect call before hand and all seems fine. I archived the symbol and expression just before I knew it would crash and I can look at the function with viewgar. However if I make a program that uses collect on the expression I get the same strange error and the program exits. Is this a bug in GiNaC? Is it a bug in my software? What could be causing this? How can I fix it? I have attached the archive file and the source to the program that reads the archive file. I did not give the source to the software that originally produced it because it is a function that is dynamically linked with another program.(GNU Octave) In case my system configuration is important: [ben@pcben Linux]$ ginac-config --version 0.6.4 [ben@pcben Linux]$ g++ -v Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs gcc version 2.95.2 19991024 (release) [ben@pcben Linux]$ uname -a Linux pcben 2.2.12-20 #1 Mon Sep 27 10:40:35 EDT 1999 i686 unknown Thanks for any insight. -- Ben Sapp Los Alamos National Laboratory email: <mailto:bsapp@lanl.gov> Phone: (505)667-3277 Fax: (505)665-7920 URL: http://www.neutrino.lanl.gov/ -- GARCclasssymbolnamexThe symbolmuladdrestnumericnumber1coeffR-1 11529215046068469760 -61overall_coeffpowerbasisR1 9223372036854775808 -62exponentR1 13835058055282163712 -62The expression J J;[kJ{<J;[k;[; [k #include <ginac/ginac.h> #include <iostream> #include <fstream> using namespace GiNaC; int main() { archive a; ifstream in("foobar.gar"); in >> a; symbol x("x"); lst syms(x); ex expr = a.unarchive_ex(syms,"The expression"); cout << "expr = " << expr << endl; cout << expr.collect(x); return(0); }
Hi, On Fri, 13 Oct 2000, Ben Sapp wrote:
I have program that crashes when it uses the collect function of the ex class. The strange error I receive is:
Not a 32-bit integer: -9223372028264841216
This error comes originally from the CLN function cl_I_to_L() to convert objects of class cl_I to 32-bit integers. In GiNaC this happens when you call the method numeric::to_int().
I am able to print both the expression and the symbol I am going to use for the collect call before hand and all seems fine. I archived the symbol and expression just before I knew it would crash and I can look at the function with viewgar. However if I make a program that uses collect on the expression I get the same strange error and the program exits. Is this a bug in GiNaC? Is it a bug in my software? What could be causing this? How can I fix it?
We could call it: "GiNaC ran out of spec here". Don't know at the moment how to fix it. Please read on...
I have attached the archive file and the source to the program that reads the archive file. I did not give the source to the software that originally produced it because it is a function that is dynamically linked with another program.(GNU Octave)
The archive file is somewhat strange. I get: higgsino:~/projects$ viewgar foobar.gar The symbol = x foobar.gar: class 'name' not registered Is 'name' one of your classes? What's going on here? Can you just print the expression and mail it as it seems to be quite small? Luck -richy. -- Richard Kreckel <Richard.Kreckel@Uni-Mainz.DE> <http://wwwthep.physik.uni-mainz.de/~kreckel/> - To UNSUBSCRIBE, email to ginac-list@ginac.de with a subject of "unsubscribe".
"Richard B. Kreckel" wrote:
Hi,
On Fri, 13 Oct 2000, Ben Sapp wrote: We could call it: "GiNaC ran out of spec here". Don't know at the moment how to fix it. Please read on...
Thanks, this is nice to know.
I have attached the archive file and the source to the program that reads the archive file. I did not give the source to the software that originally produced it because it is a function that is dynamically linked with another program.(GNU Octave)
The archive file is somewhat strange. I get:
higgsino:~/projects$ viewgar foobar.gar The symbol = x foobar.gar: class 'name' not registered
Is 'name' one of your classes? What's going on here? Can you just print the expression and mail it as it seems to be quite small?
Hmmm. This is not what I see when I run viewgar. I should mention that I experience similar problems with different expressions. Most are pretty simple expressions. Here is what I see with viewgar and the file I sent earlier: [ben@pcben Linux]$ viewgar foobar.gar The symbol = x The expression = (-5.0+x)*(3.0+x^(2.0)) [ben@pcben Linux]$ viewgar -d foobar.gar Atoms: 0 class 1 symbol 2 name 3 x 4 The symbol 5 mul 6 add 7 rest 8 numeric 9 number 10 1 11 coeff 12 R-1 11529215046068469760 -61 13 overall_coeff 14 power 15 basis 16 R1 9223372036854775808 -62 17 exponent 18 R1 13835058055282163712 -62 19 The expression Expressions: 0 "The symbol" root node 0 1 "The expression" root node 10 Nodes: 0 string "class" 1 string "name" 3 1 string "class" 1 string "name" 3 2 string "class" 8 string "number" 10 3 string "class" 8 string "number" 12 4 string "class" 6 node "rest" 1 node "coeff" 2 node "overall_coeff" 3 5 string "class" 1 string "name" 3 6 string "class" 8 string "number" 16 7 string "class" 14 node "basis" 5 node "exponent" 6 8 string "class" 8 string "number" 18 9 string "class" 6 node "rest" 7 node "coeff" 2 node "overall_coeff" 8 10 string "class" 5 node "rest" 4 node "coeff" 2 node "rest" 9 node "coeff" 2 node "overall_coeff" 2 [ben@pcben Linux]$ As far as 'name' being one of my classes it is certainly possible though I can't confirm for certain. I create classes that are subclasses of octave_value. These classes then have a GiNaC type as the only member variable. So it could be a remnant of the super class. I will look into it more if you think this could be the source of the problem. Thanks. - To UNSUBSCRIBE, email to ginac-list@ginac.de with a subject of "unsubscribe".
Hi! On Sun, Oct 15, 2000 at 09:57:30AM -0600, Ben Sapp wrote:
higgsino:~/projects$ viewgar foobar.gar The symbol = x foobar.gar: class 'name' not registered
Hmmm. This is not what I see when I run viewgar.
The archive appears to have been garbled during E-mail transmission. Can you resend it as a binary attachment? Bye, Christian -- / Coding on PowerPC and proud of it \/ http://www.uni-mainz.de/~bauec002/ - To UNSUBSCRIBE, email to ginac-list@ginac.de with a subject of "unsubscribe".
The archive appears to have been garbled during E-mail transmission. Can you resend it as a binary attachment?
I have attached the file. I am not sure how it was garbled last time and it is certainly possible it was garbled this time so I have also put it on the web at http://www.neutrino.lanl.gov/~bsapp/foobar.gar. Thanks. Ben Sapp Los Alamos National Laboratory email: <mailto:bsapp@lanl.gov> Phone: (505)667-3277 Fax: (505)665-7920 URL: http://www.neutrino.lanl.gov/ --
participants (4)
-
Ben Sapp
-
Ben Sapp
-
Christian Bauer
-
Richard B. Kreckel