[Online Subsystem Steam]Crash when the host calls DestroySession.

sakuraba_intense
Sat, 23 Nov 2024 04:43:12 +0000
C++

Hello,
I am encountering a crash issue when trying to use DestroySession with OnlineSubsystemSteam.
Code Causing the Crash

check(SessionInfo->SessionType == ESteamSession::AdvertisedSessionHost || SessionInfo->SessionType == ESteamSession::AdvertisedSessionClient);

Interestingly, even though the session is created as a lobby, the function that caused the crash is DestroyInternetSession.

Here’s the relevant part of the DestroyInternetSession function:

uint32 FOnlineSessionSteam::DestroyInternetSession(FNamedOnlineSession* Session, const FOnDestroySessionCompleteDelegate& CompletionDelegate)
{
    Session->SessionState = EOnlineSessionState::Destroying;

    if (Session->SessionInfo.IsValid())
    {
        FOnlineSessionInfoSteam* SessionInfo = (FOnlineSessionInfoSteam*)(Session->SessionInfo.Get());
        check(SessionInfo->SessionType == ESteamSession::AdvertisedSessionHost || SessionInfo->SessionType == ESteamSession::AdvertisedSessionClient);
    }
}

Upon investigating the function call, I found instances where DestroyLobbySession is called, but it requires bUsesPresence to be true. The code looks like this:

if (Session->SessionSettings.bUsesPresence)
{
    Result = DestroyLobbySession(Session, CompletionDelegate);
}
else
{
    Result = DestroyInternetSession(Session, CompletionDelegate);
}

I expected DestroyLobbySession to be called, but since bUsesPresence must be true, I’m uncertain if this implementation is correct.

I have attempted to resolve this issue on my own but haven’t been successful. I would greatly appreciate any advice or suggestions from the community.

Development Environment

UE 5.4.4

OnlineSubsystemEOS

OnlineSubsystemSteam

Thank you for your help!

DefaultEngine.ini

[OnlineSubsystemEOS]
bEnabled=true

[OnlineSubsystemEOSPlus]
bEnabled=true

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=*******
bInitServerOnClient=true

[OnlineSubsystem]
DefaultPlatformService=EOSPlus
NativePlatformService=Steam

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemEOS.NetDriverEOS",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[/Script/SocketSubsystemEOS.NetDriverEOSBase]
bIsUsingP2PSockets=True

[/Script/OnlineSubsystemUtils.OnlineEngineInterfaceImpl]
+CompatibleUniqueNetIdTypes=EOS
+CompatibleUniqueNetIdTypes=EOSPlus
MappedUniqueNetIdTypes=(("EOSPlus","EOS"))

CrashLog

[2024.11.21-10.37.47:131][224]LogWindows: Error: appError called: Assertion failed: SessionInfo->SessionType == ESteamSession::AdvertisedSessionHost || SessionInfo->SessionType == ESteamSession::AdvertisedSessionClient [File:D:\build\++UE5\Sync\Engine\Plugins\Online\OnlineSubsystemSteam\Source\Private\OnlineSessionInterfaceSteam.cpp] [Line: 650]


