Skip to content

Segmentation fault (core dumped) #117

@maltefgoettsche

Description

@maltefgoettsche

Dear all,

I tried to compile the 1.5.0 version of Cymetric on Ubuntu 16.04. I get "Segmentation fault (core dumped)" when trying to run it. Running "nosetests -w tests/" gives me "src/tcmalloc.cc:278] Attempt to free invalid pointer 0x3331e80 Aborted (core dumped)".

~/.local/lib/python2.7/site-packages/cymetric contains:

brightlite_root_metrics.py   execution.py     main.py           schemas.py
brightlite_root_metrics.pyc  execution.pyc    main.pyc          schemas.pyc
cycamore_root_metrics.py     fco_metrics.py   metrics.py        tools.py
cycamore_root_metrics.pyc    fco_metrics.pyc  metrics.pyc       tools.pyc
evaluator.py                 __init__.py      root_metrics.py
evaluator.pyc                __init__.pyc     root_metrics.pyc

Any ideas how to fix this? I had previously tried to install Cymetric without success. Could the issue also be related to me not having cleaned up the previous installation attempt properly?
I also include the log from the Cymetric installations below.
Thanks,
Malte

install.log:

running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cymetric
copying cymetric/fco_metrics.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/root_metrics.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/schemas.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/brightlite_root_metrics.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/__init__.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/cycamore_root_metrics.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/metrics.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/execution.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/evaluator.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/main.py -> build/lib.linux-x86_64-2.7/cymetric
copying cymetric/tools.py -> build/lib.linux-x86_64-2.7/cymetric
running build_scripts
creating build/scripts-2.7
copying and adjusting scripts/cymetric -> build/scripts-2.7
changing mode of build/scripts-2.7/cymetric from 664 to 775
running install_lib
creating /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/fco_metrics.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/root_metrics.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/schemas.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/brightlite_root_metrics.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/__init__.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/cycamore_root_metrics.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/metrics.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/execution.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/evaluator.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/main.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
copying build/lib.linux-x86_64-2.7/cymetric/tools.py -> /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/fco_metrics.py to fco_metrics.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/root_metrics.py to root_metrics.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/schemas.py to schemas.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/brightlite_root_metrics.py to brightlite_root_metrics.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/__init__.py to __init__.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/cycamore_root_metrics.py to cycamore_root_metrics.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/metrics.py to metrics.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/execution.py to execution.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/evaluator.py to evaluator.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/main.py to main.pyc
byte-compiling /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/tools.py to tools.pyc
running install_scripts
copying build/scripts-2.7/cymetric -> /home/maltefgoettsche/.local/bin
changing mode of /home/maltefgoettsche/.local/bin/cymetric to 775
running install_egg_info
Removing /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric-1.5.0-py2.7.egg-info
Writing /home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric-1.5.0-py2.7.egg-info

Activity

bam241

bam241 commented on Jan 11, 2017

@bam241
Member

Hi,
could you explain more about "trying to run it ?
did you just try to load it in Python? Do you have a script ?

Could you also the full segmentation fault you got ? (If there is anything else)

maltefgoettsche

maltefgoettsche commented on Jan 11, 2017

@maltefgoettsche
Author

Yes, I tried to load it in Python (import cymetric), or I try to run it from the terminal (e.g. cymetric cyclus.sqlite -l).

It only says Segmentation fault (core dumped).

scopatz

scopatz commented on Jan 11, 2017

@scopatz
Member

Thanks for reporting @maltefgoettsche

Could the issue also be related to me not having cleaned up the previous installation attempt properly?

Yes, it could. Also,

  • Which version of Cyclus are you on (v1.5 or develop)?
  • Did you install Cyclus with the Python bindings (do you have the install output)?
  • Does cymetric -h run successfully?
  • Did you try the conda package / does that work?
  • Can you get a backtrace on the segfault?
maltefgoettsche

maltefgoettsche commented on Jan 11, 2017

@maltefgoettsche
Author

Thanks for the response!

Which version of Cyclus are you on (v1.5 or develop)?

1.5

Did you install Cyclus with the Python bindings (do you have the install output)?

I'm not sure what the Python bindings are. I installed Cyclus from source (with Baptiste's help, actually, as there were several issues), using "python install.py."

