segmentation fault in simplify_indexed --> solved?
Hello everybody, I think I have solved an error in GiNaC that sometimes (only in special circumstances) causes a segmentation fault when *simplify_indexed* is called. The problem occurs when the function *diracgamma::contract_with* is sometimes called with the arguments *self* and *other* pointing to two gamma matrices of different representation label. In that case it can happen that there is a gamma5 in between and that the function *base_and_index* is called with the gamma5 in its first argument. This is wrong because base_and_index tries to look at operand number 1, which does not exist for a gamma5. This then may cause a segmentation fault. It never happens for gamma matrices of the same rep. label because the gamma5 has been permuted out of the way then. I found that the segmentation fault dissapears when inside the first *if* in *diracgamma::contract_with* I add a test that checks if rep. labels are equal (the contract-gamma-matrices algorithms there, do not seem to make much sense if rep. lables are different anyway). After my addition the code looks like if (is_a<clifford>(*other)) { unsigned char rl2 =ex_to<clifford>(*other).get_representation_label(); if(rl!=rl2) return false; ex dim = ex_to<idx>(self->op(1)).get_dim(); where the first and last line are yours and the three in the middle are mine. (BTW this is GiNaC-1.0.8). Greetings, Chris
Hi! On Tue, Jun 25, 2002 at 03:30:37PM +0200, Chris Dams wrote:
I found that the segmentation fault dissapears when inside the first *if* in *diracgamma::contract_with* I add a test that checks if rep. labels are equal
Yes, this makes sense. Thanks! Bye, Christian -- / Coding on PowerPC and proud of it \/ http://www.uni-mainz.de/~bauec002/
participants (2)
-
Chris Dams
-
Christian Bauer