Please read tips for efficient and successful posting and posting code
ROOT Version: 6.26
Platform: Ubuntu 22.04.1
Compiler: Cling
Hello everyone,
I am trying of design an array of 20 silicon pixeled detectors and I am getting this crash:
root [0]
Processing active_target_geometry_pixeled.C...
Info in <TGeoManager::TGeoManager>: Geometry manager, Active Target Geometry created
Info in <TGeoManager::SetTopVolume>: Top volume is Top. Master volume is Top
Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100
Info in <TGeoManager::CheckGeometry>: Fixing runtime shapes...
Info in <TGeoManager::CheckGeometry>: ...Nothing to fix
Info in <TGeoManager::CloseGeometry>: Counting nodes...
Info in <TGeoManager::Voxelize>: Voxelizing...
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x00007f6b93bd745a in __GI___wait4 (pid=276781, stat_loc=stat_loc
entry=0x7ffe34cd9618, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1 0x00007f6b93bd741b in __GI___waitpid (pid=<optimized out>, stat_loc=stat_loc
entry=0x7ffe34cd9618, options=options
entry=0) at ./posix/waitpid.c:38
#2 0x00007f6b93b3dbcb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:171
#3 0x00007f6b9428b8a4 in TUnixSystem::StackTrace() () from /home/solne/root/lib/libCore.so.6.26
#4 0x00007f6b94288bb5 in TUnixSystem::DispatchSignals(ESignals) () from /home/solne/root/lib/libCore.so.6.26
#5 <signal handler called>
#6 0x00007f6b79579aaa in TGeoVoxelFinder::SortAll(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#7 0x00007f6b7957af6e in TGeoVoxelFinder::Voxelize(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#8 0x00007f6b795724cf in TGeoVolume::Voxelize(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#9 0x00007f6b794ea0e8 in TGeoManager::Voxelize(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#10 0x00007f6b794f39cf in TGeoManager::CloseGeometry(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#11 0x00007f6b93f65617 in ?? ()
#12 0x000003ff00000000 in ?? ()
#13 0x0000000000000000 in ?? ()
===========================================================
The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum https://root.cern/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6 0x00007f6b79579aaa in TGeoVoxelFinder::SortAll(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#7 0x00007f6b7957af6e in TGeoVoxelFinder::Voxelize(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#8 0x00007f6b795724cf in TGeoVolume::Voxelize(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#9 0x00007f6b794ea0e8 in TGeoManager::Voxelize(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#10 0x00007f6b794f39cf in TGeoManager::CloseGeometry(char const*) () from /home/solne/root/lib/libGeom.so.6.26.10
#11 0x00007f6b93f65617 in ?? ()
#12 0x000003ff00000000 in ?? ()
#13 0x0000000000000000 in ?? ()
===========================================================
This is the sample code where the pixel volume is defined, and then placed with the help of three for loops:
TGeoVolume *top = manager->MakeBox("Top", Air, 100, 100, 200); //units in mm
manager->SetTopVolume(top);
//MAPSpixel
Double_t xPixel = 0.02924, yPixel = 0.02688, zPixel = 0.1;
TGeoVolume *volumePixel = manager->MakeBox("volumePixel", MAPSmedium, xPixel/2., yPixel/2., zPixel/2.);
Int_t numberPlanes = 20;
Double_t distBetweenPlanes = 8.;
Int_t numPixels = 1024;
for(int k = 0; k < numberPlanes; k++){
for (int i = 0; i < numPixels; i++){
for (int j = 0; j < numPixels; j++){
top->AddNode(volumePixel, i*10000+j, new TGeoTranslation(xPixel*(0.5-512+j), yPixel*(512-0.5-i), k*distBetweenPlanes));
}
}
}
manager->CloseGeometry();
top->Draw("ogl");
I think it could be related with memory allocation corruption, but I am not sure. What should I do to solve this predicament?
Thank you in advance.