Mat/UMat may be out of sync. (Bug #4380)


Added by Pavel Vlasov almost 10 years ago. Updated over 9 years ago.


Status:New Start date:2015-06-04
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Affected version:branch 'master' (3.0-dev) Operating System:Windows
Difficulty: HW Platform:x64
Pull request:

Description

I created this test as a reproducer:

TEST(UMat, SyncTemp)
{
    Mat m(10, 10, CV_8UC1);

    {
        UMat um = m.getUMat(ACCESS_WRITE);

        {
            Mat m2 = um.getMat(ACCESS_WRITE);
            m2.setTo(cv::Scalar::all(17));
        }

        um.setTo(cv::Scalar::all(19));

        EXPECT_EQ(0, cvtest::norm(um.getMat(ACCESS_READ), cv::Mat(um.size(), um.type(), 19), NORM_INF));
    }
}

This will create the following exception:

error: (-215) u->refcount == 0 in function cv::UMat::handle


Related issues

related to Bug #4468: Data race may happen between oclCleanupCallback and Mat::... New 2015-07-07
related to Bug #4006: getUMat does not work properly with Mat on user data Open 2014-11-13

History

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/5010

Also available in: Atom PDF