In 4.18.2 mac, adding a vector constant to any material in a VR project crashes 100%

CONFIGURATION

I am testing on Mac OS X 10.12.6 (16G29) with Unreal Version: 4.18.2-3794801+++UE4+Release-4.18. The editor seems to run with Metal when it runs. I have not tested on Windows.

REPRODUCTION STEPS

I choose New Project. I choose a Blueprint->Virtual Reality project. I pick Desktop/Console, Maximum Quality, No Starter Content. It opens to StartupMap. Under Content Browser I hit Add New, Materials and Textures, Material. It creates a material NewMaterial. I open NewMaterial. I hover anywhere and type “4” to create a 4-vector.

It crashes. Here is the stack trace (it always looks like this):

LoginId:30f48c6a6544accf6eec2cbfde7a341a
EpicAccountId:343ebe79f67a4f089a872db61d9a6728

 SEGV_NOOP at 0x0

ShaderBindingStage::updateConstantTable(unsigned int, unsigned int) Address = 0x136adb48d (filename not found) [in AppleIntelBDWGraphicsMTLDriver]
ShaderBindingStage::updateBindingTableData() Address = 0x136adc080 (filename not found) [in AppleIntelBDWGraphicsMTLDriver]
ShaderBindingStage::writeTableIf() Address = 0x136adc586 (filename not found) [in AppleIntelBDWGraphicsMTLDriver]
IGAccelRenderCommandEncoder::programPipeline(sPrimitiveData const&) Address = 0x136acaac2 (filename not found) [in AppleIntelBDWGraphicsMTLDriver]
IGAccelRenderCommandEncoder::drawPrimitives(MTLPrimitiveType, unsigned int, unsigned int, unsigned int, unsigned int) Address = 0x136ac9a26 (filename not found) [in AppleIntelBDWGraphicsMTLDriver]
-[MTLIGAccelRenderCommandEncoder drawPrimitives:vertexStart:vertexCount:instanceCount:] Address = 0x136ab88a3 (filename not found) [in AppleIntelBDWGraphicsMTLDriver]
FMetalRenderPass::DrawPrimitive(unsigned int, unsigned int, unsigned int, unsigned int) Address = 0x126c3e955 (filename not found) [in UE4Editor-MetalRHI.dylib]
FMetalRHICommandContext::RHIEndDrawPrimitiveUP() Address = 0x126c21a59 (filename not found) [in UE4Editor-MetalRHI.dylib]
DrawPrimitiveUP(FRHICommandList&, unsigned int, unsigned int, void const*, unsigned int) Address = 0x112ba22cb (filename not found) [in UE4Editor-Renderer.dylib]
FMeshDrawingPolicy::DrawMesh(FRHICommandList&, FMeshBatch const&, int, bool) const Address = 0x112c67b95 (filename not found) [in UE4Editor-Renderer.dylib]
void FDrawBasePassDynamicMeshAction::Process<FUniformLightMapPolicy>(FRHICommandList&, FProcessBasePassMeshParameters const&, FUniformLightMapPolicy const&, FUniformLightMapPolicy::ElementDataType const&) Address = 0x112b3b1f3 (filename not found) [in UE4Editor-Renderer.dylib]
void ProcessBasePassMesh<FDrawBasePassDynamicMeshAction>(FRHICommandList&, FProcessBasePassMeshParameters const&, FDrawBasePassDynamicMeshAction&&) Address = 0x112aae550 (filename not found) [in UE4Editor-Renderer.dylib]
FBasePassOpaqueDrawingPolicyFactory::DrawDynamicMesh(FRHICommandList&, FViewInfo const&, FBasePassOpaqueDrawingPolicyFactory::ContextType, FMeshBatch const&, bool, FDrawingPolicyRenderState const&, FPrimitiveSceneProxy const*, FHitProxyId, bool) Address = 0x112aadd39 (filename not found) [in UE4Editor-Renderer.dylib]
FRendererModule::DrawTileMesh(FRHICommandListImmediate&, FDrawingPolicyRenderState&, FSceneView const&, FMeshBatch const&, bool, FHitProxyId const&) Address = 0x1131d04e0 (filename not found) [in UE4Editor-Renderer.dylib]
FTileRenderer::DrawTile(FRHICommandListImmediate&, FDrawingPolicyRenderState&, FSceneView const&, FMaterialRenderProxy const*, bool, float, float, float, float, float, float, float, float, bool, FHitProxyId, FColor) Address = 0x1061f982e (filename not found) [in UE4Editor-Engine.dylib]
FCanvasTileRendererItem::Render_RenderThread(FRHICommandListImmediate&, FDrawingPolicyRenderState&, FCanvas const*) Address = 0x1061fa6d4 (filename not found) [in UE4Editor-Engine.dylib]
FCanvas::Flush_RenderThread(FRHICommandListImmediate&, bool) Address = 0x106334e46 (filename not found) [in UE4Editor-Engine.dylib]
FPreviewElement::DrawRenderThread(FRHICommandListImmediate&, void const*) Address = 0x117cd879f (filename not found) [in UE4Editor-GraphEditor.dylib]
FSlateRHIRenderingPolicy::DrawElements(FRHICommandListImmediate&, FSlateBackBuffer&, TRefCountPtr<FRHITexture2D>&, TRefCountPtr<FRHITexture2D>&, TArray<FSlateRenderBatch, FDefaultAllocator> const&, TArray<FSlateClippingState, FDefaultAllocator>, FSlateRenderingOptions const&) Address = 0x125294d6d (filename not found) [in UE4Editor-SlateRHIRenderer.dylib]
FSlateRHIRenderer::DrawWindow_RenderThread(FRHICommandListImmediate&, FSlateRHIRenderer::FViewportInfo&, FSlateWindowElementList&, bool, bool, FVector2D) Address = 0x1252b0313 (filename not found) [in UE4Editor-SlateRHIRenderer.dylib]
TGraphTask<TEnqueueUniqueRenderCommandType<FSlateRHIRenderer::DrawWindows_Private(FSlateDrawBuffer&)::SlateDrawWindowsCommandName, FSlateRHIRenderer::DrawWindows_Private(FSlateDrawBuffer&)::$_5> >::ExecuteTask(TArray<FBaseGraphTask*, FDefaultAllocator>&, ENamedThreads::Type) Address = 0x125308587 (filename not found) [in UE4Editor-SlateRHIRenderer.dylib]
FNamedTaskThread::ProcessTasksNamedThread(int, bool) Address = 0x1033e1f1c (filename not found) [in UE4Editor-Core.dylib]
FNamedTaskThread::ProcessTasksUntilQuit(int) Address = 0x1033e0fc8 (filename not found) [in UE4Editor-Core.dylib]
FTaskGraphImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type) Address = 0x1033dd0ae (filename not found) [in UE4Editor-Core.dylib]
RenderingThreadMain(FEvent*) Address = 0x108f022a1 (filename not found) [in UE4Editor-RenderCore.dylib]
FRenderingThread::Run() Address = 0x108f16d17 (filename not found) [in UE4Editor-RenderCore.dylib]
FRunnableThreadPThread::Run() Address = 0x10345627e (filename not found) [in UE4Editor-Core.dylib]
FRunnableThreadPThread::_ThreadProc(void*) Address = 0x103400fc7 (filename not found) [in UE4Editor-Core.dylib]
_pthread_body Address = 0x7fffdac9093b (filename not found) [in libsystem_pthread.dylib]
_pthread_body Address = 0x7fffdac90887 (filename not found) [in libsystem_pthread.dylib]
thread_start Address = 0x7fffdac9008d (filename not found) [in libsystem_pthread.dylib]

