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

Error in `python': double free or corruption (out) #138

Open
icankeep opened this issue Dec 14, 2021 · 13 comments
Open

Error in `python': double free or corruption (out) #138

icankeep opened this issue Dec 14, 2021 · 13 comments

Comments

@icankeep
Copy link

$ python
Python 3.6.13 | packaged by conda-forge | (default, Sep 23 2021, 07:56:31) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cylp.cy import CyClpSimplex
>>> s = CyClpSimplex()
*** Error in `python': double free or corruption (out): 0x000056182c3083f0 ***
======= Backtrace: =========
/usr/lib64/libc.so.6(+0x81679)[0x7f26c37c4679]
/conda/envs/notebook/lib/libstdc++.so.6(_ZNSs6assignERKSs+0x41)[0x7f26c2b209a5]
/conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyClpSimplex.cpython-36m-x86_64-linux-gnu.so(_ZN11IClpSimplexC2EP7_objectPFiPvEPFiS2_iE+0xd4)[0x7f26b8a4fc64]
/conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyClpSimplex.cpython-36m-x86_64-linux-gnu.so(+0x67d05)[0x7f26b8a93d05]
python(+0xf9ed6)[0x56182aba0ed6]
python(_PyObject_FastCallKeywords+0x193)[0x56182abfc443]
python(+0x155e65)[0x56182abfce65]
python(_PyEval_EvalFrameDefault+0x53c)[0x56182ac4b7bc]
python(+0xe9a95)[0x56182ab90a95]
python(PyEval_EvalCodeEx+0x39)[0x56182ab91f29]
python(PyEval_EvalCode+0x1b)[0x56182ac6387b]
python(+0x2239b3)[0x56182acca9b3]
python(+0xc7473)[0x56182ab6e473]
python(PyRun_InteractiveLoopFlags+0xed)[0x56182ab6ed75]
python(+0xc7e14)[0x56182ab6ee14]
python(Py_Main+0x6a7)[0x56182acd0d67]
python(main+0xe7)[0x56182ab73d17]
/usr/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f26c3765505]
python(+0x1ab83d)[0x56182ac5283d]
======= Memory map: ========
56182aaa7000-56182aafe000 r--p 00000000 fd:08 1330795                    /conda/envs/notebook/bin/python3.6
56182aafe000-56182acd5000 r-xp 00057000 fd:08 1330795                    /conda/envs/notebook/bin/python3.6
56182acd5000-56182ad7b000 r--p 0022e000 fd:08 1330795                    /conda/envs/notebook/bin/python3.6
56182ad7c000-56182ad7f000 r--p 002d4000 fd:08 1330795                    /conda/envs/notebook/bin/python3.6
56182ad7f000-56182ade2000 rw-p 002d7000 fd:08 1330795                    /conda/envs/notebook/bin/python3.6
56182ade2000-56182ae13000 rw-p 00000000 00:00 0 
56182bd27000-56182c325000 rw-p 00000000 00:00 0                          [heap]
7f2690000000-7f2690021000 rw-p 00000000 00:00 0 
7f2690021000-7f2694000000 ---p 00000000 00:00 0 
7f2697a9c000-7f2697aa0000 r--p 00000000 fd:08 1457209                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDantzigPivot.cpython-36m-x86_64-linux-gnu.so
7f2697aa0000-7f2697aab000 r-xp 00004000 fd:08 1457209                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDantzigPivot.cpython-36m-x86_64-linux-gnu.so
7f2697aab000-7f2697aad000 r--p 0000f000 fd:08 1457209                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDantzigPivot.cpython-36m-x86_64-linux-gnu.so
7f2697aad000-7f2697aae000 ---p 00011000 fd:08 1457209                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDantzigPivot.cpython-36m-x86_64-linux-gnu.so
7f2697aae000-7f2697aaf000 r--p 00011000 fd:08 1457209                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDantzigPivot.cpython-36m-x86_64-linux-gnu.so
7f2697aaf000-7f2697ab0000 rw-p 00012000 fd:08 1457209                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDantzigPivot.cpython-36m-x86_64-linux-gnu.so
7f2697ab0000-7f2697ab1000 rw-p 00000000 00:00 0 
7f2697ab1000-7f2697ab6000 r--p 00000000 fd:08 1457206                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyCoinMpsIO.cpython-36m-x86_64-linux-gnu.so
7f2697ab6000-7f2697ac0000 r-xp 00005000 fd:08 1457206                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyCoinMpsIO.cpython-36m-x86_64-linux-gnu.so
7f2697ac0000-7f2697ac3000 r--p 0000f000 fd:08 1457206                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyCoinMpsIO.cpython-36m-x86_64-linux-gnu.so
7f2697ac3000-7f2697ac4000 ---p 00012000 fd:08 1457206                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyCoinMpsIO.cpython-36m-x86_64-linux-gnu.so
7f2697ac4000-7f2697ac5000 r--p 00012000 fd:08 1457206                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyCoinMpsIO.cpython-36m-x86_64-linux-gnu.so
7f2697ac5000-7f2697ac7000 rw-p 00013000 fd:08 1457206                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyCoinMpsIO.cpython-36m-x86_64-linux-gnu.so
7f2697ac7000-7f2697acb000 r--p 00000000 fd:08 1457210                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDualPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697acb000-7f2697ad4000 r-xp 00004000 fd:08 1457210                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDualPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697ad4000-7f2697ad7000 r--p 0000d000 fd:08 1457210                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDualPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697ad7000-7f2697ad8000 r--p 0000f000 fd:08 1457210                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDualPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697ad8000-7f2697ad9000 rw-p 00010000 fd:08 1457210                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyDualPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697ad9000-7f2697add000 r--p 00000000 fd:08 1457214                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697add000-7f2697ae4000 r-xp 00004000 fd:08 1457214                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697ae4000-7f2697ae6000 r--p 0000b000 fd:08 1457214                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697ae6000-7f2697ae7000 r--p 0000c000 fd:08 1457214                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697ae7000-7f2697ae8000 rw-p 0000d000 fd:08 1457214                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyPivotPythonBase.cpython-36m-x86_64-linux-gnu.so
7f2697ae8000-7f2697aec000 r--p 00000000 fd:08 1457213                    /conda/envs/notebook/lib/python3.6/site-packages/cylp/cy/CyPEPivot.cpython-36m-x86_64-linux-gnu.soAborted (core dumped)
@icankeep
Copy link
Author

python3.6

  1. conda install coin-or-cbc

  2. pip install cylp

  3. python

from cylp.cy import CyClpSimplex
s = CyClpSimplex()

then error:
Error in `python': double free or corruption (out)

