Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

As the title says, kernel crashes when running the code below as a cadabra notebook (.cnb) (specifically, when running the substitute algorithm)

{t}::Coordinate;

viel := {
                ei^{t}_{t} = Q / (f**2 - Q**2)
           };

substitute(viel, $ f = (Q**2 - \alpha / r**4 )**(1/2) $);

Running it as a .cdb file in a terminal, the error given is "realloc(): Invalid old size".

Here is a variation of the code where it still crashes:

{t}::Coordinate;

viel := {
                ei^{t}_{t} = Q / (f - Q**2)
           };

substitute(viel, $ f = (Q**2 - \alpha / r**4 ) $);

The code doesn't crash, however, if I factorize a minus sign in the denominator, as in

{t}::Coordinate;

viel := {
                ei^{t}_{t} = - Q / (Q**2 - f**2)
           };

substitute(viel, $ f = (Q**2 - \alpha / r**4 )**(1/2) $);

or if I pass the numerator to the denominator

{t}::Coordinate;

viel := {
                ei^{t}_{t} = 1 / ( (f**2 - Q**2) / Q )
           };

substitute(viel, $ f = (Q**2 - \alpha / r**4 )**(1/2) $);
in Bug reports by (130 points)

1 Answer

0 votes

This was due to an issue when simplifying powers of rationals, in particular things of the form $(-a)^{-1}$, which left unsimplified rationals in the expression tree.

This is now fixed in 2.4.3.2 available on the github master branch.

by (70.9k points)
...