jrouwe / JoltPhysics

A multi core friendly rigid body physics and collision detection library. Written in C++. Suitable for games and VR applications. Used by Horizon Forbidden West.
MIT License
6.76k stars 452 forks source link

Crash on Mutex::lock() - 0x00007ffbd9232ff0 MSVCP140.dll!UnknownFunction #1152

Closed AndreaCatania closed 4 months ago

AndreaCatania commented 4 months ago

Hello, yesterday I've compiled unreal engine from source and updated MSVC to the latest version. Now, when I package the game (using the unreal engine package tool) the game crashes right away during the Jolt initialization.

This crash never occurs when I launch the game from the unreal editor, and didn't occur before me compiling unreal from source, which one of the step is to install some libraries directly download from the Epic servers (using Setup.bat).

I've the suspect that the libraries used to compile the game for packaging differ from the one used by the editor and also the one loaded when launching the packaged game and this is causing the crash.

Do you have any idea what else could cause it?

[2024.07.02-08.11.51:621][  0]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000008
[2024.07.02-08.11.51:621][  0]LogWindows: Error: 
[2024.07.02-08.11.51:621][  0]LogWindows: Error: [Callstack] 0x00007ffbd9232ff0 MSVCP140.dll!UnknownFunction []
[2024.07.02-08.11.51:621][  0]LogWindows: Error: [Callstack] 0x00007ffbd9233268 MSVCP140.dll!UnknownFunction []
[2024.07.02-08.11.51:621][  0]LogWindows: Error: [Callstack] 0x00007ff6f0dcab45 FlyingToyz-Win64-DebugGame.exe!JPH::Mutex::lock() [C:\Users\Andrea\Documents\Workspace\Momento\FlyingLegends\Source\FlashFramework\LibraryJolt\JoltPhysics\Jolt\Core\Mutex.h:137]
[2024.07.02-08.11.51:621][  0]LogWindows: Error: [Callstack] 0x00007ff6f0dcbf66 FlyingToyz-Win64-DebugGame.exe!JPH::BodyManager::Init() [C:\Users\Andrea\Documents\Workspace\Momento\FlyingLegends\Source\FlashFramework\LibraryJolt\JoltPhysics\Jolt\Physics\Body\BodyManager.cpp:104]
AndreaCatania commented 4 months ago

I've also found this https://stackoverflow.com/questions/78598141/first-stdmutexlock-crashes-in-application-built-with-latest-visual-studio which is interesting but didn't solve the problem

AndreaCatania commented 4 months ago

Closing this issue to open a discussion instead.