Problem 45 - Visualisation of sphere crashes when delta-phi/delta-theta too small
Summary: Visualisation of sphere crashes when delta-phi/delta-theta too small
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: graphics_reps (show other problems)
Version: 1.0
Hardware: PC Linux
: P2 major
Assignee: John.Allison
URL:
Depends on:
Blocks:
 
Reported: 1999-12-17 08:34 CET by V.Hejny
Modified: 2000-01-12 06:52 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description V.Hejny 1999-12-17 08:34:30 CET
To describe the problem consider the following code:

---
  G4Sphere* PD_vol_crystal
      = new G4Sphere("Test",
                     16.7*cm,           // inner radius
                     28.7*cm,           // outer radius
                     0.,                // start phi
                     5.*degree,         // delta phi
                     0.,                // start theta
                     5.*degree          // delta theta
                     );


  G4cout << "-> "
         << PD_vol_crystal->GetInsideRadius()/cm << ", "
         << PD_vol_crystal->GetOuterRadius()/cm << ", "
         << PD_vol_crystal->GetStartPhiAngle()/degree << ", "
         << PD_vol_crystal->GetDeltaPhiAngle()/degree << ", "
         << PD_vol_crystal->GetStartThetaAngle()/degree << ", "
         << PD_vol_crystal->GetDeltaThetaAngle()/degree << endl;

  G4LogicalVolume* PD_log_crystal
    = new G4LogicalVolume(PD_vol_crystal,PWO,"Test");

  G4RotationMatrix rm;

  G4PVPlacement* PD_physical
    = new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(0,0,0)),
                        "PD_physical", PD_log_crystal,
                        experimentalHall_phys,false,0);
---

When using the code above, the program crashes when issuing the
/vis/draw/current command:Idle> /vis~/draw/current
G4Scene::AddWorldIfEmpty: The scene was empty,
   "world" has been added.
G4VisManager: the scene was empty, "world" has been added
  and the view parameters have been reset.
Traversing scene data...
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x40cfc926 in free ()
(gdb) backtrace
#0  0x40cfc926 in free ()
#1  0x40cfc01a in   ()
#2  0x40cfc665 in malloc ()
#3  0x40cfc0f5 in malloc ()
#4  0x829d900 in basic_string<char, string_char_traits<char>,
__default_alloc_template<true, 0> >::replace ()
#5  0x82cfb4c in G4strstreambuf::ReceiveString ()
#6  0x82cfa79 in G4strstreambuf::overflow ()
#7  0x40cf9f30 in   ()
#8  0x40cf87c1 in putc_locked ()
#9  0x40ca12f0 in endl ()
#10 0x82868e9 in G4Polyhedron::RotateAroundZ ()
#11 0x828824d in G4PolyhedronSphere::G4PolyhedronSphere ()
#12 0x82419ad in G4Sphere::CreatePolyhedron ()
#13 0x80d42fb in G4VSceneHandler::RequestPrimitives ()
#14 0x80ca67a in G4OpenGLStoredSceneHandler::RequestPrimitives ()
#15 0x80d32c2 in G4VSceneHandler::AddThis ()
#16 0x80c9890 in G4OpenGLSceneHandler::AddThis ()
#17 0x8241902 in G4Sphere::DescribeYourselfTo ()
#18 0x8185a8b in G4PhysicalVolumeModel::DescribeSolids ()
#19 0x81851b0 in G4PhysicalVolumeModel::DescribeAndDescend ()
#20 0x81849f5 in G4PhysicalVolumeModel::VisitGeometryAndGetVisReps ()
#21 0x818538b in G4PhysicalVolumeModel::DescribeAndDescend ()
#22 0x81849f5 in G4PhysicalVolumeModel::VisitGeometryAndGetVisReps ()
#23 0x8183b64 in G4PhysicalVolumeModel::DescribeYourselfTo ()
#24 0x80d47e1 in G4VSceneHandler::ProcessScene ()
#25 0x80d55a8 in G4VViewer::ProcessView ()
#26 0x80c3d1a in G4OpenGLStoredXmViewer::DrawView ()
#27 0x80d8590 in G4VisManager::Draw ()
#28 0x82b2877 in
G4VisSimpleCommandMessenger<G4VisCommandDrawCurrent>::SetNewValue ()
#29 0x826172e in G4UIcommand::DoIt ()
#30 0x8273d1d in G4UImanager::ApplyCommand ()
#31 0x816c0d1 in G4UIGAG::ExecuteCommand ()
#32 0x816b7ad in G4UIGAG::SessionStart ()
#33 0x80ab429 in main ()

It seems that the fault happens during the output of the error message
in RotateAroundZ(), but when commenting out these lines, the error
still occur, this time in G4PolyhedronSphere::~G4PolyhedronSphere ().

Important:

- The error does not depend on the graphics system.
- The system runs fine when using greater values of pDPhi and pDTheta (e.g.
  10 degree, but I did not check the exact limit).
- The simulation output seems to be reasonable. I cannot be sure that the
  detector is build ok, because I have no visualisation, but the problem
  seems to be only in the visualisation.

I think that this is a major (or even critical) problem, because it is
not possible at all to check the implementation of the detector.

Best regards,
V. Hejny
Comment 1 John.Allison 2000-01-12 06:52:59 CET
A correction exists - tag greps-V01-00-01 - which will also be issued as a
patch.