After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778020 - opencv: Don't store C++ types directly in C structs
opencv: Don't store C++ types directly in C structs
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal major
: 1.12.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-01 11:46 UTC by Sebastian Dröge (slomo)
Modified: 2017-05-20 14:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2017-02-01 11:46:44 UTC
See 

commit 718c4140fac99c2fa7cdb25860566d2d9fa0eec3
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Feb 1 13:44:37 2017 +0200

    dewarp: Store C++ types as pointers in C structs
    
    Otherwise the destructor will never be called, and we would have to call
    the constructors manually at some point... which we never did, so
    calling release() on it before it got otherwise initialized caused a
    crash. For example when running gst-inspect-1.0.
Comment 1 Luis de Bethencourt 2017-02-01 12:06:36 UTC
Do we have the same issue in the other OpenCV plugins?

Just asking in case you know. If you don't, I can investigate.
Comment 2 Sebastian Dröge (slomo) 2017-02-01 12:21:14 UTC
I don't know, the others are not crashing like that but someone will have to check all struct definitions to ensure there's only pointers to C++ types there.
Comment 3 Luis de Bethencourt 2017-02-01 12:30:52 UTC
I should look into it and be sure.
Comment 4 Tim-Philipp Müller 2017-05-04 17:52:52 UTC
These look suspicious:

MotionCells.h:  vector < MotionCellsIdx > m_MotionCells;
MotionCells.h:  vector < OverlayRegions > m_OverlayRegions;
MotionCells.h:  MotionCellHeader m_header;

These might be ok:

gstdisparity.h:  cv::Ptr<cv::StereoBM> sbm;
gstdisparity.h:  cv::Ptr<cv::StereoSGBM> sgbm;

gstsegmentation.h:  cv::Ptr<cv::BackgroundSubtractor> mog;
gstsegmentation.h:  cv::Ptr<cv::BackgroundSubtractorMOG2> mog2;

?
Comment 5 Tim-Philipp Müller 2017-05-20 14:24:49 UTC
The stuff in MotionCells.h is in a C++ class struct, so ok. Rest has explicit delete/release calls, so fine as well.

I think this can be closed then.