Skip to content
This repository was archived by the owner on Sep 21, 2020. It is now read-only.

Segfault when using CvSource #78

@DrWateryCat

Description

@DrWateryCat

I am trying to use cscore to stream a kinect's RGB and depth data over a MJPEG connection, but when I call PutFrame, I get a segfault. Here's a gist of the C++ code I'm using: https://gist.github.com/DrWateryCat/c225e436d5761bbb21fd622c78e78972 and here's the stacktrace by valgrind:

==25030== Use of uninitialised value of size 8
==25030==    at 0x5AA09F5: cv::Mat::copyTo(cv::_OutputArray const&) const (in /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4.9)
==25030==    by 0x5EFAF60: cs::CvSourceImpl::PutFrame(cv::Mat&) (in /usr/local/lib/libcscore.so)
==25030==    by 0x5EFC460: cs::PutSourceFrame(int, cv::Mat&, int*) (in /usr/local/lib/libcscore.so)
==25030==    by 0x40685E: cs::CvSource::PutFrame(cv::Mat&) (cscore_oo.inl:343)
==25030==    by 0x404393: main (libfreenect_opencvtest.cpp:328)
==25030== 
==25030== Invalid read of size 8
==25030==    at 0x5AA09F5: cv::Mat::copyTo(cv::_OutputArray const&) const (in /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4.9)
==25030==    by 0x5EFAF60: cs::CvSourceImpl::PutFrame(cv::Mat&) (in /usr/local/lib/libcscore.so)
==25030==    by 0x5EFC460: cs::PutSourceFrame(int, cv::Mat&, int*) (in /usr/local/lib/libcscore.so)
==25030==    by 0x40685E: cs::CvSource::PutFrame(cv::Mat&) (cscore_oo.inl:343)
==25030==    by 0x404393: main (libfreenect_opencvtest.cpp:328)
==25030==  Address 0xfc2010040 is not stack'd, malloc'd or (recently) free'd
==25030== 
==25030== 
==25030== Process terminating with default action of signal 11 (SIGSEGV)
==25030==  Access not within mapped region at address 0xFC2010040
==25030==    at 0x5AA09F5: cv::Mat::copyTo(cv::_OutputArray const&) const (in /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4.9)
==25030==    by 0x5EFAF60: cs::CvSourceImpl::PutFrame(cv::Mat&) (in /usr/local/lib/libcscore.so)
==25030==    by 0x5EFC460: cs::PutSourceFrame(int, cv::Mat&, int*) (in /usr/local/lib/libcscore.so)
==25030==    by 0x40685E: cs::CvSource::PutFrame(cv::Mat&) (cscore_oo.inl:343)
==25030==    by 0x404393: main (libfreenect_opencvtest.cpp:328)
==25030==  If you believe this happened as a result of a stack
==25030==  overflow in your program's main thread (unlikely but
==25030==  possible), you can try to increase the size of the
==25030==  main thread stack using the --main-stacksize= flag.
==25030==  The main thread stack size used in this run was 8388608.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions