Mediapipe4u-plugin icon indicating copy to clipboard operation
Mediapipe4u-plugin copied to clipboard

Error: Build Crashing randomly because of MediaPipe

Open hammadfozi opened this issue 8 months ago • 12 comments

MediaPipe4U Version

2022.1.1.20240524

UE Version

5.1.x

UnrealEngine Type

Install From Epic Games Launcher

Platform

Windows

What happened?

Hi, I have a Unreal build that randomly crashes on MediaPipe. I have attached the crash files (2 different crashes in their dated folders).

Overall, the crash stack is as follows:

ECHO_PARK.exe!FMallocBinned2::Realloc(void *,unsigned __int64,unsigned int)	C++
ECHO_PARK.exe!FMallocPoisonProxy::Realloc(void *,unsigned __int64,unsigned int)	C++
ECHO_PARK.exe!FMemory::Realloc(void *,unsigned __int64,unsigned int)	C++
ECHO_PARK.exe!TArray<wchar_t,class TSizedDefaultAllocator<32> >::ResizeGrow(int)	C++
ECHO_PARK.exe!FString::AppendChars(wchar_t const *,int)	C++
ECHO_PARK.exe!FGenericPlatformHttp::UrlEncode(class TStringView<wchar_t>)	C++
ECHO_PARK.exe!FLicenseInfo::ToRawString() Line 49	C++
[Inline Frame] ECHO_PARK.exe!MediaPipeSolverLicense::CheckLicense() Line 21	C++
ECHO_PARK.exe!UMediaPipeSolver::Solve(const FMediaPipeFrame & MediaPipeFrame, FComponentSpacePoseContext & Output, float Alpha) Line 590	C++
ECHO_PARK.exe!FAnimNode_MediaPipePose::EvaluateComponentPose_AnyThread(FComponentSpacePoseContext & Output) Line 25	C++
[External Code]	
ECHO_PARK.exe!FAnimNode_MediaPipeLocation::EvaluateComponentPose_AnyThread(FComponentSpacePoseContext & Output) Line 69	C++
[External Code]	

ECHO_PARK.exe!FMediaPipeAnimInstanceProxy::Evaluate_WithRoot(FPoseContext & Output, FAnimNode_Base * InRootNode) Line 126 C++ [External Code]

So the crash comes when the MediaPipeAnimInstance eventually converts the license to raw string. I've been looking at the crash for quite some time and stuck badly. I really need your help, please let me know.

ECHO_PARK.log UEMinidump.dmp

hammadfozi avatar Mar 21 '25 01:03 hammadfozi

Thank you for giving me so much information. The crash problem must be fixed. Could you please describe when and what operation will crash?

If I can reproduce your problem, I will be able to fix it faster.

Generally,the license checking only in the first frame of the animation, and it, and it should only be done once. There may be other reasons for checking during the animation process.

endink avatar Mar 21 '25 04:03 endink

This is a random bug. I'm developing an experience which will remain operational at least 12 hours daily. While testing in-house when I play the unreal build, and I conduct several sessions, this crash happens randomly.

Each play session:

  • Starts the media pipe holistic component
  • Is able to get the feed of the user in the game
  • Maps that user's body from the camera feed to a bunch of same skeletons
  • After a few seconds, there's a render that's recorded
  • The experience restarts

For convenience sakes I can upload the project and send it to you, so you're able to understand it on a deeper level.

Also, since this plugin is closed-source I'm unable to debug and fix the issue myself. Any immediate help would be appreciated. Thanks.

hammadfozi avatar Mar 21 '25 05:03 hammadfozi

I watch your dump file, it crashed in UE code (URL decoding), I will try reproduce it.

BTW, your VC runtime is lower then M4U compilation environment, suggest upgrade it.

endink avatar Mar 21 '25 13:03 endink

Hey, I have the following version installed:

MSVC v143 - VS 2022 C++ x64/x86 build tools (14.38-17.8)

Also, when I package my game, I see this in the logs:

Engine Version: 5.1.1-23901901+++UE5+Release-5.1
Compiled with Visual C++: 19.29.30147.00

GStreamer: Version 1.24.10