If I look up the log in ~/Library/Logs, I get:

[2017.12.23-15.58.16:748][374]LogContentBrowser: Native class hierarchy updated for 'MaterialEditor' in 0.0004 seconds. Added 1 classes and 0 folders.
[2017.12.23-15.58.16:753][374]LogMaterial: Missing cached shader map for material NewMaterial, compiling. 
[2017.12.23-15.58.17:236][374]LogSlate: Took 0.000416 seconds to synchronously load lazily loaded font '../../../Engine/Content/Slate/Fonts/Roboto-Regular.ttf' (155K)
[2017.12.23-15.58.17:902][374]LogMaterial: Missing cached shader map for material NewMaterial, compiling. 
[2017.12.23-15.58.17:980][374]LogSlate: Took 0.000759 seconds to synchronously load lazily loaded font '../../../Engine/Content/Editor/Slate/Fonts/Roboto-BoldCondensed.ttf' (158K)
[2017.12.23-15.58.25:335][430]LogMaterial: Missing cached shader map for material NewMaterial, compiling. 
[2017.12.23-15.58.25:377][430]LogMaterial: Missing cached shader map for material FMatExpressionPreview MaterialExpressionConstant4Vector_0, compiling. 
[2017.12.23-15.58.26:058][431]LogMac: === Critical error: ===
SIGSEGV: invalid attempt to access memory at address 0x0

