Strange segfault in interactive mode (6.04/6.06)

Dear all,

I see strange results when using the interactive mode in 6.06.02 (both GCC 4.9.1 and 5.3.1):

root [0] double test=0; root [1] test (double) 0.00000 root [2] double error=0; root [3] error (double) -9.83991e-264

[code]root [0] double error;
root [1] error=0;

*** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:

#0 0x00007efe3822064a in __GI___waitpid (pid=11491, stat_loc=stat_loc
entry=0x7fff26e3aac0, options=options
entry=0) at …/sysdeps/unix/sysv/linux/waitpid.c:29
#1 0x00007efe38199fab in do_system (line=) at …/sysdeps/posix/system.c:148
#2 0x00007efe38d86204 in TUnixSystem::Exec (shellcmd=, this=0x22d84f0) at /home/swertz/.local/soft/root/core/unix/src/TUnixSystem.cxx:2086
#3 TUnixSystem::StackTrace (this=0x22d84f0) at /home/swertz/.local/soft/root/core/unix/src/TUnixSystem.cxx:2373
#4 0x00007efe38d882ec in TUnixSystem::DispatchSignals (this=0x22d84f0, sig=kSigSegmentationViolation) at /home/swertz/.local/soft/root/core/unix/src/TUnixSystem.cxx:3614
#5
#6 0x00007efe3950002f in ?? ()
#7 0x0000000000000015 in ?? ()
#8 0x0000000002338cd0 in ?? ()
#9 0x00007efe39500000 in ?? ()
#10 0x00007fff26e3d740 in ?? ()
#11 0x00007fff26e3d450 in ?? ()
#12 0x00007fff26e3d740 in ?? ()
#13 0x00007efe39500000 in ?? ()
#14 0x00007efe34ffd664 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /home/swertz/.local/soft/root/builddir/lib/libCling.so
#15 0x00007efe350034be in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /home/swertz/.local/soft/root/builddir/lib/libCling.so
#16 0x00007efe35003617 in cling::Interpreter::process(std::_cxx11::basic_string<char, std::char_traits, std::allocator > const&, cling::Value*, cling::Transaction**) () from /home/swertz/.local/soft/root/builddir/lib/libCling.so
#17 0x00007efe3508524e in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /home/swertz/.local/soft/root/builddir/lib/libCling.so
#18 0x00007efe34f7a856 in HandleInterpreterException (metaProcessor=, input_line=, compRes=
0x7fff26e3d72c: cling::Interpreter::kSuccess, result=result
entry=0x7fff26e3d740) at /home/swertz/.local/soft/root/core/meta/src/TCling.cxx:1843
#19 0x00007efe34f8bd0d in TCling::ProcessLine (this=0x2333c40, line=, error=0x7fff26e3dc0c) at /home/swertz/.local/soft/root/core/meta/src/TCling.cxx:1999
#20 0x00007efe38ce7706 in TApplication::ProcessLine (this=this
entry=0x2324060, line=, sync=sync
entry=false, err=err
entry=0x7fff26e3dc0c) at /home/swertz/.local/soft/root/core/base/src/TApplication.cxx:997
#21 0x00007efe390ce6ff in TRint::ProcessLineNr (this=this
entry=0x2324060, filestem=filestem
entry=0x7efe390dd108 "ROOT_prompt
", line=0x7fff26e3dcc9 “error=0;”, error=0x7fff26e3dc0c, error
entry=0x0) at /home/swertz/.local/soft/root/core/rint/src/TRint.cxx:745
#22 0x00007efe390cea05 in TRint::HandleTermInput (this=0x2324060) at /home/swertz/.local/soft/root/core/rint/src/TRint.cxx:606
#23 0x00007efe38d879cc in TUnixSystem::CheckDescriptors (this=this
entry=0x22d84f0) at /home/swertz/.local/soft/root/core/unix/src/TUnixSystem.cxx:1314
#24 0x00007efe38d88c1a in TUnixSystem::DispatchOneEvent (this=0x22d84f0, pendingOnly=) at /home/swertz/.local/soft/root/core/unix/src/TUnixSystem.cxx:1069
#25 0x00007efe38c9fc34 in TSystem::InnerLoop (this=0x22d84f0) at /home/swertz/.local/soft/root/core/base/src/TSystem.cxx:407
#26 0x00007efe38c9e76f in TSystem::Run (this=0x22d84f0) at /home/swertz/.local/soft/root/core/base/src/TSystem.cxx:357
#27 0x00007efe38ce4c6f in TApplication::Run (this=this
entry=0x2324060, retrn=retrn
entry=false) at /home/swertz/.local/soft/root/core/base/src/TApplication.cxx:1145
#28 0x00007efe390d00b7 in TRint::Run (this=this
entry=0x2324060, retrn=retrn
entry=false) at /home/swertz/.local/soft/root/core/rint/src/TRint.cxx:460
#29 0x00000000004010cc in main (argc=1, argv=0x7fff26e40078) at /home/swertz/.local/soft/root/main/src/rmain.cxx:30

The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum.
Only if you are really convinced it is a bug in ROOT then please submit a
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.

#6 0x00007efe3950002f in ?? ()
#7 0x0000000000000015 in ?? ()
#8 0x0000000002338cd0 in ?? ()
#9 0x00007efe39500000 in ?? ()
#10 0x00007fff26e3d740 in ?? ()
#11 0x00007fff26e3d450 in ?? ()
#12 0x00007fff26e3d740 in ?? ()
#13 0x00007efe39500000 in ?? ()
#14 0x00007efe34ffd664 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /home/swertz/.local/soft/root/builddir/lib/libCling.so
#15 0x00007efe350034be in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /home/swertz/.local/soft/root/builddir/lib/libCling.so
#16 0x00007efe35003617 in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, cling::Value*, cling::Transaction**) () from /home/swertz/.local/soft/root/builddir/lib/libCling.so
#17 0x00007efe3508524e in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /home/swertz/.local/soft/root/builddir/lib/libCling.so
#18 0x00007efe34f7a856 in HandleInterpreterException (metaProcessor=, input_line=, compRes=
0x7fff26e3d72c: cling::Interpreter::kSuccess, result=result
entry=0x7fff26e3d740) at /home/swertz/.local/soft/root/core/meta/src/TCling.cxx:1843
===========================================================[/code]

I do not have the same problem in 6.02.05, but I have it in 6.04.00.

Should I report it as a bug or is it expected behaviour somehow?

Cheers,
Sebastien

I think I remember a similar report floating around and the explanation was that glibc (?) symbols (coming from its shared library ) were visible in the interpreter.
The original thread is here: [url=https://root-forum.cern.ch/t/cant-use-variable-name-step-in-rootcling/20730/1 use variable name step in rootcling?[/url]
The solution is to avoid some identifiers (at least at the interpreter’s prompt).
Try (see also “man error”): root [0] extern "C" void error(int, int, const char*, ...); root [1] *((double *)error) root [2] error(1, 0, "WTF?");

See sft.its.cern.ch/jira/browse/ROOT-8036

Thanks, that clears that up!