Home » PANDA » PandaRoot » Bugs, Fixes, Releases » Problems with integer FairTrackPar charge
Re: Problems with integer FairTrackPar charge [message #9429 is a reply to message #9428] |
Mon, 21 September 2009 14:46 |
Mohammad Al-Turany
Messages: 518 Registered: April 2004 Location: GSI, Germany
|
first-grade participant |
From: *gsi.de
|
|
Hi,
I manage to repruduce the crash on Debian Etch 32, and it is in the FairGeaneUtil:
Quote: | Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread -1229228352 (LWP 18037)]
0xb3fe5bc1 in FairGeaneUtil::FromSDToMars (this=0xbfc1e124, PC=0xbfc1e0d8,
RC=0xbfc1dfd0, H=0xbfc1e0f0, CH=0, SP1=1, DJ1=0xbfc1e6a0, DK1=0xbfc1e6b8,
PD=0xbfc1e108, RD=@0xbfc1deb0)
at /misc/turany/svn/pandaroot/trackbase/FairGeaneUtil.cxx:1485
1485 M65[0][0] = - SPU*PM2*PC[1]/(CH*PVW);
|
So as you can see it is a division by zero! and this comes from the CH = 0 which comes in this case from FairTrackParP:
fq= int (P * fQp);
As Stefano suggested replacing this with
fq = (int)TMath::Sign(1.0, fQp)
Solves the problem. I tried to print out the values for these two functions using 32 and 64 bit mashines:
on 32-bit:
Quote: | FairTrackParP::FairTrackParP fq = (int)TMath::Sign(1.0, fQp); P =2.046 fQp = -0.4887 fq = -1
FairTrackParP::FairTrackParP fq= int (P * fQp); P =2.046 fQp = -0.4887 fq = 0
|
and the same code on 64 bit:
Quote: | FairTrackParP::FairTrackParP fq = (int)TMath::Sign(1.0, fQp); P =1.957 fQp = -0.5109 fq = -1
FairTrackParP::FairTrackParP fq= int (P * fQp); P =1.957 fQp = -0.5109 fq = -1
|
which explain why I could not reproduce this problem before!
Anyway, the change suggested by Stefano is now in SVN (-r 6568)
regards
Mohammad
|
|
|
Goto Forum:
Current Time: Sun Nov 03 23:56:18 CET 2024
Total time taken to generate the page: 0.00800 seconds
|