nmslib / hnswlib

Header-only C++/python library for fast approximate nearest neighbors
https://github.com/nmslib/hnswlib
Apache License 2.0
4.11k stars 607 forks source link

Illegal instruction (core dumped) when importing hnswlib #553

Open srmrz opened 3 months ago

srmrz commented 3 months ago
$ python3
Python 3.8.11 (default, Dec 14 2023, 18:16:24) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hnswlib
Illegal instruction (core dumped)
ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

Using hnwlib==3.8.0 in a Docker container

srmrz commented 2 months ago
Core was generated by `python3'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x000000400374f2f0 in std::_Deque_base<hnswlib::VisitedList*, std::allocator<hnswlib::VisitedList*> >::_M_initialize_map (__num_elements=0, this=0x4002b93eb0)
    at /usr/include/c++/9/ext/new_allocator.h:89
89        ~new_allocator() _GLIBCXX_USE_NOEXCEPT { }
(gdb) backtrace
#0  0x000000400374f2f0 in std::_Deque_base<hnswlib::VisitedList*, std::allocator<hnswlib::VisitedList*> >::_M_initialize_map (__num_elements=0, this=0x4002b93eb0)
    at /usr/include/c++/9/ext/new_allocator.h:89
#1  std::_Deque_base<hnswlib::VisitedList*, std::allocator<hnswlib::VisitedList*> >::_Deque_base (this=0x4002b93eb0) at /usr/include/c++/9/bits/stl_deque.h:510
#2  std::deque<hnswlib::VisitedList*, std::allocator<hnswlib::VisitedList*> >::deque (this=0x4002b93eb0) at /usr/include/c++/9/bits/stl_deque.h:915
#3  hnswlib::VisitedListPool::VisitedListPool (initmaxpools=1, numelements1=58210594, this=0x4002b93eb0) at ./hnswlib/visited_list_pool.h:44
#4  hnswlib::HierarchicalNSW<float>::HierarchicalNSW (this=0x4002b93fe0, s=<optimized out>, max_elements=274936117538, M=<optimized out>, ef_construction=<optimized out>, 
    random_seed=<optimized out>, allow_replace_deleted=<optimized out>) at ./hnswlib/hnswalg.h:132
#5  0x0000004002b94110 in ?? ()
#6  0x0000004002b94660 in ?? ()
#7  0x00000040000b273d in ?? ()
#8  0x000000000000007f in ?? ()
#9  0x655f81e49063b200 in ?? ()
#10 0x0000004002b94660 in ?? ()
#11 0x0000004002b93fe0 in ?? ()
#12 0x000000400335f040 in ?? ()
#13 0x655f81e49063b200 in ?? ()
#14 0x00000040037848f0 in ?? () from /usr/local/lib/python3.8/site-packages/hnswlib.cpython-38-x86_64-linux-gnu.so
#15 0x0000004002b94680 in ?? ()
#16 0x0000004002b93fd0 in ?? ()
#17 0x0000004002b94020 in ?? ()
#18 0x0000004003783922 in ?? () from /usr/local/lib/python3.8/site-packages/hnswlib.cpython-38-x86_64-linux-gnu.so
#19 0x0000004002b94110 in ?? ()
#20 0x0000004002b94660 in ?? ()
#21 0x000000400375208a in pybind11::detail::translate_exception (p=<error reading variable: Cannot access memory at address 0x0>)
    at /tmp/pip-build-env-212wgnby/overlay/lib/python3.8/site-packages/pybind11/include/pybind11/detail/../detail/internals.h:403
#22 0x000000400335e270 in ?? ()
#23 0x000000400335e270 in ?? ()
#24 0x000000400335e1f0 in ?? ()
#25 0x0000000000000000 in ?? ()