I can repro in a debug build by going into OnlineSubsystemTypes and removing the UE_BUILD_SHIPPING condition for `IsUniqueIdLocal`, then set a break point in `FOnlineSubsystemModule::ParseOnlineSubsystemName`. During module startup this causes enough of a stall on the game thread so that `FOnlineAsyncTaskManagerSteam::OnlineTick` processes callbacks before all OSS are ready. More specifically the callback `FOnlineAsyncTaskManagerSteam::OnUserStatsReceived` runs and tries to log a message which eventually, via `IsUniqueIdLocal` crashes because it checks `IOnlineSubsystem::DoesInstanceExist` where `FModuleManager::GetModuleChecked<FOnlineSubsystemModule>(“OnlineSubsystem”);` returns null reference because that subsystem module is loaded but not ready (a condition that returns a nullptr in `FModuleManager::GetModule`).
[Attachment Removed]
Steps to Reproduce
During game launch (shipping build), specifically in module startup for FOnlineSubsystemModule, we get a crash. What I’ve found is that the native OSS (Steam) starts up first, and `FOnlineAsyncTaskManagerSteam::OnlineTick` starts getting called on a non-gamethread. In `FOnlineAsyncTaskManagerSteam::OnlineTick` as part of processing a callback, I see that it eventually calls out to `IsUniqueIdLocal` which then crashes in `IOnlineSubsystem::DoesInstanceExist` because it eventually tries to use an online subsystem module that isn’t ready (see `FModuleManager::GetModuleChecked<FOnlineSubsystemModule>(“OnlineSubsystem”)`. This is pretty easy to repro by stalling the game thread just after the native OSS has started up. Going into DefaultEngine.ini and setting `bLoadNativeOSSBeforeDefault` to false prevents the crash, but we don’t want that. Curious if there is some other workaround or maybe we have something configured in correctly? Another fix I found was to go into `FOnlineAsyncTaskManagerSteam::OnlineTick` and early out until `FModuleManager::Get().GetModule(“OnlineSubsystem”);` returns non-nullptr.
[Attachment Removed]
The early out using GetModule is a good way to delay processing any steam callbacks until the module is ready. I’ve created a bug report for us to fix this in the general case in a future release.
[Attachment Removed]