@tkralphs
Copy link
Member

This looks related to this comment in #137, but I can't seem to replicate. It could also be related to #105. Can you see if installing 875d5d5 fixes it?

@icankeep
Copy link
Author

I tried to install it locally with this commit version, but still the same problem

git clone [email protected]:coin-or/CyLP.git
git checkout  875d5d5
cd CyLP
python setup.py install

@cafunechen
Copy link

I tried to install it locally with this commit version, but still the same problem

git clone [email protected]:coin-or/CyLP.git
git checkout  875d5d5
cd CyLP
python setup.py install

oh, I didn't expect someone to have the same problem as me. If you solve it, can you tell me? thanks!! that’s my problem #137

@cafunechen
Copy link

cafunechen commented Dec 15, 2021

and the different is ,when i build git checkout 875d5d5 ,the error cames different

from cylp.cy import CyClpSimplex


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/CyLP/cylp/cy/__init__.py", line 1, in <module>
    from .CyCoinIndexedVector import CyCoinIndexedVector
ModuleNotFoundError: No module named 'cylp.cy.CyCoinIndexedVector'

and my step is

git clone -n  https://github.com/coin-or/CyLP.git
cd Cylp
git checkout  875d5d5ad07cd1b4b53d3715e4aa29164a025e9
python setup.py install

@icankeep
Copy link
Author

Traceback (most recent call last):
File "", line 1, in
File "~/CyLP/cylp/cy/init.py", line 1, in
from .CyCoinIndexedVector import CyCoinIndexedVector
ModuleNotFoundError: No module named 'cylp.cy.CyCoinIndexedVector'

git clone -n  https://github.com/coin-or/CyLP.git
cd Cylp
git checkout  875d5d5ad07cd1b4b53d3715e4aa29164a025e9
python setup.py install

# Need to add this step
cd cylp/cy
python

>> from cylp.cy import CyClpSimplex
>> s = CyClpSimplex()

@cafunechen
Copy link

s = CyClpSimplex()

ok, i get the same error~

@tkralphs
Copy link
Member

# Need to add this step
cd cylp/cy
python

I don't understand this. Are you saying it only happens if you are in this directory? In general, for Python 3, you should not be in the directory containing the source when you work with the package because relative imports don't work correctly. In any case, I can't replicate any of this. Can you give some more details, such as what distro and version you're using, etc.

@tkralphs
Copy link
Member

OK, I now tried running CyLP through valgrind and I do see some memory errors---they're just not causing a crash in my case (strangely). So I will try to debug this.

@tkralphs
Copy link
Member

I haven't really been able to uncover anything. The memory errors I see seem to be internal to Python (using uninitialized value kind of stuff, which are not always consequential errors). So I guess I will need some help in replicating this after all. It looks a bit strange to me.

@tkralphs
Copy link
Member

tkralphs commented Dec 22, 2021

If anyone who is seeing this issue can build CyLP with debugging symbols and run through valgrind, that would be super helpful. Even better, build Cbc from source with debugging symbols. I think just doing python setup.py build --debug should work for building CyLP with debugging symbols. For Cbc, follow the instructions here, adding the flag --enable-debug in the build step.

UPDATE: After building the Cbc source, you need to set the environment variable COIN_INSTALL_DIR in order to tell CyLP to link to your custom-built version. Alternatively, what I eventually dis was just to copy the libraries into the lib directory of my conda virtual environment.

@cafunechen
Copy link

which version should i build Cylp? the 875d5d5 or the latest ?

@tkralphs
Copy link
Member

which version should i build Cylp? the 875d5d5 or the latest ?

I guess that building the latest would give us the most information. But the best would be to build both in different virtual environments.

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

3 participants