conda-forge / coin-or-cbc-feedstock

A conda-smithy repository for coin-or-cbc.
BSD 3-Clause "New" or "Revised" License
3 stars 11 forks source link

Segmentation Fault in libCbcSolver #23

Closed bennibbelink closed 10 months ago

bennibbelink commented 10 months ago

Solution to issue cannot be found in the documentation.

Issue

I have installed libCbcSolver using mamba install coincbc, however when I run my program that I experience a segfault - gdb output below:

Thread 1 "cyclus" received signal SIGSEGV, Segmentation fault.
0x00007ffff426d0ca in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_is_local (this=this@entry=0x55c956e44ad0) at /home/conda/feedstock_root/build_artifacts/gcc_compilers_1695216566116/work/build/x86_64-conda-linux-gnu/libstdc++-v3/include/bits/basic_string.h:264
264     /home/conda/feedstock_root/build_artifacts/gcc_compilers_1695216566116/work/build/x86_64-conda-linux-gnu/libstdc++-v3/include/bits/basic_string.h: No such file or directory.
(gdb) bt
#0  0x00007ffff426d0ca in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_is_local (this=this@entry=0x55c956e44ad0)
    at /home/conda/feedstock_root/build_artifacts/gcc_compilers_1695216566116/work/build/x86_64-conda-linux-gnu/libstdc++-v3/include/bits/basic_string.h:264
#1  0x00007ffff426d5b3 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::capacity (this=this@entry=0x55c956e44ad0)
    at /home/conda/feedstock_root/build_artifacts/gcc_compilers_1695216566116/work/build/x86_64-conda-linux-gnu/libstdc++-v3/include/bits/basic_string.h:1159
#2  0x00007ffff426d5e6 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign (this=0x55c956e44ad0, __str=...)
    at /home/conda/feedstock_root/build_artifacts/gcc_compilers_1695216566116/work/build/x86_64-conda-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:279
#3  0x00007ffff0a6eac0 in CbcMain0(CbcModel&, CbcSolverUsefulData&) () from /opt/conda/lib/libCbcSolver.so.3
#4  0x00007ffff0a71932 in CbcMain0(CbcModel&) () from /opt/conda/lib/libCbcSolver.so.3
#5  0x00007ffff75bc6e1 in cyclus::SolveProg (si=0x555556d6deb8, greedy_obj=3.3000000000000002e+303, verbose=<optimized out>) at /cyclus/src/solver_factory.cc:131
#6  0x00007ffff75b8065 in cyclus::ProgSolver::SolveGraph (this=0x555556d2bb00) at /cyclus/src/prog_solver.cc:85
#7  0x00007ffff75a3aa1 in cyclus::ExchangeSolver::Solve (graph=0x555556d95b60, this=<optimized out>) at /cyclus/src/exchange_solver.h:45
#8  cyclus::ExchangeManager<cyclus::Material>::Execute (this=this@entry=0x7fffffffc530) at /cyclus/src/exchange_manager.h:57
#9  0x00007ffff75a49ec in cyclus::Timer::DoResEx (this=this@entry=0x7fffffffd180, matmgr=matmgr@entry=0x7fffffffc530, genmgr=genmgr@entry=0x7fffffffc540) at /cyclus/src/timer.cc:89
#10 0x00007ffff75a4bf8 in cyclus::Timer::RunSim (this=0x7fffffffd180) at /cyclus/src/timer.cc:36
#11 0x0000555555563755 in main (argc=<optimized out>, argv=<optimized out>) at /cyclus/src/sim_init.h:66

