4.6.1 Uber nasty crashes in apex dll

Hi guys,

I have a map with many destructibles, some vehicles and characters and from time to time with chain explosions (bum->bum->bum) the engine is crashing somewhere in apex.

My engine versions is 4.6.1 compiled from sources with some major changes.

I have not tried reproduce this issue on build from launcher, my project is pretty complicated and I’m unable to do it there:(

Async scene is enabled - with async scene disabled I could’nt reproduce crashes, but framerate is much lower.

From provided stack traces(see beloow) I can deduce that the crashes are somehow related to scene locks, so I put scene locks in almost every function in DestructibleComponent but the engine is still crashing:(

I also tried launch game with PHYSX/APEX debug dlls, but the engine is crashing at:

GPhysXFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, *GPhysXAllocator, *ErrorCallback);

UE4Editor-Engine-Win64-Debug.dll!__delayLoadHelper2(const ImgDelayDescr * pidd, __int64 (void) * * ppfnIATEntry) Line 315	C++
[External Code]	
>UE4Editor-Engine-Win64-Debug.dll!InitGamePhys() Line 312	C++
UE4Editor-Win64-Debug.exe!FEngineLoop::PreInit(const wchar_t * CmdLine) Line 1195	C++
UE4Editor-Win64-Debug.exe!EnginePreInit(const wchar_t * CmdLine) Line 31	C++
UE4Editor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 110	C++
UE4Editor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 191	C++

It seems the one of the debug dll is trying to load another dll and can’t find it.

I can’t decode function name because I don’t have symbols for APEX libs and I can’t run engine with debug dlls.

Can you guys give me symbols for PHYSX/APEX and missing debug dll?

Thanks in advance

Pierdek

Access violation - code c0000005 (first/second chance not available)

APEX_DestructiblePROFILE_x64 + 26236 bytes
APEX_DestructiblePROFILE_x64 + 412925 bytes
APEX_DestructiblePROFILE_x64 + 411432 bytes
APEXFrameworkPROFILE_x64 + 176197 bytes
UE4Editor_Engine!TGraphTask<FPhysXTask>::ExecuteTask() + 452 bytes [d:\Build\engine\source\runtime\core\public\async\taskgraphinterfaces.h:671]
UE4Editor_Core!FTaskThread::ProcessTasks() + 2979 bytes [d:\Build\engine\source\runtime\core\private\async\taskgraph.cpp:428]
UE4Editor_Core!FTaskThread::ProcessTasksUntilQuit() + 77 bytes [d:\Build\engine\source\runtime\core\private\async\taskgraph.cpp:271]
UE4Editor_Core!FTaskThread::Run() + 11 bytes [d:\Build\engine\source\runtime\core\private\async\taskgraph.cpp:562]
UE4Editor_Core!FRunnableThreadWin::Run() + 86 bytes [d:\Build\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:73]
UE4Editor_Core!FRunnableThreadWin::GuardedRun() + 93 bytes [d:\Build\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:26]
kernel32 + 88557 bytes
ntdll + 181569 bytes


Access violation - code c0000005 (first/second chance not available)

APEX_DestructiblePROFILE_x64 + 416291 bytes
APEX_DestructiblePROFILE_x64 + 411507 bytes
APEXFrameworkPROFILE_x64 + 176197 bytes
UE4Editor_Engine!TGraphTask<FPhysXTask>::ExecuteTask() + 452 bytes [d:\Build\engine\source\runtime\core\public\async\taskgraphinterfaces.h:671]
UE4Editor_Core!FTaskThread::ProcessTasks() + 2979 bytes [d:\Build\engine\source\runtime\core\private\async\taskgraph.cpp:428]
UE4Editor_Core!FTaskThread::ProcessTasksUntilQuit() + 77 bytes [d:\Build\engine\source\runtime\core\private\async\taskgraph.cpp:271]
UE4Editor_Core!FTaskThread::Run() + 11 bytes [d:\Build\engine\source\runtime\core\private\async\taskgraph.cpp:562]
UE4Editor_Core!FRunnableThreadWin::Run() + 86 bytes [d:\Build\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:73]
UE4Editor_Core!FRunnableThreadWin::GuardedRun() + 93 bytes [d:\Build\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:26]
kernel32 + 88557 bytes
ntdll + 181569 bytes



Access violation - code c0000005 (first/second chance not available)

APEX_DestructiblePROFILE_x64 + 434650 bytes
APEX_DestructiblePROFILE_x64 + 435222 bytes
APEX_DestructiblePROFILE_x64 + 415451 bytes
APEX_DestructiblePROFILE_x64 + 413385 bytes
APEX_DestructiblePROFILE_x64 + 411458 bytes
APEXFrameworkPROFILE_x64 + 176197 bytes
UE4Editor_Engine!TGraphTask<FPhysXTask>::ExecuteTask() + 452 bytes [d:\Build\engine\source\runtime\core\public\async\taskgraphinterfaces.h:671]
UE4Editor_Core!FTaskThread::ProcessTasks() + 2979 bytes [d:\Build\engine\source\runtime\core\private\async\taskgraph.cpp:428]
UE4Editor_Core!FTaskThread::ProcessTasksUntilQuit() + 77 bytes [d:\Build\engine\source\runtime\core\private\async\taskgraph.cpp:271]
UE4Editor_Core!FTaskThread::Run() + 11 bytes [d:\Build\engine\source\runtime\core\private\async\taskgraph.cpp:562]
UE4Editor_Core!FRunnableThreadWin::Run() + 86 bytes [d:\Build\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:73]
UE4Editor_Core!FRunnableThreadWin::GuardedRun() + 93 bytes [d:\Build\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:26]
kernel32 + 88557 bytes
ntdll + 181569 bytes

Hey Pierdek,
Is it possible you are linking against an old version of APEX? I have seen this happen when the version specified by the header is different than what you’re linking against and it will assert.

Hi Ori

Nope, it is not possible I checked this and I have good libs/dlls for apex they are the same as in normal build downloaded from git.

You can reproduce error with loading DEBUG PHYSX/APEX dlls with these steps:

  1. download https://github.com/EpicGames/UnrealEngine/tree/4.6 zip
  2. unpack somewhere
  3. run setup.bat to download rest of dependencies
  4. find line 58 in PhysxLibs.cpp and comment && !defined(NDEBUG)
  5. compile and run
  6. observe that engine will crash at GPhysXFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, *GPhysXAllocator, *ErrorCallback);

Any change to give me pdb’s?

Regards

Pierdek

Sure, can you e-mail me at Ori.Cohen@epicgames.com and I can give you the details

Hi again, it turned out __delayLoadHelper2 is trying to load PROFILE versions of libs:) The only option is to define and build whole engine as DEBUG CRT

bDebugBuildsActuallyUseDebugCRT = true;

in BuildConfiguration.cs then the engine will load DEBUG versions of PHYSX/APEX libraries.

But of course there is an issue in compilation with this flag defined described by me here:

I’m testing some solutions around build configurations scripts to fix CEF problem.