| Summary: | G4VoxelNavigation::ComputeStep : problem with tessellated solid | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Andrii Tykhonov <andrii.tykhonov> |
| Component: | geometry/solids | Assignee: | tatiana.nikitina |
| Status: | RESOLVED INVALID | ||
| Severity: | normal | ||
| Priority: | P5 | ||
| Version: | 9.6 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| URL: | /afs/cern.ch/work/a/andrii/public/ForGeant4/source.tgz | ||
|
Description
Andrii Tykhonov
2014-04-02 11:20:42 CEST
It appears you're trying to run a geometry with tessellated solids through Root, when tessellated solids are not available in Root. Have you discussed this with the Root developers? Dear Gabriele, Sorry if I miss the point, but I don't use ROOT in the simulation. I'm aware of the fact that ROOT doesn't support tessellated solids. This is rather a problem of geant4 geometry navigation. For example, if I apply the same to a much more simpler (but still tessellated) geometry, it works without problems... Thanks, Andrii Can you please provide a sample of a tessellated solid that fails? If you have a standalone -Geant4- example where we can reproduce the problem that would help a lot. Which version of Geant4 are you running on? 9.6.p03 ? Asking this, as the latest patch includes fixes which affect precision response by tessellated-solids. Dear Gabriele, Please find here the light-weight version of the code to reproduce the bug: /afs/cern.ch/work/a/andrii/public/ForGeant4/source.tgz Instructions for use: 1) tar -xzf source.tgz 2) cd Simulation 3) make <-- compiles the code and created executable in the $G4WORKDIR/bin directory (it is assumed that you have geant4 with gdml support installed) 4) cd $G4WORKDIR/bin/Linux-g++/ 5) cp -r [path_with_the_provided_source_code]/Geometry ./ 6) cp -r [path_with_the_provided_source_code]/test_moun_cosmics_vertical.mac ./ 7) load_gdml test_moun_cosmics_vertical.mac This will reproduce the bug. There's one caveat however.. I use "scons" utility as a software building tool, which compiles code in the way that I see the stacktrace of the error. If you use "make" utility (GNUmakefile is borrowed from geant4 G01 example), no stacktrace appears, only "Segmentation fault (core dumped)" message. I hope it is possible for you to "turn on" the stacktrace option for the "make" compiler. please let me know if experience any problem with the provided example. Thanks a lot, Andrii Thanks for providing the test. Can you please let us know exactly which version of Geant4 you're using ? Have you tried with 9.6.p03 ? Dear Gabriele, I was running geant4 9.6.p02. I will check also with the p03. Did you actually succeed to reproduce the bug, or you think it should not take place in release p03? Thanks a lot, Andrii Hi Andrii, please, try out 9.6.p03. There're fixes that may help with the problem you observe. Let us know if it helps! Cheers, Gabriele Dear Gabriele, Sorry, but even with release 9.6.po3 the problem remains. Just in case, I give a stack trace of error that I get with this release. It seems to completely identical to the one that I get with the previous release (9.6.p02) Thank you in advance, Andrii *** Break *** segmentation violation =========================================================== There was a crash. This is the entire stack trace of all threads: =========================================================== #0 0x00007f127b4a3c8e in waitpid () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007f127b42929e in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007f127d5bfdd7 in TUnixSystem::StackTrace() () from /home/andrii/root/root/lib/libCore.so #3 0x00007f127d5c26c3 in TUnixSystem::DispatchSignals(ESignals) () from /home/andrii/root/root/lib/libCore.so #4 <signal handler called> #5 0x00007f127e7ddbe8 in G4VoxelNavigation::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&, G4NavigationHistory&, bool&, CLHEP::Hep3Vector&, bool&, bool&, G4VPhysicalVolume**, int&) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4geometry.so #6 0x00007f127e7bbb9d in G4Navigator::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4geometry.so #7 0x00007f1279117030 in G4Transportation::AlongStepGetPhysicalInteractionLength(G4Track const&, double, double, double&, G4GPILSelection*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4processes.so #8 0x00007f127f155b49 in G4SteppingManager::DefinePhysicalStepLength() () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4tracking.so #9 0x00007f127f1541e6 in G4SteppingManager::Stepping() () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4tracking.so #10 0x00007f127f15ddcc in G4TrackingManager::ProcessOneTrack(G4Track*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4tracking.so #11 0x00007f127f38bfbf in G4EventManager::DoProcessing(G4Event*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4event.so #12 0x00000000004268f4 in DmpG4RunManager::ProcessOneEvent (this=0x268e240, i_event=314) at Simulation/DmpSim/src/DmpG4RunManager.cc:18 #13 0x00007f127f5f0675 in G4RunManager::DoEventLoop(int, char const*, int) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4run.so #14 0x00007f127f5f1d5c in G4RunManager::BeamOn(int, char const*, int) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4run.so #15 0x00007f127f5f941c in G4RunMessenger::SetNewValue(G4UIcommand*, G4String) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4run.so #16 0x00007f127e2348b0 in G4UIcommand::DoIt(G4String) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #17 0x00007f127e249764 in G4UImanager::ApplyCommand(char const*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #18 0x00007f127e224857 in G4UIbatch::ExecCommand(G4String const&) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #19 0x00007f127e225c2b in G4UIbatch::SessionStart() () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #20 0x00007f127e2453f3 in G4UImanager::ExecuteMacroFile(char const*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #21 0x00007f127e23df05 in G4UIcontrolMessenger::SetNewValue(G4UIcommand*, G4String) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #22 0x00007f127e2348b0 in G4UIcommand::DoIt(G4String) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #23 0x00007f127e249764 in G4UImanager::ApplyCommand(char const*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #24 0x0000000000428238 in main (argc=2, argv=0x7ffff1a0c828) at Simulation/DmpSim/src/DmpSimu.cc:100 =========================================================== The lines below might hint at the cause of the crash. If they do not help you then please submit a bug report at http://root.cern.ch/bugs. Please post the ENTIRE stack trace from above as an attachment in addition to anything else that might help us fixing this issue. =========================================================== #5 0x00007f127e7ddbe8 in G4VoxelNavigation::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&, G4NavigationHistory&, bool&, CLHEP::Hep3Vector&, bool&, bool&, G4VPhysicalVolume**, int&) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4geometry.so #6 0x00007f127e7bbb9d in G4Navigator::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4geometry.so #7 0x00007f1279117030 in G4Transportation::AlongStepGetPhysicalInteractionLength(G4Track const&, double, double, double&, G4GPILSelection*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4processes.so #8 0x00007f127f155b49 in G4SteppingManager::DefinePhysicalStepLength() () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4tracking.so #9 0x00007f127f1541e6 in G4SteppingManager::Stepping() () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4tracking.so #10 0x00007f127f15ddcc in G4TrackingManager::ProcessOneTrack(G4Track*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4tracking.so #11 0x00007f127f38bfbf in G4EventManager::DoProcessing(G4Event*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4event.so #12 0x00000000004268f4 in DmpG4RunManager::ProcessOneEvent (this=0x268e240, i_event=314) at Simulation/DmpSim/src/DmpG4RunManager.cc:18 #13 0x00007f127f5f0675 in G4RunManager::DoEventLoop(int, char const*, int) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4run.so #14 0x00007f127f5f1d5c in G4RunManager::BeamOn(int, char const*, int) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4run.so #15 0x00007f127f5f941c in G4RunMessenger::SetNewValue(G4UIcommand*, G4String) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4run.so #16 0x00007f127e2348b0 in G4UIcommand::DoIt(G4String) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #17 0x00007f127e249764 in G4UImanager::ApplyCommand(char const*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #18 0x00007f127e224857 in G4UIbatch::ExecCommand(G4String const&) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #19 0x00007f127e225c2b in G4UIbatch::SessionStart() () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #20 0x00007f127e2453f3 in G4UImanager::ExecuteMacroFile(char const*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #21 0x00007f127e23df05 in G4UIcontrolMessenger::SetNewValue(G4UIcommand*, G4String) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #22 0x00007f127e2348b0 in G4UIcommand::DoIt(G4String) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #23 0x00007f127e249764 in G4UImanager::ApplyCommand(char const*) () from /home/andrii/geant4_9.p03/geant4.9.6-install/lib/libG4intercoms.so #24 0x0000000000428238 in main (argc=2, argv=0x7ffff1a0c828) at Simulation/DmpSim/src/DmpSimu.cc:100 =========================================================== WARNING - Attempt to delete the physical volume store while geometry closed ! WARNING - Attempt to delete the logical volume store while geometry closed ! WARNING - Attempt to delete the solid store while geometry closed ! WARNING - Attempt to delete the region store while geometry closed ! Dear Geant4 experts, Is there any update on the status of the problem? Thanks a lot in advance, Andrii Dear Andrii,
Thank you for the message.
I can not compile your test. May be something is missing?
I have following errors when using cmake :
-- Configuring done
CMake Error at CMakeLists.txt:34 (add_executable):
Cannot find source file:
load_gdml.cc
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
Thank you in advance,
Best Regards,
Tatiana.
(In reply to comment #10) > Dear Andrii, > > Thank you for the message. > I can not compile your test. May be something is missing? > I have following errors when using cmake : > > -- Configuring done > CMake Error at CMakeLists.txt:34 (add_executable): > Cannot find source file: > > load_gdml.cc > > Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp > .hxx .in .txx > > > Thank you in advance, > > Best Regards, > Tatiana. Dear Tatiana, Could you please compile it with "make" (not "cmake"), it doesnt't work with cmake.. Here are the step-by-step instructions to follow: 1) tar -xzf source.tgz 2) cd Simulation 3) make <-- compiles the code and created executable in the $G4WORKDIR/bin directory (it is assumed that you have geant4 with gdml support installed) 4) cd $G4WORKDIR/bin/Linux-g++/ 5) cp -r [path_with_the_provided_source_code]/Geometry ./ 6) cp -r [path_with_the_provided_source_code]/test_moun_cosmics_vertical.mac ./ 7) load_gdml test_moun_cosmics_vertical.mac Please let me know if you still have problems with this.. Thanks! Andrii Dear Andrii, I think that 'load_gdml.cc' is missing in the test. Could you send me this file? Thank you, Tatiana. (In reply to comment #12) > Dear Andrii, > > I think that 'load_gdml.cc' is missing in the test. > > Could you send me this file? > > Thank you, > Tatiana. Dear Tatiana, Sorry, indeed my mistake. Please find the corrected tarball here: /afs/cern.ch/work/a/andrii/public/ForGeant4/source.tgz I have also changed the "Simulation" to "load_gdml", i.e. on step 2 do: "cd load_gdml" instead of "cd Simulation" Please let me know if you succeed to compile it.. Thank you! Andrii Dear Andrii,
Thank you, now I can run your test.
I used geant4.9.p02 and geant4.9.6.p03.
I don't have crashes, but many of following messages :
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomNav1002
issued by : G4Navigator::ComputeStep()
Track stuck or not moving.
Track stuck, not moving for 10 steps
in volume -kx-b1_PV- at point (547.415,18.767,690)
direction: (0.00115126,-0.000731656,0.999999).
Potential geometry or navigation problem !
Trying pushing it of 1e-07 mm ...Potential overlap in geometry!
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomNav1002
issued by : G4Navigator::ComputeStep()
Track stuck or not moving.
Track stuck, not moving for 10 steps
in volume -World_PV- at point (349.133,-521.069,689.5)
direction: (-0.00113592,0.000482204,0.999999).
Potential geometry or navigation problem !
Trying pushing it of 1e-07 mm ...Potential overlap in geometry!
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
It seems, that the Geometry description has a problem, possibly overlaps or bad solid definition, for example wrong orientation of Facets of Tessellated Solid.
Could you, please, check this?
Best Regards,
Tatiana.
Could you
Dear Tatiana,
Indeed, there are some small overlaps in the geometry (I used to observe them before, but they seemed to be quite harmless, the code was running okay). The strange thing is that exactly with the same geant4 version I get the segmentation fault, while you don't.. In this view, could you please answer two following questions:
1) Which exact message do you get in the end? For example, in my case it is "Segmentation fault (core dumped)":
....
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomNav1002
issued by : G4Navigator::ComputeStep()
Track stuck or not moving.
Track stuck, not moving for 10 steps
in volume -kx-b1_PV- at point (-488.776,148.881,690)
direction: (0.000156488,-0.00450514,0.99999).
Potential geometry or navigation problem !
Trying pushing it of 1e-07 mm ...Potential overlap in geometry!
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
Segmentation fault (core dumped)
2) Which operating system are you running? (I'm using Ubuntu 12.04)
Many thanks,
Andrii
(In reply to comment #14)
> Dear Andrii,
>
> Thank you, now I can run your test.
> I used geant4.9.p02 and geant4.9.6.p03.
>
> I don't have crashes, but many of following messages :
>
> -------- WWWW ------- G4Exception-START -------- WWWW -------
> *** G4Exception : GeomNav1002
> issued by : G4Navigator::ComputeStep()
> Track stuck or not moving.
> Track stuck, not moving for 10 steps
> in volume -kx-b1_PV- at point (547.415,18.767,690)
> direction: (0.00115126,-0.000731656,0.999999).
> Potential geometry or navigation problem !
> Trying pushing it of 1e-07 mm ...Potential overlap in geometry!
>
> *** This is just a warning message. ***
> -------- WWWW -------- G4Exception-END --------- WWWW -------
>
> -------- WWWW ------- G4Exception-START -------- WWWW -------
> *** G4Exception : GeomNav1002
> issued by : G4Navigator::ComputeStep()
> Track stuck or not moving.
> Track stuck, not moving for 10 steps
> in volume -World_PV- at point (349.133,-521.069,689.5)
> direction: (-0.00113592,0.000482204,0.999999).
> Potential geometry or navigation problem !
> Trying pushing it of 1e-07 mm ...Potential overlap in geometry!
>
> *** This is just a warning message. ***
> -------- WWWW -------- G4Exception-END --------- WWWW -------
>
> It seems, that the Geometry description has a problem, possibly overlaps or bad
> solid definition, for example wrong orientation of Facets of Tessellated Solid.
> Could you, please, check this?
>
> Best Regards,
> Tatiana.
> Could you
Dear Andrii, I did not waited enough, in the end I also have segmentation fault in G4VoxelNavigation::ComputeStep(). I'm using Scientific Linux 6. The problem is that your geometry, even in this simplified example, is complicated. It is difficult to isolate a solid, that causes this problem. You told, that by removing some solids, your program is working fine. What solid did you removed? With removed solid geometry is still reporting overlaps? Thank you in advance, Tatiana. (In reply to comment #16) > Dear Andrii, > > I did not waited enough, in the end I also have segmentation fault in > G4VoxelNavigation::ComputeStep(). > I'm using Scientific Linux 6. > > The problem is that your geometry, even in this simplified example, is > complicated. It is difficult to isolate a solid, that causes this problem. > You told, that by removing some solids, your program is working fine. > What solid did you removed? With removed solid geometry is still reporting > overlaps? > > Thank you in advance, > Tatiana. Dear Tatiana, Thank you for the reply! The problematic solid is: <physvol name="embeded" > <file name="./Geometry/BGO/embeded.gdml" /> <rotationref ref="adjust_Rot" /> </physvol> in the Geometry/BGO.gdml file. Once I remove it, the code runs okay. Note that the "overlap" errors are still reported in this case. Please let me know if you need any additional info. Thanks! Andrii Dear Andrii,
Even with removed 'embeded.gdml' for me segmentation violation persists.
Your "BGO" detector is overlapping with other parts in detector :
G4GDML: Reading module './Geometry/BGO.gdml' done!
Checking overlaps for volume BGO_detector_vol_PV ...
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
Overlap is detected for volume BGO_detector_vol_PV
with kx-b1_PV volume's
local point (100.798,450,401.432), overlapping by at least: 2.97123 mm
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW ------
This can be a raison for the crash.
This type of crashes in Navigator can happen when your geometry is ill-defined(overlaps, bed definition of tessels in TessellatedSolid).
Other possibility of error could be the precision of Tessellation algorithm, may be the original solids were not overlapping, but conversion to the Tessellated solids contains overlaps.
I propose to you to check and improve your geometry by removing overlaps. If problem persists, try to look how the tessellation is done, if there is possibility of errors, or hole inside Tessellated Solids.
Best Regards,
Tatiana
Dear Tatiana, I have investigated the geometry in more details. Indeed it seems that the problem is not only with the 'embeded.gdml'. Depending on how I set the initial seed the problem may fire even without having this volume included. I will follow your suggestion and try to check/refince the the CAD-gdml conversion step to see where possible overlaps/ill-defined geometries occur. Thanks for your help! Andrii (In reply to comment #18) > Dear Andrii, > > Even with removed 'embeded.gdml' for me segmentation violation persists. > > Your "BGO" detector is overlapping with other parts in detector : > > G4GDML: Reading module './Geometry/BGO.gdml' done! > Checking overlaps for volume BGO_detector_vol_PV ... > -------- WWWW ------- G4Exception-START -------- WWWW ------- > *** G4Exception : GeomVol1002 > issued by : G4PVPlacement::CheckOverlaps() > Overlap with volume already placed ! > Overlap is detected for volume BGO_detector_vol_PV > with kx-b1_PV volume's > local point (100.798,450,401.432), overlapping by at least: 2.97123 > mm > *** This is just a warning message. *** > -------- WWWW -------- G4Exception-END --------- WWWW ------ > > This can be a raison for the crash. > > This type of crashes in Navigator can happen when your geometry is > ill-defined(overlaps, bed definition of tessels in TessellatedSolid). > Other possibility of error could be the precision of Tessellation algorithm, > may be the original solids were not overlapping, but conversion to the > Tessellated solids contains overlaps. > > I propose to you to check and improve your geometry by removing overlaps. If > problem persists, try to look how the tessellation is done, if there is > possibility of errors, or hole inside Tessellated Solids. > > Best Regards, > Tatiana Dear Andrii, Could you find and remove the overlaps in your application? Did it solve the problem with Navigation with Tessellated Solid? Best Regards, Tatiana Problem is closed. Crashes in VoxelNavigation with tesselleted solid most probably due to overlaps in user geometry. |