Does cymetric -h run successfully?

No, same error.

Did you try the conda package / does that work?

Not yet. Can I install Cymetric from conda if I installed Cyclus from source? If somehow possible, I would like to keep my Cyclus installation from source, as I may need to make changes to the source code at some point in the future.

Can you get a backtrace on the segfault?

I hope I'm doing this right. I followed the instruction from here to get the backtrace. The output is:

/home/maltefgoettsche/.local/bin/seg_wrapper.sh: line 3: 4566 Segmentation fault (core dumped) "$@" "/home/maltefgoettsche/.local/bin/./cymetric": not in executable format: File format not recognized [New LWP 4566] [New LWP 4576] [New LWP 4575] [New LWP 4577] [New LWP 4578] Core was generated by /usr/bin/python ./cymetric'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007fbb343e8982 in ?? () [Current thread is 1 (LWP 4566)] #0 0x00007fbb343e8982 in ?? () #1 0x00000000026833e0 in ?? () #2 0x0000000000000000 in ?? ()

scopatz

scopatz commented on Jan 11, 2017

@scopatz
Member

I installed Cyclus from source

Can you share the stdout of installing cyclus, please? It prints a bunch of diagnostic information at the top that can help us debug.

No, same error.

That is bad

I hope I'm doing this right. I followed the instruction from here to get the backtrace

Because cymetric is in Python you need to do something like the following to run through gdb:

$ gdb python
(gdb) run /home/maltefgoettsche/.local/bin/cymetric -h
Segmentation Error
(gdb) bt
maltefgoettsche

maltefgoettsche commented on Jan 11, 2017

@maltefgoettsche
Author

I (successfully) re-compiled CYCLUS to get the log, which I attach:
install.log.txt

Interestingly, importing Cymetric into Python now gives
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/maltefgoettsche/.local/lib/python2.7/site-packages/cymetric/__init__.py", line 4, in <module> from cyclus.typesystem import * # only grabs code generated defintiions ImportError: No module named typesystem

Running cymetric from the terminal, I still get Segmentation fault (core dumped).

(gdb) run /home/maltefgoettsche/.local/bin/cymetric -h gives me

Starting program: /usr/bin/python /home/maltefgoettsche/.local/bin/cymetric -h
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff21fd700 (LWP 9472)]
[New Thread 0x7fffef9fc700 (LWP 9473)]
[New Thread 0x7fffed1fb700 (LWP 9474)]
[Thread 0x7fffed1fb700 (LWP 9474) exited]
[Thread 0x7fffef9fc700 (LWP 9473) exited]
[Thread 0x7ffff21fd700 (LWP 9472) exited]
[New Thread 0x7fffed1fb700 (LWP 9480)]
[New Thread 0x7fffef9fc700 (LWP 9481)]
[New Thread 0x7ffff21fd700 (LWP 9482)]
[New Thread 0x7fffde184700 (LWP 9483)]
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff7874982 in __GI___libc_free (mem=0x12803e0) at malloc.c:2965
2965 malloc.c: No such file or directory.

(gdb) bt gives me

