*** Break *** segmentation violation on AMD Athlon

Dear ROOT gurus,

I have the problem with segmentation violation with ROOT. First I thought that it could be a problem with Geant4, as it appeared when I compiled geant4 example with ROOT, but later I discovered that it’s a general problem, which is rather caused by ROOT.

Here is the description of the problem (posted also in geant4 forum):

I’m using Geant4 with root. The program compiles without problems, but it gives run-time error “segmentation violation”. The problem is probably connected with compiling options. I found description of similar problem in RootTalk (root.cern.ch/root/roottalk/roottalk04/3056.html), but from what is written there I couldn’t understand what exactly I should do to solve the problem. The most strange thing is that everything works well on another computer. The only difference between that computer and mine is that mine is Athlon, the other is Pentium. Everything else seems to be the same (linux distribution is i586 on both). I even tried to compile everything (including ROOT and GEANT4 distributions) on another computer and run in on mine - the same problem. “Pure” Geant4 and ROOT applications work well, only the combination doesn’t work. Probably it’s root-related problem, bt I’m posting it here since I’m using GEANT4 as the “main Makefile”. As I said, root itself (without GEANT4) seems to give no problems.

Now I have also discovered that the same problem appears when I link ROOT with cernlib (using cfortran). Generally speaking, it seems that the problem appears when I combine ROOT with a library that I compiled myself on this computer (both, Geant4 and cernlib were compiled by me). I’m using Linux Mandriva 2009 and 2009.1. It WORKS on Pentium 4 and EEEPC 901 laptop, but gives segmentation violation on Athlon (AMD Athlon™ 64 Processor 3200+).

The simplest way to reproduce my problem is (except that it appears only on my PC):

  1. take novice example N01

  2. replace exampleN01.cc by:

#include “TROOT.h”

int main()

return 0;

  1. Add to the end of GNUmakefile
    (like in examples/extended/parallel/MPI/exMPI02):

CPPFLAGS += -I$(shell $(ROOTSYS)/bin/root-config --incdir)
CPPFLAGS += $(shell $(ROOTSYS)/bin/root-config --cflags)
LDLIBS += $(shell $(ROOTSYS)/bin/root-config --libs)

ifeq ($(G4SYSTEM),Linux-g++)
LDLIBS += -Wl,-rpath,$(shell $(ROOTSYS)/bin/root-config --libdir)

The output of the program is:
*** Break *** segmentation violation
Attaching to program: /proc/15824/exe, process 15824
[Thread debugging using libthread_db enabled]
[New Thread 0xb39426d0 (LWP 15824)]
0xffffe424 in __kernel_vsyscall ()
Missing debug package(s), you should install: freetype2-debug gcc-debug glibc-debug lesstif-debug libdrm-debug libice-debug libsm-debug libx11-debug libxau-debug libxaw-debug libxcb-debug libxdamage-debug libxdmcp-debug libxext-debug libxfixes-debug libxmu-debug libxp-debug libxpm-debug libxt-debug libxxf86vm-debug mesa-debug nss_mdns-debug zlib-debug
#1 0xb3b08593 in waitpid () from /lib/i686/libc.so.6
#2 0xb3aa978b in ?? () from /lib/i686/libc.so.6
#3 0xb3bcf06d in system () from /lib/i686/libpthread.so.0
#4 0xb572dbfd in TUnixSystem::Exec () from /cern/root/lib/libCore.so
#5 0xb5732feb in TUnixSystem::StackTrace () from /cern/root/lib/libCore.so
#6 0xb5733d8d in TUnixSystem::DispatchSignals ()
from /cern/root/lib/libCore.so
#7 0xb5733e8d in SigHandler () from /cern/root/lib/libCore.so
#8 0xb572a792 in sighandler () from /cern/root/lib/libCore.so
#10 0xb4f88cb8 in G__destroy_upto () from /cern/root/lib/libCint.so
#11 0xb4f895cc in G__scratch_globals_upto () from /cern/root/lib/libCint.so
#12 0xb571c299 in TCint::ResetGlobals () from /cern/root/lib/libCore.so
#13 0xb5687f67 in TROOT::Reset () from /cern/root/lib/libCore.so
#14 0x0804915b in main ()
The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/15824/exe, process 15824


gROOT->Reset should only be used in interpreted unamed scripts.