Trying to install Geant4.9.4 beta on MacOSX Snow leopard with Qt and OpenGL visualization crash when/vis/open OGL command : Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000 0x0000000000000000 in ?? () (gdb) where #0 0x0000000000000000 in ?? () #1 0x0000000100328562 in G4OpenGLViewer::SetView (this=0x10486fa78) at src/G4OpenGLViewer.cc:201 #2 0x0000000100311409 in G4OpenGLQtViewer::SetView (this=0x10486f600) at src/G4OpenGLQtViewer.cc:93 #3 0x000000010053437c in G4VisCommandSceneNotifyHandlers::SetNewValue (this=0x103d5e9e0, newValue=@0x7fff5fbfc7f0) at src/G4VisCommandsScene.cc:616 #4 0x0000000101b66c56 in G4UIcommand::DoIt (this=0x103d5ec90, parameterList=@0x7fff5fbfc9d0) at src/G4UIcommand.cc:210 #5 0x0000000101b72878 in G4UImanager::ApplyCommand (this=0x10400fc00, aCmd=0x10058337b "/vis/scene/notifyHandlers") at src/G4UImanager.cc:411 #6 0x000000010051ef73 in G4VVisCommand::UpdateVisManagerScene (this=0x103d63d40, sceneName=@0x103de0870) at src/G4VVisCommand.cc:105 #7 0x000000010053f820 in G4VisCommandSceneAddTrajectories::SetNewValue (this=0x103d63d40, newValue=@0x7fff5fbfd000) at src/G4VisCommandsSceneAdd.cc:1494 #8 0x0000000101b66c56 in G4UIcommand::DoIt (this=0x103d644b0, parameterList=@0x7fff5fbfd1e0) at src/G4UIcommand.cc:210 #9 0x0000000101b72878 in G4UImanager::ApplyCommand (this=0x10400fc00, aCmd=0x103dda7f8 "/vis/scene/add/trajectories smooth") at src/G4UImanager.cc:411 #10 0x0000000101b729c7 in G4UImanager::ApplyCommand (this=0x10400fc00, aCmd=@0x7fff5fbfd310) at src/G4UImanager.cc:355 #11 0x0000000101b5a80c in G4UIbatch::ExecCommand (this=0x1050b10c0, command=@0x7fff5fbfd370) at src/G4UIbatch.cc:167 #12 0x0000000101b5b655 in G4UIbatch::SessionStart (this=0x1050b10c0) at src/G4UIbatch.cc:212 #13 0x0000000101b72a2e in G4UImanager::ExecuteMacroFile (this=0x10400fc00, fileName=0x1050af688 "vis.mac") at src/G4UImanager.cc:223 #14 0x0000000101b6e2f1 in G4UIcontrolMessenger::SetNewValue (this=0x103d14440, command=0x103d14720, newValue=@0x7fff5fbfd600) at src/G4UIcontrolMessenger.cc:183 #15 0x0000000101b66c56 in G4UIcommand::DoIt (this=0x103d14720, parameterList=@0x7fff5fbfd7e0) at src/G4UIcommand.cc:210 #16 0x0000000101b72878 in G4UImanager::ApplyCommand (this=0x10400fc00, aCmd=0x100004f45 "/control/execute vis.mac") at src/G4UImanager.cc:411 #17 0x0000000100003982 in main (argc=1, argv=0x7fff5fbfda28) at exampleN02.cc:112
This problem could occurs with - OpenGL AND MacOsX snow leopard (and after) versions. - All Geant4 versions The fact is it does not link with correct OpenGL libraries. You have to change *one* line in /config/sys/Darwin-g++.gmk file : - Go in "config/sys/Darwin-g++.gmk - around line 60, you will find : _____________________________ ifndef OGLLIBS ifeq ($(shell uname -r | sed 's/\([0-9]*\).[0-9]*.[0-9]*/\1/'),9) # the following lines are for building on MacOSX 10.5 "Leopard" OGLLIBS := $(shell test -f /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib && echo "-L/usr/X11R6/lib -lGLU -lGL -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib") else OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL <-----LINE TO MODIFY !!!! endif endif _____________________________ - change the line : OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL <-----LINE TO MODIFY !!!! By : OGLLIBS := -F/System/Library/Frameworks/ -framework OpenGL -framework AGL - go in /source/visualization/OpenGL; - make clean; make - go in your prog folder - make clean; make Thanks, Laurent