#0 0x00007ffff7874982 in __GI___libc_free (mem=0x12803e0) at malloc.c:2965
#1 0x00007fffd91c0b1e in std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::less<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >::operator[](std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) ()
from /home/maltefgoettsche/.local/lib/python2.7/site-packages/pyne-0.5.0rc1-py2.7.egg/pyne/../lib/libpyne.so
#2 0x00007fffd91aeecd in pyne::get_data_checksumsabi:cxx11 ()
from /home/maltefgoettsche/.local/lib/python2.7/site-packages/pyne-0.5.0rc1-py2.7.egg/pyne/../lib/libpyne.so
#3 0x00007fffd918630e in _GLOBAL__sub_I_data.cpp () from /home/maltefgoettsche/.local/lib/python2.7/site-packages/pyne-0.5.0rc1-py2.7.egg/pyne/../lib/libpyne.so
#4 0x00007ffff7de74ea in call_init (l=, argc=argc@entry=3, argv=argv@entry=0x7fffffffdd28, env=env@entry=0x13e7ed0) at dl-init.c:72
#5 0x00007ffff7de75fb in call_init (env=0x13e7ed0, argv=0x7fffffffdd28, argc=3, l=) at dl-init.c:30
#6 _dl_init (main_map=main_map@entry=0x1e9d860, argc=3, argv=0x7fffffffdd28, env=0x13e7ed0) at dl-init.c:120
#7 0x00007ffff7dec712 in dl_open_worker (a=a@entry=0x7fffffffc1c0) at dl-open.c:575
#8 0x00007ffff7de7394 in _dl_catch_error (objname=objname@entry=0x7fffffffc1b0, errstring=errstring@entry=0x7fffffffc1b8, mallocedp=mallocedp@entry=0x7fffffffc1af,
operate=operate@entry=0x7ffff7dec300 <dl_open_worker>, args=args@entry=0x7fffffffc1c0) at dl-error.c:187
#9 0x00007ffff7debbd9 in _dl_open (file=0x1e9fb70 "/home/maltefgoettsche/.local/lib/python2.7/site-packages/pyne-0.5.0rc1-py2.7.egg/pyne/pyne_config.so",
mode=-2147483646, caller_dlopen=0x5231c3 <_PyImport_GetDynLoadFunc+243>, nsid=-2, argc=, argv=, env=0x13e7ed0) at dl-open.c:660
#10 0x00007ffff75edf09 in dlopen_doit (a=a@entry=0x7fffffffc3f0) at dlopen.c:66
#11 0x00007ffff7de7394 in _dl_catch_error (objname=0xa34ad0, errstring=0xa34ad8, mallocedp=0xa34ac8, operate=0x7ffff75edeb0 <dlopen_doit>, args=0x7fffffffc3f0)
at dl-error.c:187
#12 0x00007ffff75ee571 in _dlerror_run (operate=operate@entry=0x7ffff75edeb0 <dlopen_doit>, args=args@entry=0x7fffffffc3f0) at dlerror.c:163
#13 0x00007ffff75edfa1 in __dlopen (file=, mode=) at dlopen.c:87
#14 0x00000000005231c3 in _PyImport_GetDynLoadFunc ()
---Type to continue, or q to quit---
#15 0x0000000000522d6f in _PyImport_LoadDynamicModule ()
#16 0x00000000004af215 in PyImport_ImportModuleLevel ()
#17 0x00000000004b0f78 in ?? ()
#18 0x00000000004b0cb3 in PyObject_Call ()
#19 0x00000000004ce5d0 in PyEval_CallObjectWithKeywords ()
#20 0x00000000004c6ed6 in PyEval_EvalFrameEx ()
#21 0x00000000004c2765 in PyEval_EvalCodeEx ()
#22 0x00000000004c2509 in PyEval_EvalCode ()
#23 0x00000000004c061b in PyImport_ExecCodeModuleEx ()
#24 0x00000000004bd6ee in ?? ()
#25 0x00000000004be9e7 in ?? ()
#26 0x00000000004afbad in ?? ()
#27 0x00000000004af442 in PyImport_ImportModuleLevel ()
#28 0x00000000004b0f78 in ?? ()
#29 0x00000000004b0cb3 in PyObject_Call ()
#30 0x00000000004ce5d0 in PyEval_CallObjectWithKeywords ()
#31 0x00000000004c6ed6 in PyEval_EvalFrameEx ()
#32 0x00000000004c2765 in PyEval_EvalCodeEx ()
#33 0x00000000004c2509 in PyEval_EvalCode ()
#34 0x00000000004c061b in PyImport_ExecCodeModuleEx ()
#35 0x00000000004bd6ee in ?? ()
#36 0x00000000004afbad in ?? ()
#37 0x00000000004af34d in PyImport_ImportModuleLevel ()
---Type to continue, or q to quit---
#38 0x00000000004b0f78 in ?? ()
#39 0x00000000004b0cb3 in PyObject_Call ()
#40 0x00000000004ce5d0 in PyEval_CallObjectWithKeywords ()
#41 0x00000000004c6ed6 in PyEval_EvalFrameEx ()
#42 0x00000000004c2765 in PyEval_EvalCodeEx ()
#43 0x00000000004c2509 in PyEval_EvalCode ()
#44 0x00000000004c061b in PyImport_ExecCodeModuleEx ()
#45 0x00000000004bd6ee in ?? ()
#46 0x00000000004be9e7 in ?? ()
#47 0x00000000004af215 in PyImport_ImportModuleLevel ()
#48 0x00000000004b0f78 in ?? ()
#49 0x00000000004b0cb3 in PyObject_Call ()
#50 0x00000000004ce5d0 in PyEval_CallObjectWithKeywords ()
#51 0x00000000004c6ed6 in PyEval_EvalFrameEx ()
#52 0x00000000004c2765 in PyEval_EvalCodeEx ()
#53 0x00000000004c2509 in PyEval_EvalCode ()
#54 0x00000000004f1def in ?? ()
#55 0x00000000004ec652 in PyRun_FileExFlags ()
#56 0x00000000004eae31 in PyRun_SimpleFileExFlags ()
#57 0x000000000049e14a in Py_Main ()
#58 0x00007ffff7811830 in __libc_start_main (main=0x49dab0

