01-15-2021 06:46 AM - edited 01-15-2021 06:46 AM
Hello,
I'm experiencing a crash both on Ubuntu 20.04 and RHEL8.2 (inside a docker container) with YDK 0.8.5 (official repo). Crash happens as soon as YDK tries to connect to the device (any protocol). Here is what GDB reported, I hope any of you can help because I'm blocked:
Program received signal SIGSEGV, Segmentation fault.
0x00007f75ade4f91c in pybind11::detail::instance::get_value_and_holder(pybind11::detail::type_info const*, bool) () from /usr/local/lib64/python3.6/site-packages/ydk_.so
(gdb) bt
#0 0x00007f75ade4f91c in pybind11::detail::instance::get_value_and_holder(pybind11::detail::type_info const*, bool) () from /usr/local/lib64/python3.6/site-packages/ydk_.so
#1 0x00007f75ade6453e in pybind11::cpp_function::dispatcher(_object*, _object*, _object*) () from /usr/local/lib64/python3.6/site-packages/ydk_.so
#2 0x00007f75b30e2325 in PyCFunction_Call () from /lib64/libpython3.6m.so.1.0
#3 0x00007f75b306bfb7 in PyObject_Call () from /lib64/libpython3.6m.so.1.0
#4 0x00007f75b306bbfc in _PyObject_FastCallDict () from /lib64/libpython3.6m.so.1.0
#5 0x00007f75b30bdbc8 in call_function () from /lib64/libpython3.6m.so.1.0
#6 0x00007f75b30e64c4 in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
#7 0x00007f75b306b25a in _PyFunction_FastCallDict () from /lib64/libpython3.6m.so.1.0
#8 0x00007f75b306bc1e in _PyObject_FastCallDict () from /lib64/libpython3.6m.so.1.0
#9 0x00007f75b3074db1 in _PyObject_Call_Prepend () from /lib64/libpython3.6m.so.1.0
#10 0x00007f75b306bfb7 in PyObject_Call () from /lib64/libpython3.6m.so.1.0
#11 0x00007f75b30c17d9 in slot_tp_init () from /lib64/libpython3.6m.so.1.0
#12 0x00007f75b30bdc8b in type_call () from /lib64/libpython3.6m.so.1.0
#13 0x00007f75ade4f803 in pybind11_meta_call () from /usr/local/lib64/python3.6/site-packages/ydk_.so
#14 0x00007f75b306bbfc in _PyObject_FastCallDict () from /lib64/libpython3.6m.so.1.0
#15 0x00007f75b30bdbc8 in call_function () from /lib64/libpython3.6m.so.1.0
#16 0x00007f75b30e64c4 in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
#17 0x00007f75b30c8397 in PyEval_EvalCodeEx () from /lib64/libpython3.6m.so.1.0
#18 0x00007f75b30c90eb in PyEval_EvalCode () from /lib64/libpython3.6m.so.1.0
#19 0x00007f75b3168962 in run_mod () from /lib64/libpython3.6m.so.1.0
#20 0x00007f75b3040633 in PyRun_FileExFlags () from /lib64/libpython3.6m.so.1.0
#21 0x00007f75b3044ffb in PyRun_SimpleFileExFlags () from /lib64/libpython3.6m.so.1.0
#22 0x00007f75b30462ee in Py_Main.cold.2600 () from /lib64/libpython3.6m.so.1.0
#23 0x000056118e53ab96 in main ()
(gdb)
Script is the following:
from ydk.providers import NetconfServiceProvider from ydk.services import CRUDService if __name__ == "__main__": provider = NetconfServiceProvider(address="10.51.65.230", port=830, username="lab", password="lab", protocol="ssh") crud = CRUDService()
Crash is in CRUDService().
Thanks!
Solved! Go to Solution.
01-19-2021 06:22 AM
Once forced the pybind11 version in "pip install pybind" to install the same version of the package installed with "yum install pybind11-devel" I managed to solve my issue. However I also needed the fix to the calls to __init__() of the *ProviderService classes that is in your fork.
01-15-2021 10:49 AM
I am afraid you have issue with YDK core packages installation. Try to clean all build and dist directories and then recompile and reinstall libydk and Python core package. If still crashing, please share the installation console for further analysis.
Please note, that all the unit and sample tests on Ubuntu 20.04 and CentOS-8.2 have passed before I claimed support for these platforms. I also tested them with connection to XE and XR sandboxes. All was working for me fine.
01-15-2021 11:07 AM
I'm totally sure it's tested and working. I'm just stuck with this crash for whatever reason. I'm trying to resolve some other weird behaviors I have hoping those are also the cause of the crash. In case that doesn't work I'll update this thread. Thanks for the support.
01-15-2021 11:58 AM - edited 01-15-2021 12:00 PM
One question, Yan. What's the version of pybind11 that you used for testing? The install_ydk.sh is running "pip install pybind11" which installs v2.6.1 in my case.
01-15-2021 05:55 PM
On my side it was installed v2.2.2 (script test/tests.sh:201):
(venv) Yakovs-Air:ydk-gen ygorelik$ pip list | grep pybind
pybind11 2.2.2
Try to downgrade pybind11 and let us know. In the meanwhile I will add this version to ydk-gen/requirements.txt.
01-18-2021 03:05 AM - edited 01-18-2021 03:07 AM
I tried v2.2.2 but I still have issues. I've realised that in order to run "generate.py -i --python --core" I need pybind11-devel installed. What is available on my repo is v2.4.3, so I installed this package but also "pip install pybind11==2.4.3". That didn't solve the issue. BTW I also tried this in YDK v0.8.4 and I have the same issue, that means the problem isn't YDK related, but it's rather the requirement for OS dependencies that makes the installation procedure very unstable. Isn't there a way for you to package all the dependencies together with the ydk-gen sources? This way it won't require installation of deps into the OS and it'll make possible for non-root/non-sudoers to install the tool.
01-19-2021 06:22 AM
Once forced the pybind11 version in "pip install pybind" to install the same version of the package installed with "yum install pybind11-devel" I managed to solve my issue. However I also needed the fix to the calls to __init__() of the *ProviderService classes that is in your fork.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide