Agora-Unreal-RTC-SDK icon indicating copy to clipboard operation
Agora-Unreal-RTC-SDK copied to clipboard

Strange crash in project (Not urgent)

Open HereafterApps opened this issue 2 years ago • 8 comments

Hi,

So everything works well within my test project. But when i move it over to my main project, i get a few crashes in the editor.

In suspecting this has something to do with a race condition. The crashes happen about 10 seconds after i end play in editor mode.

On debugging, here is where it crashes: I keep continuing to get the next few images.

A breakpoint instruction (__debugbreak() statement or a similar call) was executed in UnrealEditor.exe. Exception thrown at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001.

image

image

image

And then keeps cycling in the same area - image

'''Exception thrown at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Unhandled exception at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Exception thrown at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Unhandled exception at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Exception thrown at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Unhandled exception at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Exception thrown at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Unhandled exception at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Exception thrown at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Unhandled exception at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. Exception thrown at 0x00007FF89C019FF3 (UnrealEditor-Core.dll) in UnrealEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000001. '''

This is after pressing continue a bunch of times.

HereafterApps avatar Oct 25 '23 14:10 HereafterApps

Could you offer logs for more details? Any clues in the Call Stack?

WinterPu avatar Nov 03 '23 06:11 WinterPu

@HereafterMills , we want to check if this issue has been resolved. Did you find the cause from the log file? Another hint from a common pitfall is that the Agora engine did not get properly disposed when the game stop playing. That would cause similar crashing issue in the Editor like you experience.

icywind avatar Nov 20 '23 17:11 icywind

This still happens for me in my project but not in the example template. @icywind

You're probably correct about the cause, bit I'm not sure how to resolve it.

Fir now, iv disabled voice in the editor

HereafterApps avatar Nov 20 '23 23:11 HereafterApps

@WinterPu Was trying to get the logs, but unreal doesnt write anything in the logs. Which is why i had to run it in debug mode to get the call stack

HereafterApps avatar Nov 21 '23 22:11 HereafterApps

This still happens for me in my project but not in the example template. @icywind

You're probably correct about the cause, bit I'm not sure how to resolve it.

Fir now, iv disabled voice in the editor

Here are some code snippet copied from the examples:

void UAgoraVideoWidget::UnInitAgoraEngine()
{
	if (RtcEngineProxy)
	{
		RtcEngineProxy->leaveChannel();
		RtcEngineProxy->unregisterEventHandler(UserRtcEventHandler.Get());
		RtcEngineProxy->release();
		RtcEngineProxy = nullptr;
		UBFL_Logger::Print(FString::Printf(TEXT("%s release agora engine"), *FString(FUNCTION_MACRO)), LogMsgViewPtr);
	}
}

Call this when quitting the app. See if that works on your project?

icywind avatar Dec 05 '23 01:12 icywind

I'm using the blueprint example though. Should I create c++ class and try this?

HereafterApps avatar Dec 05 '23 03:12 HereafterApps

It is even easier for Blueprint. Here is a tutorial for a basic BP project and you can find the graph for the clean up in the "End Play" section.

icywind avatar Dec 05 '23 23:12 icywind

image

This is what im currently doing. However, i am running this code in my game instance as follows:

image image

This is a platform game instance where onApplicationWillTerminate is called anyway at shutdown.

HereafterApps avatar Dec 06 '23 06:12 HereafterApps