drjuls / AMBiT

GNU General Public License v3.0
32 stars 15 forks source link

segmentation error #19

Closed pinghanchu closed 6 years ago

pinghanchu commented 6 years ago

Hi, I met this segmentation error. Any suggestion how to fix it?

The error message while run "$./ambit Documentation/ExampleCalculation/CrII/Cr+.input" is at here

emilyviolet commented 6 years ago

Hello Pinghan,

I am unfortunately unable to reproduce this bug on my machine, so I'll need a little information from you before I can triage this crash:

  1. Before I can start looking at this, I need to know where in the program it crashed. Is the output in your gist a direct copy and paste, or did you leave anything out?
  2. Can you also post the last 20 or so lines of your log.out file? This will also help me figure out where things are going wrong.
  3. This one is more time-consuming: the stack-trace is not intelligible by itself (since it's a bunch of hexadecimal memory addresses), but you can translate these into the actual subroutine names. Unfortunately it has to be done on your machine though, since the addresses will be different for each installation of AMBiT. In order to make sense of the stack-trace, you can use the UNIX addr2line tool on the address of each stack frame; so for the top frame:
    $ addr2line -e /path/to/ambit 0x40a3eb

    should give the function which produces the stack-traces (Atom/ambit.cpp:545) (I think, it may depend on your machine). If you can, would you please do this for each of the frames with the form ./ambit[0x...] in your gist?

Once I have this information I should be able to get a better idea of where the problem might lie.

Thanks,

Emily

pinghanchu commented 6 years ago

Hi Emily,

  1. I just copy and paste the output after run "$./ambit Documentation/ExampleCalculation/CrII/Cr+.input".

  2. I paste the first few lines of log.out at here.

  3. I run addr2line and paste the path at here. However, I don't have answer for [0x4071e9].

Thanks for helping. By the way, I checked some earlier issues. It may be caused by gcc version?

best, pinghan

emilyviolet commented 6 years ago

Hi Pinghan,

Thanks for the info! This appears to be a problem somewhere in the guts of GSL, since AMBiT appears to be crashing when it calls the GSL function to evaluate the B-Spline derivatives. This suggests that it may be a problem with linking to GSL. Like you noticed, we've discovered that compiling the libraries (such as GSL or Boost) with an incompatible compiler (or even compiler version) to the main ambit executable can cause issues when the two try to talk to each other.

My suggestions would be to double-check that you have used the same version of the same compiler for both your local GSL and AMBiT and recompile them if they use different versions. I would also suggest talking with your cluster's system administrator(s) (if possible) to see if they can help, as they would have a better knowledge of the specifics of your system (compilers, libraries, etc) than we do.

Thanks for your patience with this issue.

Cheers, Emily

pinghanchu commented 6 years ago

Hi Emily, Thanks for the answer. I didn't change the default setting while compiling ambit and gsl. It is hard for me to understand how to use different compilers. Maybe you have some suggestions.

In the config.ini of AMBiT, I used the default one: "CXX = g++ -std=c++11 CXXFLAGS = F77 = LINK = LINKFLAGS = "

I didn't specify compiler for GSL. Do you know how to setup the compiler for GSL? Here is the statement of the compiler for GSL:

" Compilers and Options Some systems require unusual options for compilation or linking that the configure' script does not know about. Run./configure --help' for details on some of the pertinent environment variables.

You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example:

 ./configure CC=c99 CFLAGS=-g LIBS=-lposix

*Note Defining Variables::, for more details. " It is a little complicated. Thanks for your help.

best, pinghan

pinghanchu commented 6 years ago

I've tried to re-compile GSL with $./configure CXX=g++ --prefix=/path/to/gsl/

I assume I used the same compiler for AMBiT and GSL. Unfortunately, it didn't work. The error message shows: "/usr/lib64/libc.so.6(+0x35270)[0x7f85ebe1a270] /usr/lib64/libgsl.so.0(gsl_bspline_deriv_eval+0x88)[0x7f85ed905018]"

Does this mean I still linked to the old GSL? (You can check my modified config.ini here. )

Or libc (GNU C library) needs re-compiled?

P.S. old GSL is at /usr/lib64 new GSL is at /home/pchu/proj/Software/local/gsl

emilyviolet commented 6 years ago

Hi Pinghan,

I'm sorry, but like I said, there's not a lot we can do to help at this point. Compilation issues are very specific to your cluster and its software environment, so we cannot offer support for them. Bring this up with your cluster's system administrator/IT department; they know the system and will be able to help you resolve these problems.

I'm going to mark this issue as closed; we can re-examine it if it turns out to be a problem with AMBiT rather than GSL.

Kind regards,