Problem 266 - Program crashes when calling G4BREPSolidPolyhedra
Summary: Program crashes when calling G4BREPSolidPolyhedra
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: 2.0
Hardware: PC Linux
: P1 major
Assignee: Radovan.Chytracek
URL:
Depends on:
Blocks:
 
Reported: 2001-06-20 06:27 CEST by lazaro
Modified: 2001-08-01 15:58 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description lazaro 2001-06-20 06:27:46 CEST
In my simulation, I have created an hexagon using G4BREPSolidPolyhedra:

// hexagonal hole

  solidCollimHoleP=NULL; logicCollimHoleP=NULL; physiCollimHoleP=NULL;

  G4double holeR = CollimHoleDiameter/2.;
  G4double *zValues = new G4double[2];
  zValues[0]= -CollimHeight/2;
  zValues[1]= CollimHeight/2;
  G4double *rMinValues = new G4double[2];
  rMinValues[0] = 0.;
  rMinValues[1] = 0.;
  G4double *rMaxValues = new G4double[2];
  rMaxValues[0] = holeR;
  rMaxValues[1] = holeR;

  solidCollimHoleP = new G4BREPSolidPolyhedra("HoleP",0.,twopi,6,2,
                   -CollimHeight/2,zValues,rMinValues,rMaxValues);

  logicCollimHoleP = new G4LogicalVolume(solidCollimHoleP,defaultMaterial,
                                         "HoleP");

  physiCollimHoleP = new G4PVPlacement(0,G4ThreeVector(),"HoleP",
                   logicCollimHoleP,physiCollim,false,0);

When I run the program, I obtained this message:

Program received signal SIGSEGV, Segmentation fault.
__libc_free (mem=0xffffffc5) at malloc.c:3005
3005	malloc.c: No such file or directory.
(gdb) #1  0x83910b1 in __builtin_vec_delete (ptr=0xffffffc5)
Current language:  auto; currently c++
(gdb) #2  0x80885c3 in G4BREPSolidPolyhedra::~G4BREPSolidPolyhedra ()
(gdb) #3  0x83c062e in G4RWTPtrOrderedVector<G4VSolid>::clearAndDestroy ()
(gdb) #4  0x81d23c0 in G4SolidStore::~G4SolidStore ()
(gdb) #5  0x81d2477 in __tcf_0 ()
(gdb) #6  0x4019c23a in exit (status=1) at exit.c:57
57	exit.c: No such file or directory.
Current language:  auto; currently c
(gdb) #7  0x808e81e in G4Ray::RayCheck ()
(gdb) #8  0x808d6d6 in G4FPlane::CalcNormal ()
(gdb) #9  0x808d335 in G4FPlane::G4FPlane ()
(gdb) #10 0x8085844 in G4BREPSolidPolyhedra::G4BREPSolidPolyhedra ()
(gdb) #11 0x805056e in crysDetectorConstruction::ConstructCamera ()
(gdb) #12 0x8052ea5 in crysDetectorConstruction::UpdateGeometry ()
(gdb) #13 0x80564c4 in crysDetectorMessenger::SetNewValue ()
(gdb) #14 0x81f127e in G4UIcommand::DoIt ()
(gdb) #15 0x8203309 in G4UImanager::ApplyCommand ()
(gdb) #16 0x8202a99 in G4UImanager::ApplyCommand ()
(gdb) #17 0x820f9a4 in G4UIbatch::SessionStart ()
(gdb) #18 0x82028eb in G4UImanager::ExecuteMacroFile ()
(gdb) #19 0x82113d1 in G4UIcontrolMessenger::SetNewValue ()
(gdb) #20 0x81f127e in G4UIcommand::DoIt ()
(gdb) #21 0x8203309 in G4UImanager::ApplyCommand ()
(gdb) #22 0x8202a99 in G4UImanager::ApplyCommand ()
(gdb) #23 0x804d632 in main ()
(gdb) #24 0x401939cb in __libc_start_main (main=0x804d41c <main>, argc=1,
    argv=0xbfffe6a4, init=0x804c310 <_init>, fini=0x83c5b74 <_fini>,
    rtld_fini=0x4000aea0 <_dl_fini>, stack_end=0xbfffe69c)
    at ../sysdeps/generic/libc-start.c:92

I've tried to run the same program with G4BREPSolidPcone instead of
G4BREPSolidPolyhedra and it works.

Thank you very much in advance for your help.
Comment 1 Gabriele Cosmo 2001-06-20 08:13:59 CEST
From the trace dump provided the program enters in an 'exit'
state in G4Ray::RayCheck(), as expected if the ray's direction is
set to zero. Might be a problem in the user's geometry.
To be investigated.
Comment 2 Gabriele Cosmo 2001-06-20 08:17:59 CEST
Additional information required, values for:
CollimHoleDiameter, CollimHeight, holeR.
Comment 3 Radovan.Chytracek 2001-08-01 15:57:59 CEST
I have fixed the G4BREPSolidPolyhedra so that now handles the special case when
dphi = 2*pi and all RMIN values are 0.0. The geometry should be visible at the
attached URL. The fix will apparently appear after testing in the new reference
tag.
Comment 4 Radovan.Chytracek 2001-08-01 15:58:59 CEST
Ooops, the URL is http://cern.ch/radoone/g4/bug266geom.jpg