Stopping build now leaves UnreaBuildTool process running

Subj. Maybe that is only a source build engine feature, but breaking builds in UE solution now leaves UnrealBuildTools running and compiling in background.

Hey -

You mentioned source built engine, are you on 4.11.0, 4.11.1, or 4.11.2? Are you building the engine itself or are you building a project? Does this happen every time you cancel a compile? Are you starting / canceling the compile in Visual Studio or the Editor?

Hi , I am building Unreal Engine from release branch of github.
I build an UE project and try to build my Program tool in it’s ecosystem. Whenever I Ctrl-Break build project it reports that it was cancelled but UnreaBuildTool is still alive and many instances of cl compiler too. And they don’t die with time, continuing to respawn and compile some code.
I am building it in Visual Studio.

Maybe it interferes with other UE instances running the same time?

I tried to test it by creating a new (blank) C++ project and adding code to it. After starting the compile I checked my Processes and found UBT. When I canceled the build in VS, UBT was no longer showing in my processes window. Do you have the same issue of UBT continuing to run in a new project as well or is it only occurring when building a specific project. If it only happens in one project, can you provide a copy of that project? If you’re seeing this in new projects as well, please let me know if there is something that I’m doing differently.

Hi ,

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.

I think this problem still exists. And it easier to reproduce it when you work with several UE project’s open at once.

Can you provide any additional information to help reproduce this? How many projects are you working on at once? What is each project doing while compiling a specific project?

It is possible that one of the other projects may be using the UBT process. If you break a build and still see UBT, what happens if you then close the other projects?

Hard to. I can say that if you rebuild a big project and Ctrl-Break it somewhere in the middle - UnrealBuildTool usually remain. MsBuild also reports some errors. Maybe that happens when it build a lot of plugins in parallel.

Hey -

I have continued to test this and have not seen an instance where UBT continues to run after stopping a compile. As mentioned previously, if you do see UBT continuing to run please try closing any other open projects and let me know if it is still there. Additionally, if you are able to reproduce this with a new project(s), please provide the reproduction steps used.

Hi ,

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.

Hi .

Can someone at Epic please look into this problem seriously? It’s been an issue for a few versions now. Originally I only noticed it with a source-built engine, but am now seeing it more and more frequently when building projects using the launcher version too.

A bunch of people are clearly experiencing it - this thread is almost a year old.

It shows across multiple versions of UE4 and VS, which clearly suggests it’s a fundamental bug in UBT, or anyway in how UBT is integrated into VS. The fact is it’s sporadic - it doesn’t happen every time and I’m not aware of any way to reproduce it on demand. But it’s a huge hassle, and if nothing is done until there’s a 100% repro case, then it will most likely never get fixed.

Let me know if I can give you any more information.

Hey -

As mentioned, identifying the cause has proven difficult since we have not seen UBT continue to run after stopping a compile over numerous tests. If this issue is not 100% reproducible, having an understanding of the project setup or if the problem can occur in a new project with no added content will help. Unfortunately, without a consistent repro case for the issue, we are unable to proceed with the investigation. If you are able to provide a detailed list of steps, or a project where the issue is consistently occurring, please feel free to do so and we can look into the issue further.

Well having looked into this properly for the first time, I am actually seeing this behaviour 100% of the time, both source build and launcher versions, for any project.

Testing it in a new project does not make sense though. The issue is UBT does not cancel, however it doesn’t hang either. It simply runs to completion, so if you are only building a small amount of code, the process will end very quickly anyway. If you open up (in VS) a project with a significant amount of code and hit rebuild as opposed to build (to make sure it has plenty of work to do), then cancel the build, the UnrealBuildTool process will end for you immediately? For me it runs to completion every time, but with the following immediate output in VS:

1>------ Build started: Project: ******* Configuration: DebugGame_Editor x64 ------
1>  Creating makefile for ******* (working set of source files changed)
1>MSBUILD : error MSB4166: Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.
1>A task was canceled.
1>A task was canceled.
Build has been canceled.

I’m wondering now if this hasn’t always been the case, but is only noticed on the occasions you try to build again soon after cancelling a substantial build, and especially so for people working on low powered machines. If so it’s an even bigger issue than I’d thought. The fact that UBT is invoked from VS via a batch file suggests this would actually make sense, but if it doesn’t happen for you, then I guess there is some other issue.

I tried creating a ShooterGame project and then deleting the Binaries folder to make the compile time take longer. When choosing the compile / recompile option I can see UnrealBuildTool start in the task manager processes however when I cancel the build, UBT is promptly removed from processes. This was tested on 4.11.2 and 4.12.5 binary versions of the engine. Please let me know if you’re able to reproduce this using the ShooterGame project as well as what engine version you are seeing this on to help me test further.

Hey there,

just to let you, I’m pretty much experiencing this issue from day 1 I seriously started using Unreal Engine 4. And to my knowledge, it happens 100% of the time I try and cancel builds as describes it. I would usually notice it because you cannot start another build since UBT is still running.
I wouldn’t consider my machine week however (at least in terms of CPU power although it’s not the most recent iteration of CPU’s: i5 2500k @ 3.3 GHZ [how do you get an AT character other than copy paste it here? it always wants to insert a blockquote]). On the other hand, my HDD (I don’t have an SSD unfortunately) does have a lot of work to do and may be the bottleneck.

I’m rarely cancelling builds nowadays as my knowledge about the UE ways has improved over time. If I still do it, I’ll always make sure to check the Task Manager and kill UBT manually.

So while I was writing this, I’ve just tried to reproduce this issue on 4.11.0 with a custom engine built from source. After starting the build process I hit CTRL+Break as soon as ShaderCompileWorker started to be compiled. The ouptut now still produces a warning: “C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): warning MSB5021” BUT UBT is no longer running. For testing purposes I did the same using Visual Studio 2013 Ultimate (instead of Visual Studio 2015 Ultimate) and after hitting CTRL+Break to cancel the build, UBT KEEPS RUNNING! The project file for Visual Studio 2013 was generated using the following command:

D:/UE4_Dev/UE4.11.0/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="C:\Users\<UserName>\Documents\Unreal Projects\ShooterGame\ShooterGame.uproject" -game -engine -2013

So it seems to be related to the version of Visual Studio that’s being used.

Hope that helps get this fixed.

Cheers
UE

This happens to me literally everytime I build and Cancel.

I just force-quit the UnrealBuildTool and MSCompiler threads in Task Manager. Seems to be the only way to kill it.

I tried creating a 4.9 project to force the use of Visual Studio 2013 and again try testing this by compiling Shooter Game. I was still unable to see UBT continuing to run after canceling the compile process. I have entered a bug report that you can track here: Unreal Engine Issues and Bug Tracker (UE-34613)

I can confirm that the issue still exists in 4.15 and I first noticed it in 4.14.

Don’t know if others will experience same as this issue seems to be highly unpredictable, but I’ve just moved over to VS 2017 (Community) and can finally cancel builds without having to kill off processes.

I’m so happy I keep cancelling builds for no good reason. :slight_smile:

I’m having this problem with building the engine from github sources. When I press “cancel” from Visual Studio 2017, it immediately says “Build has been canceled” in the Output window, but my CPU still shows 100% usage in task manager, with a boatload of C++ compiler instances running and UnrealBuildTool still running as well. If I stop UnrealBuildTool from powershell, the build actually stops. Here’s the command I’m using to actually stop UnrealBuildTool, as a workaround: Stop-Process -Name “UnrealBuildTool”