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

Spatial anchor read access violation #171

Open
Reda-S opened this issue Jun 7, 2018 · 2 comments
Open

Spatial anchor read access violation #171

Reda-S opened this issue Jun 7, 2018 · 2 comments

Comments

@Reda-S
Copy link

Reda-S commented Jun 7, 2018

Hi Cristi,

Can you try to replicate this issue from your side: just run the example spatial-anchor.js and it will throw a read access violation on holographic.anchors.enumerateAnchors
Now here is the kicker, it only throws this access violation issue on release mode (no issues on debug).

VS V15.7.3
I tried it on a HoloLens with Windows V 17134.1011 & Windows V 17686.1003

Thanks

@Almost-Done
Copy link
Member

In Release mode, this line throws the exception:
SpatialAnchorStore^ anchorStore = await SpatialAnchorManager::RequestStoreAsync();`

Replacing that line with
create_task(SpatialAnchorManager::RequestStoreAsync())
.then([](task<SpatialAnchorStore^> previousTask)

and changing the logic of the function to execute on completion of the task makes it work, but I'd like to understand the root cause. "await" is used extensively in the project and this might be a sign of bigger issues.

@Almost-Done
Copy link
Member

This section of code has been rewritten. Try this snippet of script and let me know if it still throws exceptions.

var anchorStore;
if (SpatialAnchorStore.isAvailable()) {
    anchorStore = new SpatialAnchorStore();
    anchorStore.oninitialized = function () {
    }

    anchorStore.onerror= function () {
    }

    anchorStore.initialize();
}

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

No branches or pull requests

2 participants