Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chassis: Fix ReleaseValidationObject() #9470

Closed

Conversation

jeremyg-lunarg
Copy link
Contributor

@jeremyg-lunarg jeremyg-lunarg commented Feb 18, 2025

GPU-AV can detect problems and remove itself from object_dispatch and intercept_vectors. Make these lists rather than vectors so that removal doesn't invalidate iterators. Removal can happen during the FinishDeviceSetup() loop or possibly any other vulkan call. GPU-AV is not the last entry in these lists and calls still need to happen for anything after it (currently only syncval), so playing games with vector indexing will not work.

Fixes #9412

@jeremyg-lunarg jeremyg-lunarg requested a review from a team as a code owner February 18, 2025 16:51
@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 374349.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 19097 running.

GPU-AV can detect problems and remove itself from object_dispatch
and intercept_vectors. Make these lists rather than vectors so
that removal doesn't invalidate iterators. Removal can happen during
the FinishDeviceSetup() loop or possibly any other vulkan call.
GPU-AV is not the last entry in these lists and calls still need to
happen for anything after it (currently only syncval), so playing
games with vector indexing will not work.

Fixes KhronosGroup#9412
@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 374399.

Copy link
Contributor

@artem-lunarg artem-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -232,7 +233,7 @@ class Instance : public HandleWrapper {
APIVersion api_version;
DeviceExtensions extensions{};

mutable std::vector<std::unique_ptr<base::Instance>> object_dispatch;
mutable std::list<std::unique_ptr<base::Instance>> object_dispatch;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::list is a rare guest, maybe a comment why we use it.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 19098 running.

Copy link
Contributor

@arno-lunarg arno-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can still repro the crash : /
image

@arno-lunarg
Copy link
Contributor

arno-lunarg commented Feb 18, 2025

I think the fix from my PR now updated to manage the issues Artem should work, but the for loop update needs to be propagated to every functions -_-
So going:

    auto& object_dispatches = vvl::dispatch::GetData(*pDevice)->object_dispatch;
    for (int32_t i = 0; i < object_dispatches.size(); ++i) {
        auto& vo = object_dispatches[i];
        vo->FinishDeviceSetup(modified_create_info.ptr(), record_obj.location);
        if (!object_dispatches[i]) {
            --i;
        }
    }

But that assumes that GPU-AV unique pointers only gets nulled, not actually removed. So maybe we need to go:

    auto& object_dispatches = vvl::dispatch::GetData(*pDevice)->object_dispatch;
    for (int32_t i = 0; i < object_dispatches.size(); ++i) {
        auto& vo = object_dispatches[i];
        const size_t tmp_size = object_dispatches.size();
        vo->FinishDeviceSetup(modified_create_info.ptr(), record_obj.location);
        if ( tmp_size != object_dispatches.size()) {
            --i;
        }
    }

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 19098 failed.

@jeremyg-lunarg
Copy link
Contributor Author

yes this approach won't work either. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CTS test crashes when both sync and gpuav are enabled
4 participants