[2024.11.21-10.37.47:131][224]LogWindows: Windows GetLastError: この操作を正しく終了しました。 (0)
[2024.11.21-10.37.47:798][224]LogWindows: Error: === Critical error: ===
[2024.11.21-10.37.47:798][224]LogWindows: Error:
[2024.11.21-10.37.47:798][224]LogWindows: Error: Assertion failed: SessionInfo->SessionType == ESteamSession::AdvertisedSessionHost || SessionInfo->SessionType == ESteamSession::AdvertisedSessionClient [File:D:\build\++UE5\Sync\Engine\Plugins\Online\OnlineSubsystemSteam\Source\Private\OnlineSessionInterfaceSteam.cpp] [Line: 650]
[2024.11.21-10.37.47:798][224]LogWindows: Error:
[2024.11.21-10.37.47:798][224]LogWindows: Error:
[2024.11.21-10.37.47:798][224]LogWindows: Error:
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff638efd71c Xacuti-Win64-DebugGame.exe!FOnlineSessionSteam::DestroyInternetSession() []
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff638efe0c0 Xacuti-Win64-DebugGame.exe!FOnlineSessionSteam::DestroySession() []
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff6388407ae Xacuti-Win64-DebugGame.exe!ULobbyWidget::LeaveRoom() [C:\Users\intense\Xacuti\Xacuti\Source\Xacuti\UserInterfaces\Lobby\LobbyWidget.cpp:153]
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff638702c70 Xacuti-Win64-DebugGame.exe!ULobbyWidget::execLeaveRoom() [C:\Users\intense\Xacuti\Xacuti\Intermediate\Build\Win64\UnrealGame\Inc\Xacuti\UHT\LobbyWidget.gen.cpp:154]
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff630738069 Xacuti-Win64-DebugGame.exe!UFunction::Invoke() []
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff630a1b884 Xacuti-Win64-DebugGame.exe!UObject::CallFunction() []
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff630a32148 Xacuti-Win64-DebugGame.exe!ProcessLocalScriptFunction() []
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff630a09975 Xacuti-Win64-DebugGame.exe!ProcessScriptFunction<void (__cdecl*)(UObject * __ptr64,FFrame & __ptr64,void * __ptr64)>() []
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff630a31c8e Xacuti-Win64-DebugGame.exe!ProcessLocalFunction() []
[2024.11.21-10.37.47:798][224]LogWindows: Error: [Callstack] 0x00007ff630a32148 Xacuti-Win64-DebugGame.exe!ProcessLocalScriptFunction() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630a3136c Xacuti-Win64-DebugGame.exe!UObject::ProcessInternal() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630738069 Xacuti-Win64-DebugGame.exe!UFunction::Invoke() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630a2ffda Xacuti-Win64-DebugGame.exe!UObject::ProcessEvent() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630a09174 Xacuti-Win64-DebugGame.exe!TMulticastScriptDelegate<FNotThreadSafeDelegateMode>::ProcessMulticastDelegate<UObject>() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff63863b8d9 Xacuti-Win64-DebugGame.exe!UCommonButtonBase::NativeOnClicked() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff63862d7d6 Xacuti-Win64-DebugGame.exe!UCommonButtonBase::HandleButtonClicked() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630738069 Xacuti-Win64-DebugGame.exe!UFunction::Invoke() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630a2ffda Xacuti-Win64-DebugGame.exe!UObject::ProcessEvent() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630a09174 Xacuti-Win64-DebugGame.exe!TMulticastScriptDelegate<FNotThreadSafeDelegateMode>::ProcessMulticastDelegate<UObject>() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff635131a87 Xacuti-Win64-DebugGame.exe!UButton::SlateHandleClicked() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff63865dcee Xacuti-Win64-DebugGame.exe!UCommonButtonInternalBase::SlateHandleClickedOverride() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff63861f1e0 Xacuti-Win64-DebugGame.exe!TBaseUObjectMethodDelegateInstance<0,UCommonButtonInternalBase,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff6310e3b7f Xacuti-Win64-DebugGame.exe!SButton::ExecuteOnClick() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff6311023d6 Xacuti-Win64-DebugGame.exe!SButton::OnMouseButtonUp() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff63863f993 Xacuti-Win64-DebugGame.exe!SCommonButton::OnMouseButtonUp() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630ed6cfb Xacuti-Win64-DebugGame.exe!`TArray<TWeakPtr<TAnimatedAttributeBase,1>,TSizedDefaultAllocator<32> >::Remove'::`2'::<lambda_1>::operator()() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630eca3d8 Xacuti-Win64-DebugGame.exe!TArray<TSharedPtr<SWindow,1>,TSizedDefaultAllocator<32> >::RemoveAll<`TArray<TSharedPtr<SWindow,1>,TSizedDefaultAllocator<32> >::Remove'::`2'::<lambda_1> >() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630f12afa Xacuti-Win64-DebugGame.exe!FSlateApplication::RoutePointerUpEvent() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630f03313 Xacuti-Win64-DebugGame.exe!FSlateApplication::ProcessMouseButtonUpEvent() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630ef7dc0 Xacuti-Win64-DebugGame.exe!FSlateApplication::OnMouseUp() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630b7c02a Xacuti-Win64-DebugGame.exe!FWindowsApplication::ProcessDeferredMessage() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630b66b92 Xacuti-Win64-DebugGame.exe!FWindowsApplication::DeferMessage() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630b7e8c0 Xacuti-Win64-DebugGame.exe!FWindowsApplication::ProcessMessage() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630b6143f Xacuti-Win64-DebugGame.exe!FWindowsApplication::AppWndProc() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ffda28083f1 USER32.dll!UnknownFunction []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ffda2807c3b USER32.dll!UnknownFunction []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ffd412f9be4 EOSOVH-Win64-Shipping.dll!UnknownFunction []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ffda28083f1 USER32.dll!UnknownFunction []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ffda2807eb1 USER32.dll!UnknownFunction []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff630b7f35b Xacuti-Win64-DebugGame.exe!FWindowsPlatformApplicationMisc::PumpMessages() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff637739f2e Xacuti-Win64-DebugGame.exe!FEngineLoop::Tick() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff63775330c Xacuti-Win64-DebugGame.exe!GuardedMain() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff6377533da Xacuti-Win64-DebugGame.exe!GuardedMainWrapper() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff637755fa5 Xacuti-Win64-DebugGame.exe!LaunchWindowsStartup() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff637766284 Xacuti-Win64-DebugGame.exe!WinMain() []
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ff63bc215ea Xacuti-Win64-DebugGame.exe!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
[2024.11.21-10.37.47:799][224]LogWindows: Error: [Callstack] 0x00007ffda29b259d KERNEL32.DLL!UnknownFunction []
[2024.11.21-10.37.47:799][224]LogWindows: Error:
[2024.11.21-10.37.47:805][224]LogExit: Executing StaticShutdownAfterError
[2024.11.21-10.37.47:807][224]LogWindows: FPlatformMisc::RequestExit(1, LaunchWindowsStartup.ExceptionHandler)
[2024.11.21-10.37.47:807][224]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3, LaunchWindowsStartup.ExceptionHandler)
[2024.11.21-10.37.47:807][224]LogCore: Engine exit requested (reason: Win RequestExit)

1 post - 1 participant