The backtrace points to files in /home/conda/feedstock_root/..., but this directory does not exist (my base env is at /opt/conda. Is there something I need to do to configure my environment with this conda package, or does this look like a problem with the feedstock? I'm running this in a docker container built using this Dockerfile.

Installed packages

# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
archspec                  0.2.1              pyhd8ed1ab_1    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
binutils_impl_linux-64    2.40                 hf600244_0    conda-forge
binutils_linux-64         2.40                 hbdbef99_2    conda-forge
blosc                     1.21.5               h0f2a231_0    conda-forge
boltons                   23.0.0             pyhd8ed1ab_0    conda-forge
boost-cpp                 1.82.0               h44aadfe_6    conda-forge
brotli-python             1.1.0           py311hb755f60_1    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.20.1               hd590300_1    conda-forge
c-blosc2                  2.10.5               hb4ffafa_0    conda-forge
ca-certificates           2023.7.22            hbcca054_0    conda-forge
certifi                   2023.7.22          pyhd8ed1ab_0    conda-forge
cffi                      1.16.0          py311hb3a22ac_0    conda-forge
charset-normalizer        3.3.1              pyhd8ed1ab_0    conda-forge
cmake                     3.27.6               hcfe8598_0    conda-forge
coin-or-cbc               2.10.10              h9002f0b_0    conda-forge
coin-or-cgl               0.60.7               h516709c_0    conda-forge
coin-or-clp               1.17.8               h1ee7a9c_0    conda-forge
coin-or-osi               0.108.8              ha2443b9_0    conda-forge
coin-or-utils             2.11.9               hee58242_0    conda-forge
coincbc                   2.10.10           0_metapackage    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
conda                     23.9.0          py311h38be061_2    conda-forge
conda-content-trust       0.2.0              pyhd8ed1ab_0    conda-forge
conda-package-handling    2.2.0              pyh38be061_0    conda-forge
conda-package-streaming   0.9.0              pyhd8ed1ab_0    conda-forge
cryptography              41.0.5          py311h63ff55d_0    conda-forge
curl                      8.4.0                hca28451_0    conda-forge
cython                    0.29.36         py311hb755f60_1    conda-forge
docker-pycreds            0.4.0                      py_0    conda-forge
exceptiongroup            1.1.3              pyhd8ed1ab_0    conda-forge
fmt                       10.1.1               h00ab1b0_0    conda-forge
gcc_impl_linux-64         13.2.0               h338b0a0_2    conda-forge
gcc_linux-64              13.2.0               h112eaf3_2    conda-forge
gettext                   0.21.1               h27087fc_0    conda-forge
git                       2.42.0          pl5321h86e50cf_0    conda-forge
glib                      2.78.0               hfc55251_0    conda-forge
glib-tools                2.78.0               hfc55251_0    conda-forge
glibmm-2.68               2.78.0               h2f54ecc_0    conda-forge
gxx_impl_linux-64         13.2.0               h338b0a0_2    conda-forge
gxx_linux-64              13.2.0               hc53e3bf_2    conda-forge
hdf5                      1.14.2          nompi_h4f84152_100    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
jsonpatch                 1.33               pyhd8ed1ab_0    conda-forge
jsonpointer               2.4             py311h38be061_3    conda-forge
kernel-headers_linux-64   2.6.32              he073ed8_16    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.21.2               h659d440_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
libaec                    1.1.2                h59595ed_1    conda-forge
libarchive                3.7.2                h039dbb9_0    conda-forge
libblas                   3.9.0           19_linux64_openblas    conda-forge
libboost                  1.82.0               h6fcfa73_6    conda-forge
libboost-devel            1.82.0               h00ab1b0_6    conda-forge
libboost-headers          1.82.0               ha770c72_6    conda-forge
libcap                    2.69                 h0f662aa_0    conda-forge
libcblas                  3.9.0           19_linux64_openblas    conda-forge
libcbor                   0.10.2               hcb278e6_0    conda-forge
libcurl                   8.4.0                hca28451_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libfido2                  1.13.0               h2e5b2a7_0    conda-forge
libgcc-devel_linux-64     13.2.0               ha9c7c90_2    conda-forge
libgcc-ng                 13.2.0               h807b86a_2    conda-forge
libgfortran-ng            13.2.0               h69a702a_2    conda-forge
libgfortran5              13.2.0               ha4646dd_2    conda-forge
libglib                   2.78.0               hebfc3b9_0    conda-forge
libgomp                   13.2.0               h807b86a_2    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
liblapack                 3.9.0           19_linux64_openblas    conda-forge
liblapacke                3.9.0           19_linux64_openblas    conda-forge
libmamba                  1.5.2                had39da4_0    conda-forge
libmambapy                1.5.2           py311hf2555c7_0    conda-forge
libnghttp2                1.55.1               h47da74e_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.24          pthreads_h413a1c8_0    conda-forge
libsanitizer              13.2.0               h7e041cc_2    conda-forge
libsolv                   0.7.25               hfc55251_0    conda-forge
libsqlite                 3.43.2               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-devel_linux-64  13.2.0               ha9c7c90_2    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_2    conda-forge
libudev1                  254                  h3f72095_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libuv                     1.46.0               hd590300_0    conda-forge
libxml2                   2.11.5               h232c23b_1    conda-forge
libxmlpp                  4.0.2                ha770c72_1    conda-forge
libxmlpp-4.0              4.0.2                h550762b_1    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
make                      4.3                  hd18ef5c_1    conda-forge
mamba                     1.5.2           py311h3072747_0    conda-forge
markupsafe                2.1.3           py311h459d7ec_1    conda-forge
ncurses                   6.4                  hcb278e6_0    conda-forge
nomkl                     1.0                  h5ca1d4c_0    conda-forge
numexpr                   2.8.7           py311h039bad6_104    conda-forge
numpy                     1.26.0          py311h64a7726_0    conda-forge
openssh                   9.3p1                h2d3b35a_2    conda-forge
openssl                   3.1.4                hd590300_0    conda-forge
packaging                 23.2               pyhd8ed1ab_0    conda-forge
pandas                    2.1.2           py311h320fe9a_0    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pcre2                     10.40                hc3806b6_0    conda-forge
perl                      5.32.1          4_hd590300_perl5    conda-forge
pip                       23.3.1             pyhd8ed1ab_0    conda-forge
pkg-config                0.29.2            h36c2ea0_1008    conda-forge
pluggy                    1.3.0              pyhd8ed1ab_0    conda-forge
pprintpp                  0.4.0              pyhd8ed1ab_5    conda-forge
py-cpuinfo                9.0.0              pyhd8ed1ab_0    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.6           py311h459d7ec_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pygments                  2.16.1             pyhd8ed1ab_0    conda-forge
pygments-cache            0.1.3              pyh9f0ad1d_0    conda-forge
pyopenssl                 23.2.0             pyhd8ed1ab_1    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
pytables                  3.9.1           py311h10c7f7f_0    conda-forge
pytest                    7.4.3              pyhd8ed1ab_0    conda-forge
python                    3.11.6          hab00c5b_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-tzdata             2023.3             pyhd8ed1ab_0    conda-forge
python_abi                3.11                    4_cp311    conda-forge
pytz                      2023.3.post1       pyhd8ed1ab_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
reproc                    14.2.4.post0         hd590300_1    conda-forge
reproc-cpp                14.2.4.post0         h59595ed_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
rhash                     1.4.4                hd590300_0    conda-forge
ruamel.yaml               0.17.40         py311h459d7ec_0    conda-forge
ruamel.yaml.clib          0.2.7           py311h459d7ec_2    conda-forge
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
sigcpp-3.0                3.6.0                h59595ed_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.10               h9fff704_0    conda-forge
sqlite                    3.43.2               h2c6b66d_0    conda-forge
sysroot_linux-64          2.12                he073ed8_16    conda-forge
tk                        8.6.13               h2797004_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tqdm                      4.66.1             pyhd8ed1ab_0    conda-forge
truststore                0.8.0              pyhd8ed1ab_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
urllib3                   2.0.7              pyhd8ed1ab_0    conda-forge
urwid                     2.2.3           py311h459d7ec_0    conda-forge
websockets                12.0            py311h459d7ec_0    conda-forge
wheel                     0.41.3             pyhd8ed1ab_0    conda-forge
xo                        0.3.3                      py_1    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml-cpp                  0.8.0                h59595ed_0    conda-forge
zlib-ng                   2.0.7                h0b41bf4_0    conda-forge
zstandard                 0.21.0          py311haa97af0_1    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge

Environment info

active environment : None
       user config file : /root/.condarc
 populated config files : /root/.condarc
          conda version : 23.9.0
    conda-build version : not installed
         python version : 3.11.6.final.0
       virtual packages : __archspec=1=skylake
                          __glibc=2.35=0
                          __linux=5.15.90.1=0
                          __unix=0=0
       base environment : /opt/conda  (writable)
      conda av data dir : /opt/conda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
                          /root/.conda/pkgs
       envs directories : /opt/conda/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/23.9.0 requests/2.31.0 CPython/3.11.6 Linux/5.15.90.1-microsoft-standard-WSL2 ubuntu/22.04.3 glibc/2.35
                UID:GID : 0:0
             netrc file : None
           offline mode : False
tkralphs commented 10 months ago

The fact that /home/conda/feedstock_root/ doesn't exist is a red herring. It's because that particular header is not in the same location on your machine as on the build machine.

This issue should most likely be reported over in the Cbc repo, not here. It seems unlikely to be related to conda. The seg fault is happening right away, as soon as Cbc is called, so if I had to guess, I would say it's most like some kind of user error (passing in an invalid argument or something).

I would suggest building Cbc with debugging enabled (this is easy in Linux, see the README) and just running it through a debugger (or even valgrind). At the very least, this will give you a backtrace with line numbers. Even if you can't find the problem yourself, this is the kind of information we would need to debug anything on our side. It would be difficult to figure anything out just from what's posted here. If we can't help you find the error yourself, then we'll eventually need a way to replicate the error easily.

bennibbelink commented 10 months ago

Thanks for the quick response! I will do as you suggest and build Cbc with debugging to try to track down the real source of the segfault.

Closing this issue and will report in the Cbc repo if necessary.