StereoKit / StereoKit

An easy-to-use XR engine for building AR and VR applications with C# and OpenXR!
https://stereokit.net/Pages/Guides/Getting-Started.html
MIT License
943 stars 115 forks source link

Access violation since 1570 #658

Closed paulmelis closed 1 year ago

paulmelis commented 1 year ago

Description

When switching to 0.3.7-preview.1570 from 0.3.7-preview.9 I now get an access violation exception in an otherwise unmodified application. This is on Windows, with a Varjo XR-3.

Platform / Environment

Windows, MSVC 17.4.4

Logs or exception details

Call stack with native debugging enabled:

    VarjoOpenXR.dll!00007ff95c29546c()  Unknown
    VarjoOpenXR.dll!00007ff95c2b9cef()  Unknown
    VarjoOpenXR.dll!00007ff95c2ba519()  Unknown
    StereoKitC.dll!xrLocateViews(XrSession_T * session, const XrViewLocateInfo * viewLocateInfo, XrViewState * viewState, unsigned int viewCapacityInput, unsigned int * viewCountOutput, XrView * views) Line 464  C++
    StereoKitC.dll!sk::openxr_views_update_fov() Line 888   C++
    StereoKitC.dll!sk::openxr_poll_events() Line 844    C++
    StereoKitC.dll!sk::openxr_init() Line 511   C++
    StereoKitC.dll!sk::platform_set_mode(sk::display_type_ mode) Line 164   C++
    StereoKitC.dll!sk::platform_init() Line 74  C++
    StereoKitC.dll!sk::systems_initialize() Line 138    C++
    StereoKitC.dll!sk_init(sk::sk_settings_t settings) Line 322 C++
    [Managed to Native Transition]  
    StereoKit.dll!StereoKit.SK.InitializeCall(StereoKit.SKSettings settings) Line 149   C#
    StereoKit.dll!StereoKit.SK.Initialize(StereoKit.SKSettings settings) Line 92    C#
>   ModelViewer.dll!ModelViewer.Application.Main(string[] args) Line 1173   C#
    [Native to Managed Transition]  
    hostpolicy.dll!00007ff9b5e64c5d()   Unknown
    hostpolicy.dll!00007ff9b5e72e10()   Unknown
    hostpolicy.dll!00007ff9b5e7288c()   Unknown
    hostpolicy.dll!00007ff9b5e74b85()   Unknown
    hostfxr.dll!00007ff9b5edb7e0()  Unknown
    hostfxr.dll!00007ff9b5ede41a()  Unknown
    hostfxr.dll!00007ff9b5ee06e6()  Unknown
    hostfxr.dll!00007ff9b5edea84()  Unknown
    hostfxr.dll!00007ff9b5ed85a3()  Unknown
    ModelViewer.exe!00007ff638962d47()  Unknown
    ModelViewer.exe!00007ff6389632c8()  Unknown
    ModelViewer.exe!00007ff638964978()  Unknown
    kernel32.dll!00007ff9ce457614() Unknown
    ntdll.dll!00007ff9cf3426f1()    Unknown

