Unreal crashes with VirtualFree assertion error during gameplay

Hello,

I am using Unreal 4.6.1, Windows 8.1, and when I play the game in either standalone mode (from the Editor) or as a packaged exe application (both 32 bit and 64 bit versions) Unreal will always crash after playing the game after 5-10 minutes, even if I don’t actually do anything once the game loads. The crash is caused by an assertion error when trying to free the virtual memory: Assertion failed: VirtualFree( Ptr, 0, MEM_RELEASE ) != 0

Here is the crash report:

Unknown exception - code 00000001 (first/second chance not available)

Assertion failed: VirtualFree( Ptr, 0, MEM_RELEASE ) != 0
[File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.6\Engine\Source\Runtime\Core\Private\Windows\WindowsPlatformMemory.cpp] [Line: 165]

KERNELBASE + 24684 bytes
MyGame!FOutputDeviceWindowsError::Serialize() + 261 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:95]
MyGame!FOutputDevice::Logf__VA() + 248 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\private\misc\outputdevice.cpp:144]
MyGame!FDebug::AssertFailed() + 1221 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\private\misc\outputdevice.cpp:224]
MyGame!FMallocBinned::FreeInternal() + 1260 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\public\hal\mallocbinned.h:630]
MyGame!SharedPointerInternals::DestroyObject >() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\public\templates\sharedpointerinternals.h:273]
MyGame!FMediaTextureResource::UpdateDeferredResource() + 2375 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\mediaassets\private\assets\mediatextureresource.cpp:121]
MyGame!FDeferredUpdateResource::UpdateResources() + 77 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\engine\private\texturerendertarget.cpp:127]
MyGame!RenderViewFamily_RenderThread() + 128 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\renderer\private\scenerendering.cpp:1061]
MyGame!TGraphTask<FRendererModule::BeginRenderingViewFamily'::11’::EURCMacro_FDrawSceneCommand>::ExecuteTask() + 444 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\public\async\taskgraphinterfaces.h:667]
MyGame!FTaskThread::ProcessTasks() + 2869 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\private\async\taskgraph.cpp:428]
MyGame!FTaskThread::ProcessTasksUntilQuit() + 61 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\private\async\taskgraph.cpp:271]
MyGame!RenderingThreadMain() + 147 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\rendercore\private\renderingthread.cpp:275]
MyGame!FRenderingThread::Run() + 60 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\rendercore\private\renderingthread.cpp:376]
MyGame!FRunnableThreadWin::Run() + 86 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:73]
MyGame!FRunnableThreadWin::GuardedRun() + 93 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:26]
kernel32 + 5805 bytes
ntdll + 453476 bytes

I have seen other assertion errors on this forum but non of this type as yet. Any help or suggestions would be really appreciated. Thanks.

Hey byoc,

Could you also provide me with your crash logs and dmp files for this crash?

This information is really helpful to the developers when fixing an issue/bug.

Also, do you have some reproducible steps so I can get this to occur in a blank empty project on my end?

Thank you,

Hi Andrew,

Thanks for the reply.

The crash log (dump) is in the original post, are you referring to something else? Also, when the crash occurred I selected the option to send it to the UE4 team, so they should have it hopefully. It is the error report with Assertion failed: VirtualFree( Ptr, 0, MEM_RELEASE ) != 0

FYI, after additional investigation, the issue seems to only occur in Windows 8.1 (testing on Windows 7 does not result in the crash) and happens when using the Media Texture to play a WMV video in loop mode after further investigation. When I remove all references to the Media Texture in my scene, package as a 64 bit exe, and run the exe, the crash does not seem to occur, so I suspect it is related to the media texture when playing videos. Hence, I the best way to reproduce the error would be to apply a Media Texture (I use a WMV file around 5 MB in size) to an object in Windows 8.1, package it as a 32 or 62 bit Windows exe, and let it run for 2 hours. It will likely crash when trying to free the virtual memory when the assertion test fails (as shown in the original post) within 10 minutes on Windows 8.1.

I will provide the steps next …

Here are the steps to reproduce:

  1. On Windows 8.1 start UE 4.6.1 or 4.7 (this example I used 4.7)
  2. Create a blank project
  3. Add a new media player (under Miscellaneous heading), a media texture, a new material.
  4. Open the media player, point to a 1080p WMV video file (that is what I use) and select the “Auto Play” and “Looping” check-boxes. Make sure it plays the video. Save.
  5. Open the media texture and in the details panel select the media player. It should play the video if auto play was set previously.
  6. Open the material and assign the media texture to the Base Color and Emissive Color. Do this by creating a TextureSample node, assigning the media texture to it, and then wiring the node (white node) to the base color and emissive color. You should see the video playing on the material preview window.
  7. Assign the material to something in the scene, I assigned it to the floor the chairs are sitting on. It should play automatically in the scene.
  8. Click “Save all” to save the project. Package it to a Windows exe, 64-bit. I left the packing defaults (packaging mode to development, full rebuild, not for distribution (unchecked), etc.)
  9. Run the packaged exe on Windows, leave it running for awhile. Mine crashes in 45 minutes on average sitting there doing nothing and letting the video loop. The crash sometimes occurs in 30 minutes, sometimes in 1.5 hrs. It has always occurred within 2 hours.

I am running the above on a Windows 8.1 desktop machine, 16 GB Ram, i7 64bit 3.6GHz, 8 Core, NVIDIA GeForce GTX 970 graphics card.

Thanks!

Hey byoc,

We have a forum post that explains how to report a bug that will give you a better explanation on the information we need to create a full bug report. Use the link below to review this thread. Your callstack is what you copied to the AnswerHub post, the crash logs and dmp files are generated as text files and saved to a specific directory.

How to Report a Bug

Just for your own information, there were a few bugs already reported in 4.6.1 that dealt with the media player asset. The Media Asset was implemented in 4.5.1 as an experimental feature, and is still under development currently.

Here is a link to the official thread for the Media Asset on the Forums. Hopefully this can give you some more insight on the current issues with this feature in specific.

Media Asset Framework

Regards,