Message: modifying geometry between run leads to segment fault Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question modifying geometry between run leads to segment fault 

Forum: Geometry
Date: 26 Feb, 2018
From: Ruirui <Ruirui>

Dear Geant4 experts and users: I want to run a PET simulation, and I use the B3 example to achieve my gold. What I want to implement is modifying the geometry. And the modification is very simple, I change the rotation angle of the patient between runs. But I found a quite strange effect: It seems that the code is running OK in the sequential mode, but it will crash after 55 times run in the multithreading mode. I do not know why it is like this:

Here are the gdb debugging results when the code crash and lead to a segment fault. In this run, I set the thread number as 2.

Thread 2 "exampleB3a" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffea661700 (LWP 17376)] 0x00007ffff3ba6f90 in __dynamic_cast () from /usr/lib/x86_64-linux-gnu/ (gdb) where

#0  0x00007ffff3ba6f90 in __dynamic_cast () from /usr/lib/x86_64-linux-gnu/
#1  0x00007ffff5f89faf in G4VUserDetectorConstruction::SetSensitiveDetector(G4LogicalVolume*, G4VSensitiveDetector*) () from /home/ruirui/g4_install/lib/
#2  0x00007ffff5f8aee5 in G4VUserDetectorConstruction::SetSensitiveDetector(G4String const&, G4VSensitiveDetector*, bool) () from /home/ruirui/g4_install/lib/
#3  0x00000000004126d6 in B3DetectorConstruction::ConstructSDandField() ()
#4  0x00007ffff5f6e347 in G4WorkerRunManager::InitializeGeometry() () from /home/ruirui/g4_install/lib/
#5  0x00007ffff5f61ad2 in G4RunManager::Initialize() () from /home/ruirui/g4_install/lib/
#6  0x00007ffff5f62277 in G4RunManager::ConfirmBeamOnCondition() () from /home/ruirui/g4_install/lib/
#7  0x00007ffff5f61585 in G4RunManager::BeamOn(int, char const*, int) () from /home/ruirui/g4_install/lib/
#8  0x00007ffff5f6ef1b in G4WorkerRunManager::DoWork() () from /home/ruirui/g4_install/lib/
#9  0x00007ffff5f7afcf in G4MTRunManagerKernel::StartThread(void*) () from /home/ruirui/g4_install/lib/
#10 0x00007ffff33e66ba in start_thread (arg=0x7fffea661700) at pthread_create.c:333
#11 0x00007ffff311c41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
Do you have any idea on why it crash like this way?

Best regards,

 Add Message Add Message
to: "modifying geometry between run leads to segment fault"

 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 ]