Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCons build with ROOT 6 causes interpreter segfaults #141

Closed
hansenjo opened this issue Sep 20, 2017 · 8 comments
Closed

SCons build with ROOT 6 causes interpreter segfaults #141

hansenjo opened this issue Sep 20, 2017 · 8 comments
Assignees
Labels

Comments

@hansenjo
Copy link
Member

This is a nasty one, I think.

If, and apparently only if, I build the analyzer with scons (v2.5.1 from EPEL) and then issue some C++11 commands from the interpreter, I frequently (but not always!) get segfaults. Example:

  ************************************************
  *                                              *
  *            W E L C O M E  to  the            *
  *       H A L L A   C++  A N A L Y Z E R       *
  *                                              *
  *  Release      1.6.0-beta3        Sep 20 2017 *
  *  Based on ROOT  6.10/04          Jul 28 2017 *
  *                                              *
  *            For information visit             *
  *        http://hallaweb.jlab.org/podd/        *
  *                                              *
  ************************************************
analyzer [0] vector<int> vi { 1,2,4,5,6,9,-10,-20 }
(std::vector<int> &) { 1, 2, 4, 5, 6, 9, -10, -20 }
analyzer [1] for( auto& i : vi ) cout << i << endl;

 *** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007fbf19abddbc in __libc_waitpid (pid=11594, stat_loc=stat_loc
entry=0x7fff734c7f60, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:31
#1  0x00007fbf19a40cc2 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
#2  0x00007fbf1d7a47df in TUnixSystem::StackTrace (this=0x6298e0) at /opt/ROOT/root-6.10.04/core/unix/src/TUnixSystem.cxx:2412
#3  0x00007fbf1d7a6f2c in TUnixSystem::DispatchSignals (this=0x6298e0, sig=kSigSegmentationViolation) at /opt/ROOT/root-6.10.04/core/unix/src/TUnixSystem.cxx:3643
#4  <signal handler called>
#5  0x00007fbf1a58d183 in std::ostream::operator<< (this=0x7fbf1a7fb700 <std::cout>, __n=1) at /usr/src/debug/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/ostream.tcc:110
#6  0x00007fbf1e4f60a7 in ?? ()
#7  0x00007fff734ca6e8 in ?? ()
#8  0x0000000001b12f60 in ?? ()
#9  0x0000000001b12f80 in ?? ()
#10 0x00007fff734caab0 in ?? ()
#11 0x0000000000000000 in ?? ()
===========================================================

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.
===========================================================
#5  0x00007fbf1a58d183 in std::ostream::operator<< (this=0x7fbf1a7fb700 <std::cout>, __n=1) at /usr/src/debug/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/ostream.tcc:110
#6  0x00007fbf1e4f60a7 in ?? ()
#7  0x00007fff734ca6e8 in ?? ()
#8  0x0000000001b12f60 in ?? ()
#9  0x0000000001b12f80 in ?? ()
#10 0x00007fff734caab0 in ?? ()
#11 0x0000000000000000 in ?? ()
===========================================================

Root > 

Here's where it gets nasty:

  • It isn't 100% reproducible. You may have to try several times (start analyzer, issue interactive commands, exit and restart if it doesn't crash).
  • I am unable to reproduce this crash with the scons build when running under gdb. Under the debugger, it just seems to work.
  • I have never been able to trigger this crash with a make build of the analyzer
  • hcana's SCons build seems unaffected as well.
  • The crash does not occur on macOS when building with either scons or make. So far, I have only seen it on RHEL7 and CentOS7. I have tried both the ROOT version from EPEL (currently 6.10/02) and a self-built ROOT 6.10/04 installation. I am using the standard compiler there: g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16). It happens on several different machines, including the VirtualBox image we made for the analysis workshop this summer.

I have already tried a number of variations on the compiler flags used by SCons, but so far nothing has made a difference. In particular, I have prevented -rdynamic to be parsed into the CXXFLAGS and used it only as a link flag, as the make build does. I've also reordered linker flags and manually re-linked libHall.so, libdc.so and the main executable. At this point, I'm stumped.

This problem was already present in June before the analysis workshop, so it is not due to a recent change.

@brash99
Copy link
Contributor

brash99 commented Sep 27, 2017 via email

@hansenjo
Copy link
Member Author

hansenjo commented Sep 27, 2017 via email

@brash99
Copy link
Contributor

brash99 commented Sep 27, 2017 via email

@hansenjo
Copy link
Member Author

hansenjo commented Sep 27, 2017 via email

@hansenjo
Copy link
Member Author

hansenjo commented Oct 1, 2017

I am noticing another, possibly related difference between the Make-compiled and the SCons-compiled versions of the analyzer. If I log into a machine without X forwarding and then start the analyzer version compiled with make, I always get the familiar warning about DISPLAY not set:

[ole@archie analyzer]$ ./analyzer -v
Warning in <UnknownClass::SetDisplay>: DISPLAY not set, setting it to 192.168.88.2:0.0
Podd 1.6.0-beta3 Linux-4.12.13-1-ARCH-x86_64 git @1bc2030 ROOT 6.10/04

Perhaps worth noting, I even get this warning when running with the (new) -v flag, which does not even create a THaInterface, but just runs a few cout commands in main() before exiting.

Now, if I do the same with the version compiled with SCons, the DISPLAY warning is never shown, even when starting a session where it normally would appear. No error appears when trying to open windows from such a session, for example

analyzer [0] auto b = new TBrowser

and no window appears anywhere.

It seems like the make-compiled version initializes some ROOT component that includes DISPLAY handling, while the SCons-compiled version doesn't. I am not sure if this is related to the interactive interpreter crashes, but it's certainly another indication of a significant difference between the build systems, and fixing one could fix the other as well.

@brash99
Copy link
Contributor

brash99 commented Oct 1, 2017 via email

@brash99
Copy link
Contributor

brash99 commented Oct 2, 2017 via email

@hansenjo
Copy link
Member Author

hansenjo commented Oct 2, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants