Skip to content

C API test failures with DPCPP 2021.4 #607

Closed

Description

@diptorupd

I am trying to build dpctl with code coverage turned on using python setup.py develop --coverage=1 and that leads to a hang (at least on my system) when running the DPCTLQueueMemberFuncTests/TestDPCTLQueueMemberFunctions.CheckMemOpsNullPtr tests.

I see the following error message printed :

NULL pointer argument in memory copy operation. -30 (CL_INVALID_VALUE)

The error seems to be similar to what is happening with the coverage action in our CI.

Activity

  1. self-assigned this
    on Sep 29, 2021
  2. diptorupd commented on Sep 29, 2021

    @diptorupd
    ContributorAuthor

    The errant test that causes the hang (and my PC to almost melt) is this one:

    Test #1590: DPCTLQueueMemberFuncTests/TestDPCTLQueueMemberFunctions.CheckMemOpsNullPtr/(0x59355epointingto"level_zero:gpu",1,true)

  3. diptorupd commented on Sep 30, 2021

    @diptorupd
    ContributorAuthor

    @oleksandr-pavlyk The CheckMemOpsNullPtr test is not correct. It is triggering the hang. The issue is that p2 (source) is not initialized and that causes an exception inside memcpy.

    NULL pointer argument in memory copy operation. -30 (CL_INVALID_VALUE)

    The reason it is not caught is that the check ASSERT_FALSE(bool(ERef)); is not right. It should be ASSERT_TRUE(bool(ERef)); or better still ASSERT_FALSE(ERef != nullptr);.

    TEST_P(TestDPCTLQueueMemberFunctions, CheckMemOpsNullPtr)
    {
        void *p1 = nullptr;
        void *p2 = nullptr;
        size_t n_bytes = 256;
        DPCTLSyclEventRef ERef = nullptr;
        ASSERT_NO_FATAL_FAILURE(ERef = DPCTLQueue_Memcpy(QRef, p1, p2, n_bytes));
        ASSERT_FALSE(bool(ERef));
        ASSERT_NO_FATAL_FAILURE(ERef = DPCTLQueue_Prefetch(QRef, p1, n_bytes));
        if (ERef) {
            ASSERT_NO_FATAL_FAILURE(DPCTLEvent_Wait(ERef));
            ASSERT_NO_FATAL_FAILURE(DPCTLEvent_Delete(ERef));
            ERef = nullptr;
        }
    
        ASSERT_NO_FATAL_FAILURE(ERef = DPCTLQueue_MemAdvise(QRef, p1, n_bytes, 0));
        if (ERef) {
            ASSERT_NO_FATAL_FAILURE(DPCTLEvent_Wait(ERef));
            ASSERT_NO_FATAL_FAILURE(DPCTLEvent_Delete(ERef));
            ERef = nullptr;
        }
    }
    
  4. oleksandr-pavlyk commented on Sep 30, 2021

    @oleksandr-pavlyk
    Contributor

    I am expecting EREf to come back a nullptr.

    I thought DPCTLQueue_Memcpy checks the pointers, or wraps sycl::queue::memcpy in a try/catch clause.

  5. diptorupd commented on Oct 4, 2021

    @diptorupd
    ContributorAuthor

    fixed by #612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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