Problem 1574 - no argument checking
Summary: no argument checking
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: 10.0
Hardware: All All
: P5 trivial
Assignee: tatiana.nikitina
URL:
Depends on:
Blocks:
 
Reported: 2014-02-20 22:39 CET by Hans Wenzel
Modified: 2014-02-21 17:29 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Hans Wenzel 2014-02-20 22:39:38 CET
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>
Comment 1 tatiana.nikitina 2014-02-21 09:37:52 CET
Dear Hans,

Thank you very much for reporting this problem.
This validity check is already introduced in Geant4.9.p02.

Best Regards,
Tatiana
Comment 2 Hans Wenzel 2014-02-21 16:33:08 CET
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
Comment 3 tatiana.nikitina 2014-02-21 16:56:55 CET
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.
Comment 4 Hans Wenzel 2014-02-21 17:29:09 CET
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