, argc=3, argv=0x7fffffffdd28, init=, fini=, rtld_fini=, stack_end=0x7fffffffdd18)
at ../csu/libc-start.c:291
#59 0x000000000049d9d9 in _start ()

scopatz

scopatz commented on Jan 11, 2017

@scopatz
Member

OK, great. It looks like the segfault it coming from PyNE, not cymetric or cyclus, which you seem to have compiled correctly with Python bindings. Try uninstalling PyNE or recompiling PyNE or eremoving PyNE from the cymetric imports.

maltefgoettsche

maltefgoettsche commented on Jan 11, 2017

@maltefgoettsche
Author

Recompiling PyNE did not change anything. Uninstalling PyNE does the job, thanks a lot!!
Now, I'm wondering, though, how I could get both to run properly. PyNE by itself seemed to be working fine. I installed the develop version, as I could not get the master version to run. Could the problem be that Cymetric is not compatible with the Pyne develop version. I attach my install log from the re-compilation just now: pyne_install.log.txt

Thanks so much,
Malte

scopatz

scopatz commented on Jan 11, 2017

@scopatz
Member

Yeah I think this is a PyNE issue on some level. Cyclus duplicates PyNE's C++ API. So it is possible that, due to link optimization, the Cyclus version of some of the data management is getting read in instead of the current version. I have been able to have both PyNE and Cyclus installed at the same time for a while now so this is a new one on me. I am not sure what the strategy should be going forward.

maltefgoettsche

maltefgoettsche commented on Jan 13, 2017

@maltefgoettsche
Author

No problem, thanks a lot for your help.
Apart from PyNE, I have one last issue: While cymetric works fine using it with ipython from the terminal, it doesn't work with jupyter notebook: import cymetric makes the kernel crash and give me the error "src/tcmalloc.cc:278] Attempt to free invalid pointer 0x2d18890." If this seems like a easily fixable problem, I would be glad about any ideas. If it's complicated, I could live with running Cymetric in ipython.
Malte

scopatz

scopatz commented on Jan 13, 2017

@scopatz
Member

I might try to uninstall tcmalloc and recompile cyclus. It is optional anyway.

scopatz

scopatz commented on Jan 13, 2017

@scopatz
Member

FWIW I have had an incredibly hard time getting tcmalloc working in the past. I have abandoned it personally.

maltefgoettsche

maltefgoettsche commented on Jan 17, 2017

@maltefgoettsche
Author

Great - this resolved that issue. So everything works now, except for not being able to use both Pyne and Cymetric. But this should be ok. Thanks for your help!

scopatz

scopatz commented on Jan 17, 2017

@scopatz
Member

Yeah, PyNE needs some love these days.

bam241

bam241 commented on Jul 24, 2017

@bam241
Member

@maltefgoettsche do you still experience those issue

if not any idea how you fixed it ?

added
DefectA bug in an existing feature that should work
on Jul 24, 2017
maltefgoettsche

maltefgoettsche commented on Jul 24, 2017

@maltefgoettsche
Author

I haven't installed PyNE since then (as I haven't needed it so far).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DefectA bug in an existing feature that should work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @scopatz@bam241@maltefgoettsche

        Issue actions

          Segmentation fault (core dumped) · Issue #117 · cyclus/cymetric