ADDITIONAL NOTES

I also get the crash if I create a “VectorParameter” node instead of a vector constant node.

I do NOT get the crash if, when I create my New Project, I create a new Blank project instead of a new Virtual Reality project.

I am experiencing this both with newly created VR projects and with old projects based on the VR template I created back in 4.18.0. I did NOT see this problem using the 4.18.0 editor.

I am filing this as a bug report because it is a reproducible crash. However, it is blocking development because it means I cannot edit materials in my VR project, so any workarounds would be appreciated.

Update:

If I right-click on an existing VectorParameter node and say “duplicate”, it creates a new VectorParameter and I do NOT get the crash.

If I right-click on a VectorParameter node and say “convert to constant”, I DO get the updateConstantTable crash.

The materials in my test projects don’t have any existing 4-vector constant nodes, so I don’t know what happens if I duplicate those.

Update 2:

I can create scalar and 2-vector constants without crashes. Only 3-vectors and 4-vectors crash.

Update 3: Tested on Windows 10 version 1709, did not see the crash.

Update 4: The mac crash (with the same “update constant table” stack) also occurs when adding a Texture Sample 2D parameter to a material. This is creating a really serious impediment to development.

Update 5: I have a project, based on the VR template, which I prepared on Windows. One map contains a complicated blueprint involving render targets and materials with Texture Sample 2D parameters. The complicated map runs fine on Windows. When I copy the project to the mac, I am able to open the complicated map, but if i attempt to play it I get a crash similar to, but slightly different from, the crash I describe above. If I use the “migrate” tool and I copy the complicated map into a new project which is NOT based on the VR template, I am able to both open and run the map on mac with no problems. Again the problem seems to be limited to projects based on the VR template.

Attached is the stack for the new crash.link text

Hi,

I ran some tests to try to reproduce this on 10.13.2 (we do not currently have a Mac with 10.12 installed that we can test on), but did not see a crash occur. Do you happen to have Mac with 10.13 installed that you can test this on?

There were some conflicts between the Metal compiler in Xcode and Nvidia drivers recently that caused us to have to disable Metal in the Editor for some hardware configurations. I don’t think that may be contributing to this, but I cannot entirely rule it out either. Would it be possible to get the hardware information for your Mac?

, thanks, here is the hardware configuration from the System Information tool link text

I do not have 10.13.2, but I will upgrade this computer to 10.13.2 to test. Once I do that though I will not be able to downgrade back to 10.12.

If you have not already started upgrading your Mac to 10.13.2, make sure to create a backup of your Mac with Time Machine first. If you have a backup created in 10.12, you should be able to use Time Machine to roll your Mac back to that backup and revert back to 10.12 that way (I have not actually tried this process myself).

I looked over the specs that you provided, and did not see anything that immediately made me suspect that the crash you are experiencing may be a hardware concern. However, your Mac is on the low end of what we recommend using for development with the Engine. While I don’t think this is contributing to the crash that you described, it is possible that your experience with the Engine may be negatively impacted depending on the complexity of your projects.

Hello, I upgraded to High Sierra 10.13.2 (17C88) and XCode 9.2 (9C40b). The problem is now gone. I can create 4-vectors, VectorParameters and TextureSampler2D parameters.

I am unblocked. However, I would like to give a piece of advice. In my opinion it would be highly desirable for your QA team to have access to at least one Sierra machine, or in general to have access to one (Current version - 1) machine at all times. Apple historically has supported XCode on Current Release + Current Release Minus One, so it will not be unusual for developers to be running Current Release Minus One versions.