void macro() {
TObject* o = (TObject*) 0x123;
o->GetName();
}
Running it:
$ root.exe -l -b -q macro.C+; echo $?
root [0]
Processing macro.C+...
Info in <TUnixSystem::ACLiC>: creating shared library /home/axel/build/root/github/obj/./macro_C.so
*** Break *** segmentation violation
===========================================================
There was a crash (kSigSegmentationViolation).
This is the entire stack trace of all threads:
===========================================================
#0 0x00007f6b3bf23b4c in waitpid () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f6b3bea92e2 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007f6b3cf7f1b9 in TUnixSystem::Exec (this=0x1ff3aa0, shellcmd=0x33095d0 "/home/axel/build/root/github/obj/etc/gdb-backtrace.sh 4032 1>&2") at /home/axel/build/root/github/src/core/unix/src/TUnixSystem.cxx:2073
#3 0x00007f6b3cf7fd7b in TUnixSystem::StackTrace (this=0x1ff3aa0) at /home/axel/build/root/github/src/core/unix/src/TUnixSystem.cxx:2301
#4 0x00007f6b3cf8588a in TUnixSystem::DispatchSignals (this=0x1ff3aa0, sig=kSigSegmentationViolation) at /home/axel/build/root/github/src/core/unix/src/TUnixSystem.cxx:3539
#5 0x00007f6b3cf7a2f1 in SigHandler (sig=kSigSegmentationViolation) at /home/axel/build/root/github/src/core/unix/src/TUnixSystem.cxx:395
#6 0x00007f6b3cf85a14 in sighandler (sig=11) at /home/axel/build/root/github/src/core/unix/src/TUnixSystem.cxx:3516
#7 0x00007f6b3cfca150 in textinput::TerminalConfigUnix::HandleSignal (this=0x7f6b3d324aa0 <textinput::TerminalConfigUnix::Get()::s>, signum=11) at /home/axel/build/root/github/src/core/textinput/src/textinput/TerminalConfigUnix.cpp:96
#8 0x00007f6b3cfc9f5b in (anonymous namespace)::TerminalConfigUnix__handleSignal (signum=11) at /home/axel/build/root/github/src/core/textinput/src/textinput/TerminalConfigUnix.cpp:36
#9 <signal handler called>
#10 0x00007f6b2ce585f7 in macro () at /home/axel/build/root/github/obj/./macro.C:3
#11 0x00007f6b3d3f5042 in ?? ()
#12 0x0000000000000015 in ?? ()
#13 0x00007fffe404d730 in ?? ()
#14 0x00007fffe404ce70 in ?? ()
#15 0x00007f6b36f49ae2 in cling::IncrementalExecutor::executeWrapper (this=0x7fffe404cdc0, function=..., returnValue=0x123) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalExecutor.h:186
===========================================================
The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#10 0x00007f6b2ce585f7 in macro () at /home/axel/build/root/github/obj/./macro.C:3
#11 0x00007f6b3d3f5042 in ?? ()
#12 0x0000000000000015 in ?? ()
#13 0x00007fffe404d730 in ?? ()
#14 0x00007fffe404ce70 in ?? ()
#15 0x00007f6b36f49ae2 in cling::IncrementalExecutor::executeWrapper (this=0x7fffe404cdc0, function=..., returnValue=0x123) at /home/axel/build/root/github/src/interpreter/cling/lib/Interpreter/IncrementalExecutor.h:186
===========================================================
Root > 1
Actually, the returned value 1 seems wrong to me -> for a “segmentation violation” (“SIGSEGV”) I would expect to get 139 (= 128 + 11).
In general, I would expect that if the command is terminated by signal “n” (e.g. “SIGSEGV” is 11 according to “man 7 signal”) then the exit status should be “128 + n”,