| Summary: | no argument checking | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Hans Wenzel <wenzel> |
| Component: | geometry/solids | Assignee: | tatiana.nikitina |
| Status: | RESOLVED FIXED | ||
| Severity: | trivial | ||
| Priority: | P5 | ||
| Version: | 10.0 | ||
| Hardware: | All | ||
| OS: | All | ||
Dear Hans, Thank you very much for reporting this problem. This validity check is already introduced in Geant4.9.p02. Best Regards, Tatiana Hi I haven't looked at the code itself if there is parameter checking but the example that I send was run using the latest geant 4.10 on macosx mountain lion. Which still produced the segmentation fault. Hans Dear Hans, I have verified again on my Linux machine, the check is working, the Polycone with wrong parameters is not created, I tested it with G01 example and wrong parameters for Polycone. By looking in the code of G4Polycone.cc(lines 80-94) you can see that protection is present in Geant4.10 Could you verify that you are using Gent4.10? Or any other informations about your system and your application will be helpful for clear this problem. Thank you in advance, Best regards, Tatiana. Hi
Using a simpler gdml file I can confirm the check is done and an exception is thrown when unvalid arguments are used. I checked on macosx mountain lion with geant 4.10.00. and linux SL6. Thanks so much.
Hans
G4GDML: Reading 'detectorenvelope_f.gdml'...
G4GDML: Reading definitions...
G4GDML: Reading materials...
G4GDML: Reading solids...
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : GeomSolids0002
issued by : G4Polycone::G4Polycone()
Cannot create a Polycone with rInner > rOuter for the same Z
rInner > rOuter for the same Z !
rMin[5] = 550 -- rMax[5] = 74
*** Fatal Error In Argument *** core dump ***
-------- EEEE -------- G4Exception-END --------- EEEE -------
*** G4Exception: Aborting execution ***
Abort trap: 6
|
Hi This is aa follow up on a user complaint. The user had a mistake in the definition of a policone and geant 4 just produced a segmentation fault in the later versions of geant 4 (he reported earlier versions just didn't create the policone) there seems to be no checking of the validity of the arguments which would make life much easier. Hans the following works <solids> <box name="WorldBox" lunit="m" x="10" y="10" z="50"/> <tube name="DetectorBox" lunit="m" z="6." rmax="5.5" deltaphi="TWOPI" aunit="rad"/> <polycone aunit="degree" name="testpoly" deltaphi="360.0" startphi="0.0"> <zplane z="10.0" rmin="1.0" rmax="5.0"/> <zplane z="100.0" rmin="10.0" rmax="30.0"/> </polycone> </solids> this will crete a seg fault: <solids> <box name="WorldBox" lunit="m" x="10" y="10" z="50"/> <tube name="DetectorBox" lunit="m" z="6." rmax="5.5" deltaphi="TWOPI" aunit="rad"/> <polycone aunit="degree" name="testpoly" deltaphi="360.0" startphi="0.0"> <zplane z="10.0" rmin="5.0" rmax="1.0"/> <zplane z="100.0" rmin="10.0" rmax="30.0"/> </polycone> </solids>