Relevant init code, nothing special:

       static void Main(string[] args)
        {
            // To get , as thousand separator
            CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");

            // Initialize StereoKit
            SKSettings settings = new SKSettings
            {
                appName = "ModelViewer",
                assetsFolder = "Assets",
                //displayPreference = DisplayMode.Flatscreen,        // If enabled, runs simulator
                //blendPreference = DisplayBlend.Opaque,            // If enabled, gives VR mode without pass-through
            };

Console log (seems to be something related to graphics pipeline setup):

[SK diagnostic] Initializing StereoKit v0.3.7-preview.1570 Win32 x64...
[SK diagnostic] Initializing Assets
[SK diagnostic] Initializing Platform
20230706 13:53:40.198 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Users\VR-1\Desktop\Projects\ModelViewer\bin\Release\netcoreapp3.1\VarjoRuntime.dll"...
20230706 13:53:40.198 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "\VarjoRuntime.dll"...
20230706 13:53:40.198 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll"...
20230706 13:53:40.200 --- [Varjo::RuntimeInterface::load] VarjoRuntime.dll loaded from C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll successfully.
20230706 13:53:40.200 --- [Varjo::CreateAndInitSession] clientSessionId: sdk#openxr#1000001379982533400, version: 3.10.1.14
20230706 13:53:40.201 --- [PipeSession::Run] Pipe1: Open
20230706 13:53:40.201 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.201 --- [PipeSession::Run] Pipe1: Disconnected
20230706 13:53:40.202 --- [Varjo::LayerClient::LayerClient] New LayerClient, unique client session id: 'sdk#openxr#1000001379982533400', sdk version='3.10.1.14'
20230706 13:53:40.209 --- [Varjo::HighPrecisionSleep::initialize::<lambda_edb3a67b8881b8eb44fc475bf02b5bd1>::operator ()] HPSleep resolution: 499900 ns
20230706 13:53:40.209 --- [PipeSession::Run] Pipe2: Open
20230706 13:53:40.209 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.210 --- [Varjo::LayerClient::waitHandshake] Wait for handshake
20230706 13:53:40.213 --- [Varjo::LayerClient::waitHandshake] HANDSHAKE OK
20230706 13:53:40.213 *** [Varjo::LayerClient::waitHandshake] result OK
20230706 13:53:40.216 --- [Varjo::State::PropertyClient::waitForConnection] Trying to connect to PropertyServer
20230706 13:53:40.216 --- [Varjo::State::PropertyClient::waitForConnection] Connected to PropertyServer
20230706 13:53:40.216 --- [Varjo::State::PropertyClient::onClientRoleRequest] Identifying as client role 'RUNTIME'
20230706 13:53:40.218 --- [Varjo::State::PropertyClient::processOnPropertyDefinitions] Received definitions for 301 properties
20230706 13:53:40.218 --- [Varjo::State::PropertyClient::tryInitialization] Connection to Property Server established and property definitions initialized
20230706 13:53:40.219 --- [Varjo::Session::createCompositorLink] Create compositor link for sdk#openxr#1000001379982533400
20230706 13:53:40.219 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait...
20230706 13:53:40.221 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait... OK.
20230706 13:53:40.221 --- [Varjo::ProcessorUtil::useOnlyPerformanceCpuCoresForCurrentProcess] Setting Process Affinity mask 0xffff
20230706 13:53:40.222 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.222 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.223 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' connection thread woke up
20230706 13:53:40.223 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager' connection thread woke up
20230706 13:53:40.224 WAR [Varjo::State::PropertyClient::stop] Cancelling PropertyClient initialization
20230706 13:53:40.224 WAR [Varjo::State::PropertyClient::onConnectionLost] Connection lost to Property Server
20230706 13:53:40.225 --- [PipeSession::Run] Pipe2: Disconnected
20230706 13:53:40.226 --- [Varjo::RuntimeInterface::unload] No more active sessions, VarjoRuntime unloaded.
20230706 13:53:40.226 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Users\VR-1\Desktop\Projects\ModelViewer\bin\Release\netcoreapp3.1\VarjoRuntime.dll"...
20230706 13:53:40.227 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "\VarjoRuntime.dll"...
20230706 13:53:40.227 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll"...
20230706 13:53:40.230 --- [Varjo::RuntimeInterface::load] VarjoRuntime.dll loaded from C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll successfully.
20230706 13:53:40.232 --- [Varjo::CreateAndInitSession] clientSessionId: sdk#openxr#1000001380014127400, version: 3.10.1.14
20230706 13:53:40.233 --- [PipeSession::Run] Pipe1: Open
20230706 13:53:40.233 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.234 --- [PipeSession::Run] Pipe1: Disconnected
20230706 13:53:40.235 --- [Varjo::LayerClient::LayerClient] New LayerClient, unique client session id: 'sdk#openxr#1000001380014127400', sdk version='3.10.1.14'
20230706 13:53:40.237 --- [Varjo::HighPrecisionSleep::initialize::<lambda_edb3a67b8881b8eb44fc475bf02b5bd1>::operator ()] HPSleep resolution: 499900 ns
20230706 13:53:40.238 --- [PipeSession::Run] Pipe2: Open
20230706 13:53:40.238 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.239 --- [Varjo::LayerClient::waitHandshake] Wait for handshake
20230706 13:53:40.240 --- [Varjo::LayerClient::waitHandshake] HANDSHAKE OK
20230706 13:53:40.241 *** [Varjo::LayerClient::waitHandshake] result OK
20230706 13:53:40.244 --- [Varjo::State::PropertyClient::waitForConnection] Trying to connect to PropertyServer
20230706 13:53:40.244 --- [Varjo::State::PropertyClient::onClientRoleRequest] Identifying as client role 'RUNTIME'
20230706 13:53:40.244 --- [Varjo::State::PropertyClient::waitForConnection] Connected to PropertyServer
20230706 13:53:40.245 --- [Varjo::State::PropertyClient::processOnPropertyDefinitions] Received definitions for 301 properties
20230706 13:53:40.247 --- [Varjo::State::PropertyClient::tryInitialization] Connection to Property Server established and property definitions initialized
20230706 13:53:40.248 --- [Varjo::Session::createCompositorLink] Create compositor link for sdk#openxr#1000001380014127400
20230706 13:53:40.248 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait...
20230706 13:53:40.249 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait... OK.
20230706 13:53:40.249 --- [Varjo::ProcessorUtil::useOnlyPerformanceCpuCoresForCurrentProcess] Setting Process Affinity mask 0xffff
20230706 13:53:40.251 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.251 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.252 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' connection thread woke up
20230706 13:53:40.252 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager' connection thread woke up
20230706 13:53:40.253 WAR [Varjo::State::PropertyClient::stop] Cancelling PropertyClient initialization
20230706 13:53:40.253 WAR [Varjo::State::PropertyClient::onConnectionLost] Connection lost to Property Server
20230706 13:53:40.254 --- [PipeSession::Run] Pipe2: Disconnected
20230706 13:53:40.255 --- [Varjo::RuntimeInterface::unload] No more active sessions, VarjoRuntime unloaded.
20230706 13:53:40.255 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Users\VR-1\Desktop\Projects\ModelViewer\bin\Release\netcoreapp3.1\VarjoRuntime.dll"...
20230706 13:53:40.256 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "\VarjoRuntime.dll"...
20230706 13:53:40.256 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll"...
20230706 13:53:40.258 --- [Varjo::RuntimeInterface::load] VarjoRuntime.dll loaded from C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll successfully.
20230706 13:53:40.258 --- [Varjo::CreateAndInitSession] clientSessionId: sdk#openxr#1000001380040098600, version: 3.10.1.14
20230706 13:53:40.258 --- [PipeSession::Run] Pipe1: Open
20230706 13:53:40.259 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.260 --- [PipeSession::Run] Pipe1: Disconnected
20230706 13:53:40.260 --- [Varjo::LayerClient::LayerClient] New LayerClient, unique client session id: 'sdk#openxr#1000001380040098600', sdk version='3.10.1.14'
20230706 13:53:40.263 --- [Varjo::HighPrecisionSleep::initialize::<lambda_edb3a67b8881b8eb44fc475bf02b5bd1>::operator ()] HPSleep resolution: 499900 ns
20230706 13:53:40.263 --- [PipeSession::Run] Pipe2: Open
20230706 13:53:40.264 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.265 --- [Varjo::LayerClient::waitHandshake] Wait for handshake
20230706 13:53:40.265 --- [Varjo::LayerClient::waitHandshake] HANDSHAKE OK
20230706 13:53:40.266 *** [Varjo::LayerClient::waitHandshake] result OK
20230706 13:53:40.268 --- [Varjo::State::PropertyClient::waitForConnection] Trying to connect to PropertyServer
20230706 13:53:40.269 --- [Varjo::State::PropertyClient::waitForConnection] Connected to PropertyServer
20230706 13:53:40.269 --- [Varjo::State::PropertyClient::onClientRoleRequest] Identifying as client role 'RUNTIME'
20230706 13:53:40.271 --- [Varjo::State::PropertyClient::processOnPropertyDefinitions] Received definitions for 301 properties
20230706 13:53:40.272 --- [Varjo::State::PropertyClient::tryInitialization] Connection to Property Server established and property definitions initialized
20230706 13:53:40.272 --- [Varjo::Session::createCompositorLink] Create compositor link for sdk#openxr#1000001380040098600
20230706 13:53:40.273 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait...
20230706 13:53:40.274 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait... OK.
20230706 13:53:40.274 --- [Varjo::ProcessorUtil::useOnlyPerformanceCpuCoresForCurrentProcess] Setting Process Affinity mask 0xffff
20230706 13:53:40.275 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.275 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.275 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' connection thread woke up
20230706 13:53:40.279 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager' connection thread woke up
20230706 13:53:40.280 WAR [Varjo::State::PropertyClient::stop] Cancelling PropertyClient initialization
20230706 13:53:40.280 WAR [Varjo::State::PropertyClient::onConnectionLost] Connection lost to Property Server
20230706 13:53:40.281 --- [PipeSession::Run] Pipe2: Disconnected
20230706 13:53:40.282 --- [Varjo::RuntimeInterface::unload] No more active sessions, VarjoRuntime unloaded.
20230706 13:53:40.282 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Users\VR-1\Desktop\Projects\ModelViewer\bin\Release\netcoreapp3.1\VarjoRuntime.dll"...
20230706 13:53:40.283 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "\VarjoRuntime.dll"...
20230706 13:53:40.283 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll"...
20230706 13:53:40.285 --- [Varjo::RuntimeInterface::load] VarjoRuntime.dll loaded from C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll successfully.
20230706 13:53:40.285 --- [Varjo::CreateAndInitSession] clientSessionId: sdk#openxr#1000001380067304800, version: 3.10.1.14
20230706 13:53:40.286 --- [PipeSession::Run] Pipe1: Open
20230706 13:53:40.286 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.287 --- [PipeSession::Run] Pipe1: Disconnected
20230706 13:53:40.287 --- [Varjo::LayerClient::LayerClient] New LayerClient, unique client session id: 'sdk#openxr#1000001380067304800', sdk version='3.10.1.14'
20230706 13:53:40.288 --- [Varjo::HighPrecisionSleep::initialize::<lambda_edb3a67b8881b8eb44fc475bf02b5bd1>::operator ()] HPSleep resolution: 499900 ns
20230706 13:53:40.288 --- [PipeSession::Run] Pipe2: Open
20230706 13:53:40.288 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.289 --- [Varjo::LayerClient::waitHandshake] Wait for handshake
20230706 13:53:40.290 --- [Varjo::LayerClient::waitHandshake] HANDSHAKE OK
20230706 13:53:40.291 *** [Varjo::LayerClient::waitHandshake] result OK
20230706 13:53:40.293 --- [Varjo::State::PropertyClient::waitForConnection] Trying to connect to PropertyServer
20230706 13:53:40.294 --- [Varjo::State::PropertyClient::waitForConnection] Connected to PropertyServer
20230706 13:53:40.294 --- [Varjo::State::PropertyClient::onClientRoleRequest] Identifying as client role 'RUNTIME'
20230706 13:53:40.296 --- [Varjo::State::PropertyClient::processOnPropertyDefinitions] Received definitions for 301 properties
20230706 13:53:40.297 --- [Varjo::State::PropertyClient::tryInitialization] Connection to Property Server established and property definitions initialized
20230706 13:53:40.298 --- [Varjo::Session::createCompositorLink] Create compositor link for sdk#openxr#1000001380067304800
20230706 13:53:40.298 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait...
20230706 13:53:40.301 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait... OK.
20230706 13:53:40.302 --- [Varjo::ProcessorUtil::useOnlyPerformanceCpuCoresForCurrentProcess] Setting Process Affinity mask 0xffff
20230706 13:53:40.303 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.303 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.304 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' connection thread woke up
20230706 13:53:40.305 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager' connection thread woke up
20230706 13:53:40.305 WAR [Varjo::State::PropertyClient::stop] Cancelling PropertyClient initialization
20230706 13:53:40.306 WAR [Varjo::State::PropertyClient::onConnectionLost] Connection lost to Property Server
20230706 13:53:40.307 --- [PipeSession::Run] Pipe2: Disconnected
20230706 13:53:40.309 --- [Varjo::RuntimeInterface::unload] No more active sessions, VarjoRuntime unloaded.
20230706 13:53:40.310 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Users\VR-1\Desktop\Projects\ModelViewer\bin\Release\netcoreapp3.1\VarjoRuntime.dll"...
20230706 13:53:40.310 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "\VarjoRuntime.dll"...
20230706 13:53:40.311 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll"...
20230706 13:53:40.313 --- [Varjo::RuntimeInterface::load] VarjoRuntime.dll loaded from C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll successfully.
20230706 13:53:40.313 --- [Varjo::CreateAndInitSession] clientSessionId: sdk#openxr#1000001380095093500, version: 3.10.1.14
20230706 13:53:40.313 --- [PipeSession::Run] Pipe1: Open
20230706 13:53:40.314 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.314 --- [PipeSession::Run] Pipe1: Disconnected
20230706 13:53:40.315 --- [Varjo::LayerClient::LayerClient] New LayerClient, unique client session id: 'sdk#openxr#1000001380095093500', sdk version='3.10.1.14'
20230706 13:53:40.316 --- [Varjo::HighPrecisionSleep::initialize::<lambda_edb3a67b8881b8eb44fc475bf02b5bd1>::operator ()] HPSleep resolution: 499900 ns
20230706 13:53:40.316 --- [PipeSession::Run] Pipe2: Open
20230706 13:53:40.316 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.317 --- [Varjo::LayerClient::waitHandshake] Wait for handshake
20230706 13:53:40.318 --- [Varjo::LayerClient::waitHandshake] HANDSHAKE OK
20230706 13:53:40.318 *** [Varjo::LayerClient::waitHandshake] result OK
20230706 13:53:40.321 --- [Varjo::State::PropertyClient::waitForConnection] Trying to connect to PropertyServer
20230706 13:53:40.322 --- [Varjo::State::PropertyClient::onClientRoleRequest] Identifying as client role 'RUNTIME'
20230706 13:53:40.322 --- [Varjo::State::PropertyClient::waitForConnection] Connected to PropertyServer
20230706 13:53:40.325 --- [Varjo::State::PropertyClient::processOnPropertyDefinitions] Received definitions for 301 properties
20230706 13:53:40.326 --- [Varjo::State::PropertyClient::tryInitialization] Connection to Property Server established and property definitions initialized
20230706 13:53:40.327 --- [Varjo::Session::createCompositorLink] Create compositor link for sdk#openxr#1000001380095093500
20230706 13:53:40.327 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait...
20230706 13:53:40.329 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait... OK.
20230706 13:53:40.329 --- [Varjo::ProcessorUtil::useOnlyPerformanceCpuCoresForCurrentProcess] Setting Process Affinity mask 0xffff
20230706 13:53:40.331 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.331 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.332 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' connection thread woke up
20230706 13:53:40.332 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager' connection thread woke up
20230706 13:53:40.333 WAR [Varjo::State::PropertyClient::stop] Cancelling PropertyClient initialization
20230706 13:53:40.333 WAR [Varjo::State::PropertyClient::onConnectionLost] Connection lost to Property Server
20230706 13:53:40.334 --- [PipeSession::Run] Pipe2: Disconnected
20230706 13:53:40.335 --- [Varjo::RuntimeInterface::unload] No more active sessions, VarjoRuntime unloaded.
20230706 13:53:40.335 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Users\VR-1\Desktop\Projects\ModelViewer\bin\Release\netcoreapp3.1\VarjoRuntime.dll"...
20230706 13:53:40.335 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "\VarjoRuntime.dll"...
20230706 13:53:40.336 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll"...
20230706 13:53:40.338 --- [Varjo::RuntimeInterface::load] VarjoRuntime.dll loaded from C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll successfully.
20230706 13:53:40.340 --- [Varjo::CreateAndInitSession] clientSessionId: sdk#openxr#1000001380121668000, version: 3.10.1.14
20230706 13:53:40.340 --- [PipeSession::Run] Pipe1: Open
20230706 13:53:40.340 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.341 --- [PipeSession::Run] Pipe1: Disconnected
20230706 13:53:40.341 --- [Varjo::LayerClient::LayerClient] New LayerClient, unique client session id: 'sdk#openxr#1000001380121668000', sdk version='3.10.1.14'
20230706 13:53:40.342 --- [Varjo::HighPrecisionSleep::initialize::<lambda_edb3a67b8881b8eb44fc475bf02b5bd1>::operator ()] HPSleep resolution: 499900 ns
20230706 13:53:40.342 --- [PipeSession::Run] Pipe2: Open
20230706 13:53:40.343 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.344 --- [Varjo::LayerClient::waitHandshake] Wait for handshake
20230706 13:53:40.346 --- [Varjo::LayerClient::waitHandshake] HANDSHAKE OK
20230706 13:53:40.346 *** [Varjo::LayerClient::waitHandshake] result OK
20230706 13:53:40.349 --- [Varjo::State::PropertyClient::waitForConnection] Trying to connect to PropertyServer
20230706 13:53:40.350 --- [Varjo::State::PropertyClient::waitForConnection] Connected to PropertyServer
20230706 13:53:40.350 --- [Varjo::State::PropertyClient::onClientRoleRequest] Identifying as client role 'RUNTIME'
20230706 13:53:40.351 --- [Varjo::State::PropertyClient::processOnPropertyDefinitions] Received definitions for 301 properties
20230706 13:53:40.351 --- [Varjo::State::PropertyClient::tryInitialization] Connection to Property Server established and property definitions initialized
20230706 13:53:40.352 --- [Varjo::Session::createCompositorLink] Create compositor link for sdk#openxr#1000001380121668000
20230706 13:53:40.352 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait...
20230706 13:53:40.354 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait... OK.
20230706 13:53:40.355 --- [Varjo::ProcessorUtil::useOnlyPerformanceCpuCoresForCurrentProcess] Setting Process Affinity mask 0xffff
20230706 13:53:40.356 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.356 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.356 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' connection thread woke up
20230706 13:53:40.358 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager' connection thread woke up
20230706 13:53:40.358 WAR [Varjo::State::PropertyClient::stop] Cancelling PropertyClient initialization
20230706 13:53:40.358 WAR [Varjo::State::PropertyClient::onConnectionLost] Connection lost to Property Server
20230706 13:53:40.359 --- [PipeSession::Run] Pipe2: Disconnected
20230706 13:53:40.360 --- [Varjo::RuntimeInterface::unload] No more active sessions, VarjoRuntime unloaded.
[SK diagnostic] available: XR_KHR_D3D12_enable
[SK diagnostic] available: XR_KHR_opengl_enable
[SK diagnostic] available: XR_VARJO_composition_layer_depth_test
[SK diagnostic] available: XR_VARJO_environment_depth_estimation
[SK diagnostic] available: XR_EXT_debug_utils
[SK diagnostic] available: XR_EXT_win32_appcontainer_compatible
[SK diagnostic] available: XR_VARJO_quad_views
[SK diagnostic] available: XR_VARJO_foveated_rendering
[SK diagnostic] available: XR_KHR_visibility_mask
[SK diagnostic] available: XR_VARJO_marker_tracking
[SK diagnostic] available: XR_HTCX_vive_tracker_interaction
[SK diagnostic] available: XR_VARJO_view_offset
[SK diagnostic] available: XR_KHR_vulkan_enable
[SK diagnostic] available: XR_KHR_vulkan_enable2
[SK diagnostic] available: XR_KHR_swapchain_usage_input_attachment_bit
[SK diagnostic] REQUESTED: XR_KHR_D3D11_enable
[SK diagnostic] REQUESTED: XR_KHR_win32_convert_performance_counter_time
[SK diagnostic] REQUESTED: XR_KHR_composition_layer_depth
[SK diagnostic] REQUESTED: XR_EXT_eye_gaze_interaction
[SK diagnostic] REQUESTED: XR_EXT_hand_tracking
20230706 13:53:40.365 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Users\VR-1\Desktop\Projects\ModelViewer\bin\Release\netcoreapp3.1\VarjoRuntime.dll"...
20230706 13:53:40.365 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "\VarjoRuntime.dll"...
20230706 13:53:40.365 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll"...
20230706 13:53:40.367 --- [Varjo::RuntimeInterface::load] VarjoRuntime.dll loaded from C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll successfully.
20230706 13:53:40.367 --- [Varjo::CreateAndInitSession] clientSessionId: sdk#openxr#1000001380149475700, version: 3.10.1.14
20230706 13:53:40.368 --- [PipeSession::Run] Pipe1: Open
20230706 13:53:40.368 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.369 --- [PipeSession::Run] Pipe1: Disconnected
20230706 13:53:40.371 --- [Varjo::LayerClient::LayerClient] New LayerClient, unique client session id: 'sdk#openxr#1000001380149475700', sdk version='3.10.1.14'
20230706 13:53:40.371 --- [Varjo::HighPrecisionSleep::initialize::<lambda_edb3a67b8881b8eb44fc475bf02b5bd1>::operator ()] HPSleep resolution: 499900 ns
20230706 13:53:40.372 --- [PipeSession::Run] Pipe2: Open
20230706 13:53:40.372 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.373 --- [Varjo::LayerClient::waitHandshake] Wait for handshake
20230706 13:53:40.373 --- [Varjo::LayerClient::waitHandshake] HANDSHAKE OK
20230706 13:53:40.374 *** [Varjo::LayerClient::waitHandshake] result OK
20230706 13:53:40.377 --- [Varjo::State::PropertyClient::waitForConnection] Trying to connect to PropertyServer
20230706 13:53:40.377 --- [Varjo::State::PropertyClient::waitForConnection] Connected to PropertyServer
20230706 13:53:40.377 --- [Varjo::State::PropertyClient::onClientRoleRequest] Identifying as client role 'RUNTIME'
20230706 13:53:40.378 --- [Varjo::State::PropertyClient::processOnPropertyDefinitions] Received definitions for 301 properties
20230706 13:53:40.379 --- [Varjo::State::PropertyClient::tryInitialization] Connection to Property Server established and property definitions initialized
20230706 13:53:40.379 --- [Varjo::Session::createCompositorLink] Create compositor link for sdk#openxr#1000001380149475700
20230706 13:53:40.380 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait...
20230706 13:53:40.382 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait... OK.
20230706 13:53:40.382 --- [Varjo::ProcessorUtil::useOnlyPerformanceCpuCoresForCurrentProcess] Setting Process Affinity mask 0xffff
20230706 13:53:40.383 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.383 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.383 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' connection thread woke up
20230706 13:53:40.384 --- [Varjo::GazeClient::waitConnectionThreadWakeup] GazeClient 'VarjoSystem.FoveatedViewManager' connection thread woke up
20230706 13:53:40.384 WAR [Varjo::State::PropertyClient::stop] Cancelling PropertyClient initialization
20230706 13:53:40.387 WAR [Varjo::State::PropertyClient::onConnectionLost] Connection lost to Property Server
20230706 13:53:40.388 --- [PipeSession::Run] Pipe2: Disconnected
20230706 13:53:40.389 --- [Varjo::RuntimeInterface::unload] No more active sessions, VarjoRuntime unloaded.
20230706 13:53:40.389 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Users\VR-1\Desktop\Projects\ModelViewer\bin\Release\netcoreapp3.1\VarjoRuntime.dll"...
20230706 13:53:40.389 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "\VarjoRuntime.dll"...
20230706 13:53:40.390 --- [Varjo::RuntimeInterface::load] Trying to load VarjoRuntime from "C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll"...
20230706 13:53:40.392 --- [Varjo::RuntimeInterface::load] VarjoRuntime.dll loaded from C:\Program Files\Varjo\varjo-compositor\\VarjoRuntime.dll successfully.
20230706 13:53:40.392 --- [PipeSession::Run] Pipe1: Open
20230706 13:53:40.392 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.393 --- [PipeSession::Run] Pipe1: Disconnected
20230706 13:53:40.394 --- [PipeSession::Run] Pipe1: Open
20230706 13:53:40.394 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.394 --- [PipeSession::Run] Pipe1: Disconnected
20230706 13:53:40.394 --- [Varjo::CreateAndInitSession] clientSessionId: sdk#openxr#1000001380176498000, version: 3.10.1.14
20230706 13:53:40.395 --- [PipeSession::Run] Pipe2: Open
20230706 13:53:40.395 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.396 --- [PipeSession::Run] Pipe2: Disconnected
20230706 13:53:40.396 --- [Varjo::LayerClient::LayerClient] New LayerClient, unique client session id: 'sdk#openxr#1000001380176498000', sdk version='3.10.1.14'
20230706 13:53:40.396 --- [Varjo::HighPrecisionSleep::initialize::<lambda_edb3a67b8881b8eb44fc475bf02b5bd1>::operator ()] HPSleep resolution: 499900 ns
20230706 13:53:40.397 --- [PipeSession::Run] Pipe3: Open
20230706 13:53:40.397 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.398 --- [Varjo::LayerClient::waitHandshake] Wait for handshake
20230706 13:53:40.399 --- [Varjo::LayerClient::waitHandshake] HANDSHAKE OK
20230706 13:53:40.399 *** [Varjo::LayerClient::waitHandshake] result OK
20230706 13:53:40.402 --- [Varjo::State::PropertyClient::waitForConnection] Trying to connect to PropertyServer
20230706 13:53:40.403 --- [Varjo::State::PropertyClient::waitForConnection] Connected to PropertyServer
20230706 13:53:40.403 --- [Varjo::State::PropertyClient::onClientRoleRequest] Identifying as client role 'RUNTIME'
20230706 13:53:40.404 --- [Varjo::State::PropertyClient::processOnPropertyDefinitions] Received definitions for 301 properties
20230706 13:53:40.405 --- [Varjo::State::PropertyClient::tryInitialization] Connection to Property Server established and property definitions initialized
20230706 13:53:40.406 --- [Varjo::Session::createCompositorLink] Create compositor link for sdk#openxr#1000001380176498000
20230706 13:53:40.406 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait...
20230706 13:53:40.407 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait... OK.
20230706 13:53:40.407 --- [Varjo::ProcessorUtil::useOnlyPerformanceCpuCoresForCurrentProcess] Setting Process Affinity mask 0xffff
20230706 13:53:40.408 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.408 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
[SK diagnostic] Found OpenXR runtime: Varjo OpenXR Runtime 3.10.1
20230706 13:53:40.466 --- [Varjo::GazeClient::connectionThread] GazeClient 'sdk#openxr#1000001380176498000' with output frequency 100Hz and smoothing ON successfully connected to suitable gaze IPC stream
[SK diagnostic] [sk_gpu] Using Direct3D 11: vendor 0x10DE, device 0x2204
[SK diagnostic] [sk_gpu] Device: NVIDIA GeForce RTX 3090
[SK diagnostic] Starting a stereo display
20230706 13:53:40.541 --- [Varjo::HandTrackingClient::start] Start HandTrackingClient
[SK diagnostic] System name: XR-3
[SK diagnostic] Platform supports single-pass rendering
[SK diagnostic] OpenXR articulated hands ext enabled!
[SK diagnostic] OpenXR gaze ext enabled!
20230706 13:53:40.542 --- [Varjo::HandTrackingClient::process] HandTrackingSource thread started
[SK diagnostic] Creating view: PrimaryStereo color:rgba32_linear depth:depth32 blend:Alpha Blend
20230706 13:53:40.545 --- [Varjo::HandTrackingClient::process] (skipped 0) Waiting for IPC input Varjo.HandTracking.TrackedHands connection...
20230706 13:53:40.545 --- [Varjo::CreateAndInitSession] clientSessionId: sdk#openxr#1000001380326851400, version: 3.10.1.14
20230706 13:53:40.546 --- [PipeSession::Run] Pipe4: Open
20230706 13:53:40.547 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.548 --- [PipeSession::Run] Pipe4: Disconnected
20230706 13:53:40.548 --- [Varjo::LayerClient::LayerClient] New LayerClient, unique client session id: 'sdk#openxr#1000001380326851400', sdk version='3.10.1.14'
20230706 13:53:40.548 --- [PipeSession::Run] Pipe5: Open
20230706 13:53:40.549 --- [PipeClient::OnSessionStart] Connected.
20230706 13:53:40.550 --- [Varjo::LayerClient::waitHandshake] Wait for handshake
20230706 13:53:40.551 --- [Varjo::LayerClient::waitHandshake] HANDSHAKE OK
20230706 13:53:40.552 *** [Varjo::LayerClient::waitHandshake] result OK
20230706 13:53:40.554 --- [Varjo::State::PropertyClient::waitForConnection] Trying to connect to PropertyServer
20230706 13:53:40.557 --- [Varjo::State::PropertyClient::waitForConnection] Connected to PropertyServer
20230706 13:53:40.557 --- [Varjo::State::PropertyClient::onClientRoleRequest] Identifying as client role 'RUNTIME'
20230706 13:53:40.558 --- [Varjo::State::PropertyClient::processOnPropertyDefinitions] Received definitions for 301 properties
20230706 13:53:40.559 --- [Varjo::State::PropertyClient::tryInitialization] Connection to Property Server established and property definitions initialized
20230706 13:53:40.560 --- [Varjo::Session::createCompositorLink] Create compositor link for sdk#openxr#1000001380326851400
20230706 13:53:40.560 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait...
20230706 13:53:40.562 --- [Varjo::LayerClient::createIPCAndWait] createIPCAndWait... OK.
20230706 13:53:40.563 --- [Varjo::ProcessorUtil::useOnlyPerformanceCpuCoresForCurrentProcess] Setting Process Affinity mask 0xffff
20230706 13:53:40.564 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.564 --- [Varjo::GazeClient::connectionThread] GazeClient 'VarjoSystem.FoveatedViewManager.Latency' with output frequency DeviceHz and smoothing ON successfully connected to suitable gaze IPC stream
20230706 13:53:40.567 --- [Varjo::Session::createSwapChain] Varjo::Session::createSwapChain, client: sdk#openxr#1000001380176498000
20230706 13:53:40.569 --- [Varjo::LayerClient::createSwapChain] createSwapchain... OK.
20230706 13:53:40.569 --- [Varjo::Session::createSwapChain] Varjo::Session::createSwapChain, client: sdk#openxr#1000001380176498000
20230706 13:53:40.571 --- [Varjo::LayerClient::createSwapChain] createSwapchain... OK.
[SK diagnostic] Set view: PrimaryStereo to 4148x3556@1msaa
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at StereoKit.NativeAPI.sk_init(StereoKit.SKSettings)
   at StereoKit.NativeAPI.sk_init(StereoKit.SKSettings)
   at StereoKit.SK.InitializeCall(StereoKit.SKSettings)
   at StereoKit.SK.Initialize(StereoKit.SKSettings)
   at ModelViewer.Application.Main(System.String[])

With 0.3.7-preview.9 the successful init log continue as follows:

...
20230706 13:59:19.131 --- [Varjo::Session::createSwapChain] Varjo::Session::createSwapChain, client: sdk#openxr#1000001718721317900
20230706 13:59:19.134 --- [Varjo::LayerClient::createSwapChain] createSwapchain... OK.
[SK diagnostic] Set view: PrimaryStereo to 4148x3556@1msaa
[SK diagnostic] Bounds updated: 0.00x0.00 at (0.0,0.0,0.0) (0.00,0.00,0.00,1.00)
[SK diagnostic] Initializing Audio
[SK diagnostic] ISAC audio backend not available, falling back to miniaudio! It's likely the device doesn't have Windows Sonic enabled, which can be found under Settings->Sound->Device Properties->Spatial Sound.
[SK info] Using audio backend: WASAPI
[SK diagnostic] Initializing Defaults
[SK diagnostic] Initializing World
[SK diagnostic] Initializing Sprites
[SK diagnostic] Initializing Lines
[SK diagnostic] Initializing UI
[SK diagnostic] Initializing Renderer
[SK diagnostic] Initializing Physics
[SK diagnostic] Initializing Input
[SK info] Initialization successful
...

Edit: added native call stack

maluoi commented 1 year ago

Okay! Good news is that I actually can reproduce this using the Varjo simulator too. I've got a decent idea what's causing this, and I should have a fix for it relatively soon. Thanks for the details! :)

maluoi commented 1 year ago

Ok, fix for this should be in tonight's build :)

paulmelis commented 1 year ago

With preview.1601 I indeed don't see the issue anymore, closing!