Message: Re: debug crashing in a 64-bit system Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: debug crashing in a 64-bit system 

Forum: Installation and Configuration
Re: None debug crashing in a 64-bit system (Zhiyi Liu)
Date: 04 Jan, 2010
From: Paul Nicholas Colin Gloster <Paul Nicholas Colin Gloster>

On Sun, 3 Jan 2010, Zhiyi Liu submitted:

|------------------------------------------------------------------------------------------------------------------|
|"[..]                                                                                                             |
|                                                                                                                  |
|[..]                                                                                                              |
|[..] For the same package, it is working for the 64-bit Geant4                                                    |
|version, but for some events, it crashed. However, it is weird to notice                                          |
|that the same package is working for the 32-bit Geant4 version without                                            |
|any crash. That is to say, the event causing the crashing in the 64-bit                                           |
|system is okay for the 32-bit system. The crash dumped message is below.                                          |
|I cannot understand what is wrong here. [..]                                                                      |
|[..]                                                                                                              |
|                                                                                                                  |
|[..]                                                                                                              |
|                                                                                                                  |
|32-bit system: geant4-09-01-patch-01 Linux 2.6.18-128.7.1.el5 #1 SMP Mon                                          |
|Aug 24 08:22:26 EDT 2009 i686 athlon i386 GNU/Linux                                                               |
|                                                                                                                  |
|64-bit system: geant4-09-01-patch-01 Linux 2.6.18-128.7.1.el5 #1 SMP Mon                                          |
|Aug 24 08:12:52 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux                                                           |
|                                                                                                                  |
|Cheers, Zhiyi.                                                                                                    |
|                                                                                                                  |
| *** Break *** segmentation violation                                                                             |
|[..]                                                                                                              |
|[Thread debugging using libthread_db enabled]                                                                     |
|[..]                                                                                                              |
|#5  0x00002b6f34c504b0 in G4ParticleDefinition::GetPDGMass (this=0x0)                                             |
|    at /home/pienumgr/apps64/recomp/geant4.9.1.p01/source/particles/management/include/G4ParticleDefinition.hh:116|
|#6  0x00002b6f376b55ff in G4DynamicParticle::SetDefinition (this=0x17cc36e0,                                      |
|    aParticleDefinition=0x0) at src/G4DynamicParticle.cc:322                                                      |
|#7  0x00002b6f36086831 in G4HEInelastic::FillParticleChange (this=0x16046bd0,                                     |
|    pv=0x17f43808, aVecLength=9) at src/G4HEInelastic.cc:76                                                       |
|#8  0x00002b6f3609bcb1 in G4HEPionMinusInelastic::ApplyYourself (                                                 |
|    this=0x16046bd0, aTrack=@0x7ffff711b290, targetNucleus=@0x7ffff711b5a0)                                       |
|    at src/G4HEPionMinusInelastic.cc:190                                                                          |
|[..]"                                                                                                             |
|------------------------------------------------------------------------------------------------------------------|


Hello,

You would suffer a segmentation violation, as you did, by trying to
call a function belonging to a C++ object pointed to by a pointer if
the pointer does not actually point to an object. Geant tried to call
G4ParticleDefinition::GetPDGMass but the "(this=0x0)" on Line #5 of
the debugging output which you sent shows that Geant was trying to use
a pointer which was not pointing to a G4ParticleDefinition object.

You might try to use a debugger to step through the function void
G4HEInelastic::FillParticleChange(G4HEVector pv[], G4int aVecLength)
in the file  G4HEInelastic.cc  whose version in Geant4.9.2 (I have not
checked the older version which you mentioned) was...

void  G4HEInelastic::FillParticleChange(G4HEVector pv[], G4int aVecLength)
{
  theParticleChange.Clear();
  for (G4int i=0; i<aVecLength; i++)
  {
    G4int pdgCode = pv[i].getCode();
    G4ParticleDefinition * aDefinition=NULL;
    if(pdgCode == 0)
    {
      G4int bNumber = pv[i].getBaryonNumber();
      if(bNumber==2) aDefinition = G4Deuteron::Deuteron();
      if(bNumber==3) aDefinition = G4Triton::Triton();
      if(bNumber==4) aDefinition = G4Alpha::Alpha();
    }
    else
    {
     aDefinition =
     G4ParticleTable::GetParticleTable()->FindParticle(pdgCode);
    }
    G4DynamicParticle * aParticle = new G4DynamicParticle();
    aParticle->SetDefinition(aDefinition);
    /*The following statements are not reached for Zhiyi Liu with a
    64bit operating system...*/
  }
}

When debugging in that function, check which statement assigns to the
pointer  aDefinition  and consider whether or not what happens in that
assignment statement seems to be reasonable.

Perhaps Geant4 is buggy for 64bit systems. Perhaps you are using a
buggy 64bit operating system or compiler. Try using a different
version of Geant or a different operating system or a different
compiler.

If the fault is with Geant and if the fault only manifests itself for
64bit systems, then you could consider installing a 32bit operating
system on the 64bit machines.

Regards,
Colin Paul Gloster

 Add Message Add Message
to: "Re: debug crashing in a 64-bit system"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]