I have compiled geant4-10-00-patch-01 [MT] on Mac OS X 10.9.2 using the following cmake command: cmake -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DGEANT4_BUILD_MULTITHREADED=ON -DCMAKE_INSTALL_PREFIX=/usr/local .. When running the macro file for basic example 1 ("./exampleB1 exampleB1.in"), Geant exits with the following output: ### Run 1 starts. G4WT0 > ### Run 1 starts on worker thread 0. G4WT1 > ### Run 1 starts on worker thread 1. G4WT0 > --> Event 0 starts with initial seeds (72908997,74216692). G4WT1 > --> Event 100 starts with initial seeds (74589296,41591767). fish: Job 1, './exampleB1 exampleB1.in' terminated by signal SIGSEGV (Address boundary error) I have narrowed down the problem to the proton simulation part of the macro file. If I instead run Geant in interactive mode, I can usually perform a few proton simulations before it crashes. Running the example using the lldb debugger, the application crashes with the following output: ### Run 1 starts. G4WT1 > ### Run 1 starts on worker thread 1. G4WT0 > ### Run 1 starts on worker thread 0. G4WT1 > --> Event 0 starts with initial seeds (72908997,74216692). G4WT1 > --> Event 100 starts with initial seeds (74589296,41591767). Process 3462 stopped * thread #2: tid = 0x16739, 0x0000000101adf89f libG4geometry.dylib`G4MagInt_Driver::AccurateAdvance(G4FieldTrack&, double, double, double) + 1375, stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT) frame #0: 0x0000000101adf89f libG4geometry.dylib`G4MagInt_Driver::AccurateAdvance(G4FieldTrack&, double, double, double) + 1375 libG4geometry.dylib`G4MagInt_Driver::AccurateAdvance(G4FieldTrack&, double, double, double) + 1375: -> 0x101adf89f: movaps (%rax), %xmm0 0x101adf8a2: movaps %xmm0, -0x590(%rbp) 0x101adf8a9: movaps 0x10(%rax), %xmm0 0x101adf8ad: movaps %xmm0, -0x580(%rbp)
You're likely using the latest version of clang distributed within the last upgrade of XCode, which obviously was not tested at the time 10.0.p01 was released... A fix for the problem you observe has been already included in the development and will be part of the next patch. Try to edit this file: source/geometry/magneticfield/include/G4FieldTrack.icc and replace line 253 with: G4double valArr[ncompSVEC]; (i.e. remove "static G4ThreadLocal" in front).
The fix you suggested solved the problem. Many thanks!
*** Problem 1619 has been marked as a duplicate of this problem. ***
*** Problem 1628 has been marked as a duplicate of this problem. ***