oneapi-src / oneapi-src/level-zero-tests

Data race in level_zero_tests::get_default_context()

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
64
Forks
69
PR merge metrics
No merged PRs in 30d

Description

Dear colleagues,

There is a data race between ze_context_handle_t::context checking and its initialization in level_zero_tests::get_default_context(). The context may be unsuccessfully checked in the condition by several threads and then assigned simultaneously as well. Multithread initialization is expected in for example, zeImmediateCommandListMultiTthreadTest::GivenMultipleThreadsWhenCreateCloseAndDestroyImmediateCommandListsThenReturnSuccess.

Same issue affects the code below.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in utils/utils/src/utils.cpp at the condition around line 23 and assignment around line 29 in level_zero_tests::get_default_context(). Run zeImmediateCommandListMultiTthreadTest::GivenMultipleThreadsWhenCreateCloseAndDestroyImmediateCommandListsThenReturnSuccess and use a race detector to examine the initialization path. Done means the concurrent test no longer reports a data race.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.