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

NSGA2 segmentation fault #340

Open
eirikurj opened this issue Apr 26, 2023 · 1 comment
Open

NSGA2 segmentation fault #340

eirikurj opened this issue Apr 26, 2023 · 1 comment

Comments

@eirikurj
Copy link
Contributor

Description

The same NSGA2 opt 1 test segfault occasionally in our tests (see here or below). This happens on different systems and architectures, but unfortunately it does not fail consistently. This started to appear around or after #330 was merged.

python3.9:20633 terminated with signal 11 at PC=7efea148725c SP=7ffe7450c440.  Backtrace:
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xdc)[0x7efea148725c]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(PyVectorcall_Call+0x62)[0x7efea1486f92]
/home/***/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pyoptsparse/pyNSGA2/nsga2.cpython-39-x86_64-linux-gnu.so(+0x126fa)[0x7efe60e676fa]
/home/***/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pyoptsparse/pyNSGA2/nsga2.cpython-39-x86_64-linux-gnu.so(+0x148d3)[0x7efe60e698d3]
/home/***/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pyoptsparse/pyNSGA2/nsga2.cpython-39-x86_64-linux-gnu.so(+0x149f3)[0x7efe60e699f3]
/home/***/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pyoptsparse/pyNSGA2/nsga2.cpython-39-x86_64-linux-gnu.so(+0x16d0b)[0x7efe60e6bd0b]
/home/***/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pyoptsparse/pyNSGA2/nsga2.cpython-39-x86_64-linux-gnu.so(+0x6d31)[0x7efe60e5bd31]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0xecb4b)[0x7efea14c1b4b]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyObject_MakeTpCall+0x9a)[0x7efea148744a]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x9dbd)[0x7efea14478ed]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x178f7e)[0x7efea154df7e]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xb1)[0x7efea1487231]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyObject_FastCallDictTstate+0xed)[0x7efea148761d]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyObject_Call_Prepend+0xe3)[0x7efea1487813]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x107cd4)[0x7efea14dccd4]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyObject_MakeTpCall+0x9a)[0x7efea148744a]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x9bf9)[0x7efea1447729]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x178f7e)[0x7efea154df7e]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xb1)[0x7efea1487231]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0xb4dc3)[0x7efea1489dc3]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x7e77)[0x7efea14459a7]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x67bc7)[0x7efea143cbc7]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(PyVectorcall_Call+0x62)[0x7efea1486f92]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x1c5d)[0x7efea143f78d]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x178f7e)[0x7efea154df7e]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xb1)[0x7efea1487231]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0xb4dc3)[0x7efea1489dc3]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x5a64)[0x7efea1443594]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x67bc7)[0x7efea143cbc7]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x5ae9)[0x7efea1443619]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x178f7e)[0x7efea154df7e]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xb1)[0x7efea1487231]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x5ae9)[0x7efea1443619]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x178f7e)[0x7efea154df7e]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xb1)[0x7efea1487231]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x5ae9)[0x7efea1443619]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0xc3ab8)[0x7efea1498ab8]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x4a53)[0x7efea1442583]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0xc3ab8)[0x7efea1498ab8]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x4a53)[0x7efea1442583]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0xc3ab8)[0x7efea1498ab8]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x4a53)[0x7efea1442583]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0xc3ab8)[0x7efea1498ab8]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x4a53)[0x7efea1442583]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0xc3ab8)[0x7efea1498ab8]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x4a53)[0x7efea1442583]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0xc3ab8)[0x7efea1498ab8]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x4a53)[0x7efea1442583]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x67bc7)[0x7efea143cbc7]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x5a64)[0x7efea1443594]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x178f7e)[0x7efea154df7e]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xb1)[0x7efea1487231]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x5a64)[0x7efea1443594]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x178f7e)[0x7efea154df7e]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(_PyEval_EvalCodeWithName+0x52)[0x7efea154e312]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(PyEval_EvalCodeEx+0x3e)[0x7efea154e35e]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(PyEval_EvalCode+0x1b)[0x7efea154e38b]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x1b0089)[0x7efea1585089]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x1b0181)[0x7efea1585181]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(+0x1b2d0f)[0x7efea1587d0f]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(PyRun_SimpleFileExFlags+0x122)[0x7efea1587ea2]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(Py_RunMain+0x6b8)[0x7efea15a2cf8]
/home/***/.pyenv/versions/3.9.16/lib/libpython3.9.so.1.0(Py_BytesMain+0x39)[0x7efea15a3209]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7efea1005c87]
/home/***/.pyenv/versions/3.9.16/bin/python3.9(_start+0x2a)[0x55a58fc0075a]
@hfuj
Copy link

hfuj commented Jun 19, 2023

I don't know what causes this error, but I think there is a bug in pyNSGA2/allocate.c.

line 33: ind->gene = (int **)malloc(global.nbinsizeof(int));
->
ind->gene = (int **)malloc(global.nbin
sizeof(int*));

The code before modification will work on 32-bit OS, but may fail on 64-bit OS.

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

No branches or pull requests

2 participants