+---------------------+-----------------------------------------------------------------------------------------+
+---------------------+-----------------------------------------------------------------------------------------+
| DataDir             | C:/Hyperspace/EchoPark/Plugins/MediaPipe4U/Source/ThirdParty/mediapipe/Data             |
+---------------------+-----------------------------------------------------------------------------------------+
| License File        | C:/Hyperspace/EchoPark/Plugins/MediaPipe4U/Source/MediaPipe/license/mediapipe4u.license |
+---------------------+-----------------------------------------------------------------------------------------+
| Device ID           | E823_8FA6_BF53_0001_001B_448B_4E1E_FD47.B869A57709B6B413ACBDD843AEC0899A                |
+---------------------+-----------------------------------------------------------------------------------------+
| Project             | ECHO_PARK                                                                               |
+---------------------+-----------------------------------------------------------------------------------------+
| Licensed Edition    | Trial                                                                                   |
+---------------------+-----------------------------------------------------------------------------------------+
| Licensed Expiration | 2025-08-01                                                                              |
+---------------------+-----------------------------------------------------------------------------------------+
| Plugin Version      | 2022.1.1.20240524                                                                       |
+---------------------+-----------------------------------------------------------------------------------------+
| API Library Version | 0.1.20240520                                                                            |
+---------------------+-----------------------------------------------------------------------------------------+

Using bundled DotNet SDK version: 6.0.302
Win64: (Status=Valid, MinAllowed_Sdk=10.0.00000.0, MaxAllowed_Sdk=10.9.99999.0, Current_Sdk=10.0.22621.0, Allowed_AutoSdk=10.0.18362.0, Current_AutoSdk=, Flags="InstalledSdk_ValidVersionExists")

How are you seeing the VCRuntime version? I need to know from where, so when I fix that, I should know what I should see there

hammadfozi avatar Mar 22 '25 14:03 hammadfozi

M4U use :

  • vc toolchain: 14.38.33130
  • Windows sdk: 10.0.22621

Makesure yours equal or greater than these.

endink avatar Mar 23 '25 13:03 endink

I'm currently using these:

VC Toolchain: 14.38.33143 Windows SDK: 10.0.22621.0

hammadfozi avatar Mar 23 '25 21:03 hammadfozi

That's ok. (Your dump file looks like using a lower win sdk.)

I will remove all license check while animation is processing in next version and hope to fix this bug.

endink avatar Mar 24 '25 01:03 endink

The VC ToolChain and WindowsSDK versions are what I see from Visual Studio when I compile my project.

When will you release the next version? I need to have this fixed asap so it's ready for deployment.

hammadfozi avatar Mar 24 '25 01:03 hammadfozi

If your release has some time, If you can send me something, just for the 5.1 engine I have, I'd appreciate it.

hammadfozi avatar Mar 24 '25 01:03 hammadfozi

The new version will be released in this month. I believe this issue can be solved, because I have located the problem code. Although the specific reason is unclear, I guess it is UE UrlDecode function has a thread safe problem. I can remove these codes to prevent this BUG.

endink avatar Mar 24 '25 04:03 endink

There is no temporary solution to fix this issue. The thread safety problem is difficult to get around. You can only wait for the new version to fix. I am very sorry for this, the only thing I can do is speed up the new version release.

endink avatar Mar 24 '25 05:03 endink

A new early version has just been released, I remove these code from animation intance, maybe it can fix this

endink avatar Apr 08 '25 14:04 endink

Hey, my project is on Unreal 5.1 and I see the update isn't released for 5.1 Can you please update it for 5.1 as well? Thanks.

hammadfozi avatar Apr 21 '25 01:04 hammadfozi

The new version is not stable, and 5.1 compilation is already a bit difficult, maybe it will be supported after stabled, can't you upgrade the UE version? Is your project a big project?

endink avatar Apr 21 '25 05:04 endink

Yes, it's a big project, that's why we can't move it. Also the free license file is expired, and I can't do development anymore. Can you please send me the updated license file please?

[email protected]

hammadfozi avatar Aug 01 '25 23:08 hammadfozi

Support for UE 5.1 has been added.

endink avatar Aug 16 '25 16:08 endink