UE 4.5 Preview CanvasRenderTarget2d Causes Crash

Creating a CanvasRenderTarget2D class in blueprints causes UE4.5 Preview editor to immediately crash. Tested on both Mac and Win8.1. Here is the report:

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

UE4Editor_Engine + 2426345 bytes
UE4Editor_Engine + 2154307 bytes
UE4Editor_Engine + 1090007 bytes
UE4Editor_CoreUObject + 549780 bytes
UE4Editor_CoreUObject + 1319694 bytes
UE4Editor_CoreUObject + 1435986 bytes
UE4Editor_CoreUObject + 1571779 bytes
UE4Editor_CoreUObject + 1441150 bytes
UE4Editor_CoreUObject + 1321002 bytes
UE4Editor_CoreUObject + 1577332 bytes
UE4Editor_CoreUObject + 1441150 bytes
UE4Editor_CoreUObject + 549780 bytes
UE4Editor_CoreUObject + 1439091 bytes
UE4Editor_Engine + 1817793 bytes
UE4Editor_Engine + 9870667 bytes
UE4Editor_Engine + 3769152 bytes
UE4Editor_Engine + 3873213 bytes
UE4Editor_Engine + 3883475 bytes
UE4Editor_Engine + 3885642 bytes
UE4Editor_UnrealEd + 4144935 bytes
UE4Editor_UnrealEd + 4429600 bytes
UE4Editor_UnrealEd + 4526214 bytes
UE4Editor_UnrealEd + 1893329 bytes
UE4Editor_UnrealEd + 6486294 bytes
UE4Editor!FEngineLoop::Tick() + 3524 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\launchengineloop.cpp:2129]
UE4Editor!GuardedMain() + 479 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\launch.cpp:133]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\windows\launchwindows.cpp:201]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Hey alperenakyuz-

I opened a new project and created a blueprint with CanvasRenderTarget2D as the parent class without any crash. I also tried creating a variable and set its type to class CanvasRenderTarget2D. Are either of these same process you used or are there other steps I’m missing. Any additional information you can provide will help narrow down the cause of this crash.

Hi alperenakyuz,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

Thank you, sorry that I couldn’t respond.

I can create a blueprint with a CanvasRenderTarget2D parent and also create a variable as you have. The crash happens when I use the Create CanvasRenderTarget2D node in blueprints.

If I’m not wrong the “Create CanvasRenderTarget2D” node is the only way of using this functionality. It used to work in UE4.4 with occasional minor errors. I would be grateful if someone could have a look at this issue and maybe also give some info on how to properly use this class.

Btw, this issue is still present in UE4.5 release (not the preview).

Could you explain the steps you take to set up the blueprint prior to the crash? Adding an image of your blueprint would also help in understanding how you are setting things up. It would also help if yo could add your logs from the crash. The “Editor Session Log” section of this link shows where they are in your project folder. A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

I think the best way would be to explain how I got it working in UE4.4 and how it crashes in UE4.5.

In UE 4.4.3, I create a project based using the blueprint third person template (with the starter content).

First I create a folder named “CRT2D” (short for CanvasRenderTarget2D". Then I create the necessary assets in it:

-A blueprint named “MyCRT2D” with the parent class “CanvasRenderTarget2D”.

-A material named “MyMaterial” with a texture parameter named “DynamicTexture”.

-A font named “MyFont48” which is an Impact font with size 48.

I open the default MyCharacter blueprint and add a Static Mesh to it (Cube from the Shapes folder). Then I add an “Event Begin Play” node and wire it as shwon in the screenshot.

Then I open the MyCRT2D blueprint and arrange it to draw some text on the CanvasRenderTarget2D.

I took a screenshot to show that it works in the game.

The same setup doesn’t work in UE 4.5 whether I convert the same project from UE 4.4.3 or create it in UE 4.5 from scratch.

Thank you so much for looking into this btw.

Here is the crash report:

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

UE4Editor_Engine + 2426793 bytes
UE4Editor_Engine + 2154707 bytes
UE4Editor_Engine + 1090535 bytes
UE4Editor_CoreUObject + 549780 bytes
UE4Editor_CoreUObject + 1318750 bytes
UE4Editor_CoreUObject + 1435554 bytes
UE4Editor_CoreUObject + 1572003 bytes
UE4Editor_CoreUObject + 1440718 bytes
UE4Editor_CoreUObject + 1320058 bytes
UE4Editor_CoreUObject + 1577556 bytes
UE4Editor_CoreUObject + 1440718 bytes
UE4Editor_CoreUObject + 549780 bytes
UE4Editor_CoreUObject + 1438659 bytes
UE4Editor_Engine + 1818193 bytes
UE4Editor_Engine + 9871675 bytes
UE4Editor_Engine + 3769504 bytes
UE4Editor_Engine + 3873565 bytes
UE4Editor_Engine + 3883827 bytes
UE4Editor_Engine + 3885994 bytes
UE4Editor_UnrealEd + 4144983 bytes
UE4Editor_UnrealEd + 4429648 bytes
UE4Editor_UnrealEd + 4526262 bytes
UE4Editor_UnrealEd + 1893329 bytes
UE4Editor_UnrealEd + 6486374 bytes
UE4Editor!FEngineLoop::Tick() + 3524 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\launchengineloop.cpp:2129]
UE4Editor!GuardedMain() + 479 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\launch.cpp:133]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\windows\launchwindows.cpp:201]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

The image you posted only shows the in-game result. Do you have an image of your bluerprint as well?

Yup, right here:

Also this for the MyCRT2D

Hey alperenzkyuz-

I was able to reproduce this crash internally and have submitted it to our internal tracking system (TTP #349656). The crash seems to occur due to the values set in the Width and Height fields of the “Create Canvas Render Target 2D” node.

Cheers

Doug Wilson

Thanks! I was suspecting that something was wrong with the dimension ints; if you type in zero for either value, it doesn’t crash; however it doesn’t create a CRT2D either. Anyways, I’m glad that it’ll be solved.

Cheers

Hi there Doug Wilson, I don’t want to complain much because I love UE4 but this issue still persists in the latest build. I’m wondering if this is getting any priority at all. CanvasRenderTarget2D was a functional part of the engine until the 4.5 update and I know it didn’t get discontinued or anything as it’s still there. My project is basically rubbish without canvas render targets and I cannot fix the issue in C++. Can someone please spare some time and help me out?

Thank you.