Skip to content

SegFault on cv::dnn::Net::dumpToFile call #15016

@ghost

Description

System information (version)
  • OpenCV => 4.1.0
  • Operating System / Platform => Linux raspberrypi 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux
  • Compiler => g++ (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516
Detailed description

Calling cv::dnn::Net::dumpToFile on a loaded Darknet network gives SegFault.

Steps to reproduce
#include <opencv2/opencv.hpp>
#include <iostream>

using namespace cv;
using namespace dnn;
using namespace std;

int main(int argc, char* argv[])
{
    String configPath = "network.cfg";
    String modelPath = "network.weights";
    Net net = readNetFromDarknet(configPath, modelPath);
    cout << "Successfully loaded net, dumping to net.dot" << endl;
    net.dumpToFile("net.dot"); // SegFault
    return 0;
}
Edit : stack trace
$ gdb ./test_issue
GNU gdb (Raspbian 7.12-6) 7.12.0.20161007-git
...
(gdb) r
Starting program: /home/pi/Documents/yolo_objdetect/build/test_issue 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Successfully loaded net, dumping to net.dot

Program received signal SIGSEGV, Segmentation fault.
0x75ee1a9c in cv::dnn::dnn4_v20190430::Net::dump[abi:cxx11]() () from /usr/local/lib/libopencv_dnn.so.4.1
(gdb) bt
#0  0x75ee1a9c in cv::dnn::dnn4_v20190430::Net::dump[abi:cxx11]() () from /usr/local/lib/libopencv_dnn.so.4.1
#1  0x75ee313c in cv::dnn::dnn4_v20190430::Net::dumpToFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/local/lib/libopencv_dnn.so.4.1
#2  0x000117c8 in main (argc=1, argv=0x7efff034) at /home/pi/Documents/yolo_objdetect/src/test.cpp:14
(gdb) 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions