UE::AutoSDK::GetSDKInfo hangs if SDK JSON config can't be loaded

We ran into this while upgrading to 5.6. It occurred on our build server while cooking nightly builds.

The main issue is that the do-while loop in UE::AutoSDK::GetSDKInfo (Engine/Source/Developer/TargetPlatform/Private/TargetPlatformManagerModule.cpp, line 149) will never time out if GetJsonObject always returns a null value.

This was happening because we have some comments in our Windows_SDK.json file. I saw that you’d replaced comments with JSON keys in CL 39200598, and we were able to fix the issue by doing the same to ours. But before we did that, FJsonSerializer::Deserialize in the GetJsonObject lambda was failing, which caused the loop to just spin indefinitely waiting for this to succeed.

I think the loop should eventually time out with an error if it can’t load the file. We had to debug into the process to identify the issue, as otherwise it wasn’t clear where it was stuck.

Steps to Reproduce

  1. Add a comment line (“// comment”) to Engine/Config/Windows/Windows_SDK.json
  2. Run an automated task (e.g. cooking) that uses AutoSDK

UE::AutoSDK::GetSDKInfo will get into an infinite loop because GetJsonObject never returns a non-null value.

Hey there Kevin,

Thanks for submitting this to us. I’ve created a JIRA to have a look at this internally to see if we can have better error messaging.

Julian

For posterity, this was submitted @ https://github.com/EpicGames/UnrealEngine/commit/ce392794f310d9bd27f585ca333aad73e5fa29b8

Kind regards,

Julian