Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6404 Discussions

Crashes after loading model multiple times

svutran
New Contributor I
555 Views

Hi,

 

I have a strange behavior when I try to load a model several times (refer to the code snippet below). We obtain

malloc(): invalid size (unsorted)
malloc(): invalid size (unsorted)
malloc(): invalid size (unsorted)
Aborted (core dumped)

 

I am aware that it is not a normal use case but we are required to run several model loading process during our code testing. The code shown below is just to show you that when loading a model multiple times in the same program, it crashes.

 

Also, it only does it when using "MULTI:GPU,CPU". GPU only and CPU only works fine.

 

Code snippet:

#include "openvino/openvino.hpp"
#include <chrono>
#include <iostream>
#include <thread>
int main(int argc, char* argv[])
{      
    for (size_t i = 0; i < 4; i++)
    {
    ov::Core core;       
        std::shared_ptr<ov::Model> model = core.read_model("/home/svutran/build_samples/install/samples_bin/public/googlenet-v1/FP16/googlenet-v1.xml");
        ov::CompiledModel compiled_model = core.compile_model(model, "MULTI:GPU,CPU");
        model = {};
        compiled_model = {};
    }    

    return 0;
}
0 Kudos
2 Replies
svutran
New Contributor I
542 Views

Also, the same code on an other similar system (same OpenVINO version and same Ubuntu version), the code runs fine.

0 Kudos
Hairul_Intel
Moderator
514 Views

Hi svutran,

We notice that you’ve posted the same issue in our GitHub thread. As such, we will proceed to close this thread. Further discussions regarding this issue can be done in the following GitHub thread:

https://github.com/openvinotoolkit/openvino/issues/12484

 

 

Regards,

Hairul


0 Kudos
Reply