Repository: opencv
Issue: OpenCV 4.10.0 segfault when using OpenVINO 2024.0.0
Labels: bug,category: dnn

### System Information

OpenCV version 4.10.0, built from source
OpenVINO version: 2024.0.0, installed from apt
Ubuntu 22.04, running in Docker
Python version: 3.10

### Detailed description

I recently updated my project from Ubuntu 20.04, OpenCV 4.6.0 and OpenVINO 2022.2 where i had the OpenVINO backend working great with YOLOv7 models.

I have now updated the project to use Ubuntu 22.04, OpenCV 4.10.0 and OpenVINO 2024.0.0.
Since upgrading, the OpenVINO backend segfaults.
No code changes were made between the upgrades.

I dont quite understand the stacktrace, and rolling back versions does not work since you cannot install OpenVINO 2022.2 on Ubuntu 22.04.
Any idea what could be causing this crash?

This is the stacktrace i receive:
```
Core was generated by `viseron -u -m viseron'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f28f8a2d1a0 in ?? () from /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
[Current thread is 1 (Thread 0x7f2826ffd640 (LWP 656))]
(gdb) bt
#0  0x00007f28f8a2d1a0 in  () at /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
#1  0x00007f28f8a2d35f in __gcc_personality_v0 () at /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
#2  0x00007f2836e54fe9 in __libunwind_Unwind_Resume () at /usr/lib/x86_64-linux-gnu/libunwind.so.8
#3  0x00007f28f4ea5fce in  () at /usr/lib/openvino-2024.0.0/libopenvino_auto_plugin.so
#4  0x00007f28f4ebcced in  () at /usr/lib/openvino-2024.0.0/libopenvino_auto_plugin.so
#5  0x00007f288ca0d06c in  () at /lib/libopenvino.so.2400
#6  0x00007f288c9e603c in  () at /lib/libopenvino.so.2400
#7  0x00007f288c9ecca8 in  () at /lib/libopenvino.so.2400
#8  0x00007f288c9c7b66 in ov::Core::get_available_devices[abi:cxx11]() const () at /lib/libopenvino.so.2400
#9  0x00007f289298e452 in cv::dnn::getCore(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () at /usr/local/lib/libopencv_dnn.so.410
#10 0x00007f28925cbce6 in cv::dnn::InfEngineNgraphNet::initPlugin(std::shared_ptr<ov::Model>&) () at /usr/local/lib/libopencv_dnn.so.410
#11 0x00007f28925cd769 in cv::dnn::InfEngineNgraphNet::init(cv::dnn::dnn4_v20240521::Target) () at /usr/local/lib/libopencv_dnn.so.410
#12 0x00007f28925ce211 in cv::dnn::InfEngineNgraphNet::createNet(cv::dnn::dnn4_v20240521::Target) () at /usr/local/lib/libopencv_dnn.so.410
#13 0x00007f2892913425 in cv::dnn::dnn4_v20240521::NetImplOpenVINO::initBackend(std::vector<cv::dnn::dnn4_v20240521::detail::LayerPin, std::allocator<cv::dnn::dnn4_v20240521::detail::LayerPin> > const&) () at /usr/local/lib/libopencv_dnn.so.410
#14 0x00007f28928f8046 in cv::dnn::dnn4_v20240521::Net::Impl::setUpNet(std::vector<cv::dnn::dnn4_v20240521::detail::LayerPin, std::allocator<cv::dnn::dnn4_v20240521::detail::LayerPin> > const&) ()
    at /usr/local/lib/libopencv_dnn.so.410
#15 0x00007f28928f9526 in cv::dnn::dnn4_v20240521::Net::Impl::forward(cv::_OutputArray const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) () at /usr/local/lib/libopencv_dnn.so.410
#16 0x00007f28928d969d in cv::dnn::dnn4_v20240521::Net::forward(cv::_OutputArray const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) () at /usr/local/lib/libopencv_dnn.so.410
#17 0x00007f28928cb8b2 in cv::dnn::dnn4_v20240521::Model::Impl::processFrame(cv::_InputArray const&, cv::_OutputArray const&) () at /usr/local/lib/libopencv_dnn.so.410
#18 0x00007f28928d26af in cv::dnn::dnn4_v20240521::DetectionModel::detect(cv::_InputArray const&, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&, float, float) () at /usr/local/lib/libopencv_dnn.so.410
#19 0x00007f28ed3c3c39 in pyopencv_cv_dnn_dnn_DetectionModel_detect(_object*, _object*, _object*) () at /usr/local/lib/python3.10/dist-packages/cv2/python-3.10/cv2.cpython-310-x86_64-linux-gnu.so
#20 0x0000562c7d3a68b7 in  ()
#21 0x0000562c7d38e45c in _PyEval_EvalFrameDefault ()
#22 0x0000562c7d3a59fc in _PyFunction_Vectorcall ()
#23 0x0000562c7d38e45c in _PyEval_EvalFrameDefault ()
#24 0x0000562c7d3a59fc in _PyFunction_Vectorcall ()
#25 0x0000562c7d38e45c in _PyEval_EvalFrameDefault ()
#26 0x0000562c7d3b3a51 in  ()
#27 0x0000562c7d3905d7 in _PyEval_EvalFrameDefault ()
--Type <RET> for more, q to quit, c to continue without paging--c
#28 0x0000562c7d3a59fc in _PyFunction_Vectorcall ()
#29 0x0000562c7d38e45c in _PyEval_EvalFrameDefault ()
#30 0x0000562c7d3a59fc in _PyFunction_Vectorcall ()
#31 0x0000562c7d38e45c in _PyEval_EvalFrameDefault ()
#32 0x0000562c7d3b3a51 in  ()
#33 0x0000562c7d4dcf3a in  ()
#34 0x0000562c7d4d1ef8 in  ()
#35 0x00007f28fa13aac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#36 0x00007f28fa1cc850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
```

### Steps to reproduce

Reproduction can be done by simply running the Docker container for my project, https://github.com/roflcoopter/viseron
It is designed to run on your local RTSP cameras so might be hard to reproduce for someone without any cameras.

Model used in tests is the official YOLOv7 models: https://github.com/WongKinYiu/yolov7/releases

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [ ] There is reproducer code and related data files (videos, images, onnx, etc)