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

importing LibMambaSolver directly crashes interpreter #527

Closed
2 tasks done
jjhelmus opened this issue Sep 16, 2024 · 3 comments
Closed
2 tasks done

importing LibMambaSolver directly crashes interpreter #527

jjhelmus opened this issue Sep 16, 2024 · 3 comments
Labels
type::bug describes erroneous operation, use severity::* to classify the type

Comments

@jjhelmus
Copy link
Contributor

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

Attempting to import the LibMambaSolver class directly on macOS crashes the interpreter. Adding some conda imports before this seems to solve the issue.

Demo:

❯ python -c "from conda_libmamba_solver.solver import LibMambaSolver"
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString stringByStandardizingPath]: unrecognized selector sent to instance 0x6000009ac200'
*** First throw call stack:
(
        0   CoreFoundation                      0x00000001851d22ec __exceptionPreprocess + 176
        1   libobjc.A.dylib                     0x0000000184cb6158 objc_exception_throw + 60
        2   CoreFoundation                      0x000000018528456c -[NSObject(NSObject) __retain_OA] + 0
        3   CoreFoundation                      0x000000018513bf3c ___forwarding___ + 1580
        4   CoreFoundation                      0x000000018513b850 _CF_forwarding_prep_0 + 96
        5   Foundation                          0x000000018623bb34 -[NSProcessInfo arguments] + 188
        6   CoreFoundation                      0x000000018524dfec __getDefaultArguments_block_invoke + 96
        7   libdispatch.dylib                   0x0000000184ecd3e8 _dispatch_client_callout + 20
        8   libdispatch.dylib                   0x0000000184ecec68 _dispatch_once_callout + 32
        9   CoreFoundation                      0x000000018524d988 _addBackstopValuesForIdentifierAndSource + 652
        10  CoreFoundation                      0x000000018510740c __81-[_CFXPreferences(SourceAdditions) withNamedVolatileSourceForIdentifier:perform:]_block_invoke + 144
        11  CoreFoundation                      0x000000018524d624 -[_CFXPreferences withNamedVolatileSourceForIdentifier:perform:] + 272
        12  CoreFoundation                      0x000000018510d794 -[CFPrefsSearchListSource addNamedVolatileSourceForIdentifier:] + 136
        13  CoreFoundation                      0x000000018528c974 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke.155 + 296
        14  CoreFoundation                      0x000000018528c5e4 -[_CFXPreferences withSearchLists:] + 84
        15  CoreFoundation                      0x0000000185108ce4 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 300
        16  CoreFoundation                      0x000000018528c7c8 -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 440
        17  CoreFoundation                      0x0000000185108608 -[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:] + 156
        18  CoreFoundation                      0x0000000185108530 _CFPreferencesCopyAppValueWithContainerAndConfiguration + 112
        19  SystemConfiguration                 0x0000000185eba818 SCDynamicStoreCopyProxiesWithOptions + 180
        20  libcurl.4.dylib                     0x0000000102549eec Curl_macos_init + 16
        21  libcurl.4.dylib                     0x00000001025266d4 global_init + 172
        22  libcurl.4.dylib                     0x0000000102526618 curl_global_init + 68
        23  libmamba.2.0.0.dylib                0x000000010219d280 _GLOBAL__sub_I_singletons.cpp + 24
        24  dyld                                0x0000000184d0e608 ___ZZNK5dyld46Loader25findAndRunAllInitializersERNS_12RuntimeStateEENK3$_0clEv_block_invoke + 168
        25  dyld                                0x0000000184d4cb38 ___ZNK5dyld313MachOAnalyzer18forEachInitializerER11DiagnosticsRKNS0_15VMAddrConverterEU13block_pointerFvjEPKv_block_invoke.202 + 172
        26  dyld                                0x0000000184d40400 ___ZNK5dyld39MachOFile14forEachSectionEU13block_pointerFvRKNS0_11SectionInfoEbRbE_block_invoke + 496
        27  dyld                                0x0000000184cef2fc _ZNK5dyld39MachOFile18forEachLoadCommandER11DiagnosticsU13block_pointerFvPK12load_commandRbE + 300
        28  dyld                                0x0000000184d3f394 _ZNK5dyld39MachOFile14forEachSectionEU13block_pointerFvRKNS0_11SectionInfoEbRbE + 192
        29  dyld                                0x0000000184d41c6c _ZNK5dyld39MachOFile32forEachInitializerPointerSectionER11DiagnosticsU13block_pointerFvjjRbE + 160
        30  dyld                                0x0000000184d4c82c _ZNK5dyld313MachOAnalyzer18forEachInitializerER11DiagnosticsRKNS0_15VMAddrConverterEU13block_pointerFvjEPKv + 432
        31  dyld                                0x0000000184d0a53c _ZNK5dyld46Loader25findAndRunAllInitializersERNS_12RuntimeStateE + 564
        32  dyld                                0x0000000184d10bc0 _ZNK5dyld416JustInTimeLoader15runInitializersERNS_12RuntimeStateE + 36
        33  dyld                                0x0000000184d0a984 _ZNK5dyld46Loader23runInitializersBottomUpERNS_12RuntimeStateERN5dyld35ArrayIPKS0_EE + 220
        34  dyld                                0x0000000184d0a928 _ZNK5dyld46Loader23runInitializersBottomUpERNS_12RuntimeStateERN5dyld35ArrayIPKS0_EE + 128
        35  dyld                                0x0000000184d0e698 _ZZNK5dyld46Loader38runInitializersBottomUpPlusUpwardLinksERNS_12RuntimeStateEENK3$_1clEv + 116
        36  dyld                                0x0000000184d0ab78 _ZNK5dyld46Loader38runInitializersBottomUpPlusUpwardLinksERNS_12RuntimeStateE + 420
        37  dyld                                0x0000000184d26d30 _ZN5dyld44APIs11dlopen_fromEPKciPv + 1876
        38  python3.12                          0x0000000100e6b5c8 _PyImport_LoadDynamicModuleWithSpec + 580
        39  python3.12                          0x0000000100e6a89c _imp_create_dynamic + 168
        40  python3.12                          0x0000000100d34120 cfunction_vectorcall_FASTCALL + 96
        41  python3.12                          0x0000000100e25c48 _PyEval_EvalFrameDefault + 230832
        42  python3.12                          0x0000000100ccb1a0 _PyObject_VectorcallTstate.781 + 88
        43  python3.12                          0x0000000100ccf534 object_vacall + 272
        44  python3.12                          0x0000000100ccf3b8 PyObject_CallMethodObjArgs + 124
        45  python3.12                          0x0000000100e687a0 PyImport_ImportModuleLevelObject + 3336
        46  python3.12                          0x0000000100e17550 _PyEval_EvalFrameDefault + 171704
        47  python3.12                          0x0000000100deb470 PyEval_EvalCode + 260
        48  python3.12                          0x0000000100de6fbc builtin_exec + 404
        49  python3.12                          0x0000000100d3406c cfunction_vectorcall_FASTCALL_KEYWORDS + 92
        50  python3.12                          0x0000000100e25c48 _PyEval_EvalFrameDefault + 230832
        51  python3.12                          0x0000000100ccb1a0 _PyObject_VectorcallTstate.781 + 88
        52  python3.12                          0x0000000100ccf534 object_vacall + 272
        53  python3.12                          0x0000000100ccf3b8 PyObject_CallMethodObjArgs + 124
        54  python3.12                          0x0000000100e687a0 PyImport_ImportModuleLevelObject + 3336
        55  python3.12                          0x0000000100e17550 _PyEval_EvalFrameDefault + 171704
        56  python3.12                          0x0000000100deb470 PyEval_EvalCode + 260
        57  python3.12                          0x0000000100de6fbc builtin_exec + 404
        58  python3.12                          0x0000000100d3406c cfunction_vectorcall_FASTCALL_KEYWORDS + 92
        59  python3.12                          0x0000000100e25c48 _PyEval_EvalFrameDefault + 230832
        60  python3.12                          0x0000000100ccb1a0 _PyObject_VectorcallTstate.781 + 88
        61  python3.12                          0x0000000100ccf534 object_vacall + 272
        62  python3.12                          0x0000000100ccf3b8 PyObject_CallMethodObjArgs + 124
        63  python3.12                          0x0000000100e687a0 PyImport_ImportModuleLevelObject + 3336
        64  python3.12                          0x0000000100e17550 _PyEval_EvalFrameDefault + 171704
        65  python3.12                          0x0000000100deb470 PyEval_EvalCode + 260
        66  python3.12                          0x0000000100de6fbc builtin_exec + 404
        67  python3.12                          0x0000000100d3406c cfunction_vectorcall_FASTCALL_KEYWORDS + 92
        68  python3.12                          0x0000000100e25c48 _PyEval_EvalFrameDefault + 230832
        69  python3.12                          0x0000000100ccb1a0 _PyObject_VectorcallTstate.781 + 88
        70  python3.12                          0x0000000100ccf534 object_vacall + 272
        71  python3.12                          0x0000000100ccf3b8 PyObject_CallMethodObjArgs + 124
        72  python3.12                          0x0000000100e
libc++abi: terminating due to uncaught exception of type NSException
zsh: abort      python -c "from conda_libmamba_solver.solver import LibMambaSolver"

Conda Info

active environment : base
    active env location : /Users/jhelmus/demo/bug/demo
            shell level : 2
       user config file : /Users/jhelmus/.condarc
 populated config files : /Users/jhelmus/.condarc
          conda version : 24.7.1
    conda-build version : not installed
         python version : 3.12.5.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=m1
                          __conda=24.7.1=0
                          __osx=14.6.1=0
                          __unix=0=0
       base environment : /Users/jhelmus/demo/bug/demo  (writable)
      conda av data dir : /Users/jhelmus/demo/bug/demo/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-arm64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-arm64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/jhelmus/demo/bug/demo/pkgs
                          /Users/jhelmus/.conda/pkgs
       envs directories : /Users/jhelmus/demo/bug/demo/envs
                          /Users/jhelmus/.conda/envs
               platform : osx-arm64
             user-agent : conda/24.7.1 requests/2.32.3 CPython/3.12.5 Darwin/23.6.0 OSX/14.6.1 solver/libmamba conda-libmamba-solver/24.7.0 libmambapy/1.5.8
                UID:GID : 502:20
             netrc file : None
           offline mode : False

Conda Config

==> /Users/jhelmus/.condarc <==
add_pip_as_python_dependency: False
changeps1: False
ssl_verify: True
report_errors: False

Conda list

# packages in environment at /Users/jhelmus/demo/bug/demo:
#
# Name                    Version                   Build  Channel
archspec                  0.2.3              pyhd3eb1b0_0    defaults
boltons                   23.0.0          py312hca03da5_0    defaults
brotli-python             1.0.9           py312h313beb8_8    defaults
bzip2                     1.0.8                h80987f9_6    defaults
c-ares                    1.19.1               h80987f9_0    defaults
ca-certificates           2024.7.2             hca03da5_0    defaults
certifi                   2024.8.30       py312hca03da5_0    defaults
cffi                      1.16.0          py312h80987f9_1    defaults
charset-normalizer        3.3.2              pyhd3eb1b0_0    defaults
conda                     24.7.1          py312hca03da5_0    defaults
conda-libmamba-solver     24.7.0             pyhd3eb1b0_0    defaults
conda-package-handling    2.3.0           py312hca03da5_0    defaults
conda-package-streaming   0.10.0          py312hca03da5_0    defaults
distro                    1.9.0           py312hca03da5_0    defaults
expat                     2.6.3                h313beb8_0    defaults
fmt                       9.1.0                h48ca7d4_1    defaults
frozendict                2.4.2           py312hca03da5_0    defaults
icu                       73.1                 h313beb8_0    defaults
idna                      3.7             py312hca03da5_0    defaults
jsonpatch                 1.33            py312hca03da5_1    defaults
jsonpointer               2.1                pyhd3eb1b0_0    defaults
krb5                      1.20.1               hf3e1bf2_1    defaults
libarchive                3.7.4                h8f13d7a_0    defaults
libcurl                   8.9.1                h3e2b118_0    defaults
libcxx                    14.0.6               h848a8c0_0    defaults
libedit                   3.1.20230828         h80987f9_0    defaults
libev                     4.33                 h1a28f6b_1    defaults
libffi                    3.4.4                hca03da5_1    defaults
libiconv                  1.16                 h80987f9_3    defaults
libmamba                  1.5.8                haeffa04_3    defaults
libmambapy                1.5.8           py312h1c5506f_3    defaults
libnghttp2                1.57.0               h62f6fdd_0    defaults
libsolv                   0.7.24               h514c7bf_1    defaults
libssh2                   1.11.0               h3e2b118_0    defaults
libxml2                   2.13.1               h0b34f26_2    defaults
lz4-c                     1.9.4                h313beb8_1    defaults
menuinst                  2.1.2           py312hca03da5_0    defaults
ncurses                   6.4                  h313beb8_0    defaults
openssl                   3.0.15               h80987f9_0    defaults
packaging                 24.1            py312hca03da5_0    defaults
pcre2                     10.42                hb066dcc_1    defaults
platformdirs              3.10.0          py312hca03da5_0    defaults
pluggy                    1.0.0           py312hca03da5_1    defaults
pybind11-abi              5                    hd3eb1b0_0    defaults
pycosat                   0.6.6           py312h80987f9_1    defaults
pycparser                 2.21               pyhd3eb1b0_0    defaults
pysocks                   1.7.1           py312hca03da5_0    defaults
python                    3.12.5               h99e199e_1    defaults
readline                  8.2                  h1a28f6b_0    defaults
reproc                    14.2.4               h313beb8_2    defaults
reproc-cpp                14.2.4               h313beb8_2    defaults
requests                  2.32.3          py312hca03da5_0    defaults
ruamel.yaml               0.17.21         py312h80987f9_0    defaults
setuptools                72.1.0          py312hca03da5_0    defaults
sqlite                    3.45.3               h80987f9_0    defaults
tk                        8.6.14               h6ba3021_0    defaults
tqdm                      4.66.5          py312h989b03a_0    defaults
truststore                0.8.0           py312hca03da5_0    defaults
tzdata                    2024a                h04d1e81_0    defaults
urllib3                   2.2.2           py312hca03da5_0    defaults
xz                        5.4.6                h80987f9_1    defaults
yaml-cpp                  0.8.0                h313beb8_1    defaults
zlib                      1.2.13               h18a0788_1    defaults
zstandard                 0.22.0          py312h1a4646a_0    defaults
zstd                      1.5.5                hd90d995_2    defaults

Additional Context

No response

@jjhelmus jjhelmus added the type::bug describes erroneous operation, use severity::* to classify the type label Sep 16, 2024
@jjhelmus
Copy link
Contributor Author

This error is coming from libmambapy which is imported in the solver module.

❯ python -c "import libmambapy"                                                                                                                                                         
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString stringByStandardizingPath]: unrecognized selector sent to instance 0x60000314c200'  
*** First throw call stack:          
...

@jaimergp
Copy link
Contributor

Yea, I don't think we can't do much from here if the exception is coming from libmambapy. The stacktrace hints at libcurl. Maybe try a different version of libcurl? Or sourcing the same environment exclusively from conda-forge.

@jjhelmus
Copy link
Contributor Author

Using packages from conda-forge I am not able to replicate this issue. Seems to be an issue with the way libmambapy or one of its dependencies is packaged in defaults for osx-arm64. I'll follow up with the team at Anaconda.

Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type
Projects
Status: 🏁 Done
Development

No branches or pull requests

2 participants