Message: G4UIExecutive fails in debug mode Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question G4UIExecutive fails in debug mode 

Forum: Installation and Configuration
Date: 20 Jan, 2016
From: Geir Meyer <Geir Meyer>

Hi,

I'm using: Windows7 64, Geant4 10.2.0, Visual Studio 2015, CMAKE 3.4.1

Compiled Geant4 and examples/basic/B1 as in "BookInstalGuide.pdf". Compiled B1 in addition as a Debug version.

Executing .\RelWithDebInfo\exampleB1.exe works. Executing .\Debug\exampleB1.exe does not work. An exception is thrown.

Opening B1.sln in VS-2015 and running with "RelWithDebInfo" or "Release" works fine.

Running with "Debug" fails at line 56: ui = new G4UIExecutive(argc, argv);

Stepping with "Debug" into the constructor of G4UIExecutive shows that the exception is thrown at line 105: G4String stype = type;

The reason is that 'type' has not been initialized (size is 3435973836) and the copy in line 105 runs out of memory. 'type' has a default value of "" as declared in G4UIExecutive.hh and should be initialized: G4UIExecutive(G4int argc, char** argv, const G4String& type = "");.

Setting the 'type' argument does not help, the value is lost in the constructor:

	G4String loosesValue{ "win32" };
	ui = new G4UIExecutive(argc, argv, loosesValue);

Stepping with "RelWithDebInfo" shows the correct value of 'type' ("win32").

How come that the value of 'type' is not correct in Debug mode? Is there something I should have done differently?

Regards, Geir Meyer

 Add Message Add Message
to: "G4UIExecutive fails in debug mode"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]