[bug report?] Code changes not taking effect unless .dll file deleted manually

While I’m currently on 4.11 Preview 3, I’ve been having this problem since 4.10.2 and have only been able to resolve this error with upgrading to a new version of the editor. Here’s a description of my problem:

I created a new structure (FSDeadEndTile) in my .h file, and created a TArray for it (called DeadEnds).

I created a function (int32 FindAllDeadEnds()) to loop through my LabyrinthTiles array and find all the dead end tiles and add them to the DeadEnds array.

Upon building and testing this, I kept crashing out when I would try to playtest my level. Any changes I made to the code (including commenting out everything I had just created) and rebuilding, would not clear this error from occurring. The crash report kept referring to an assert in the UE array code (index>=0) & (index < size). The very next line referenced my Labyrinth.cpp file line 14, which was part of the new function I had created. (if (!Tiles.Num()) return 0;)

Even though I had Built, Rebuilt, Cleaned with this whole function commented out, and even restarted the entire computer, this error persisted (and even still referenced this line of code which, as I said, was commented out and should not be executing at all) until I manually went into my binaries folder and deleted the UE4Editor-[gamename].dll file and reloaded the editor (which detected it was missing and rebuilt it.) Then I was once again able to PIE without crashing out.

If you need any more details, please ask. If there’s something you can see that I did wrong, please let me know.

Many headaches would have been missed had I discovered this sooner.

Thanks.

Are you closing the editor, rebuilding the binary in VS and then restarting the editor? This is the only clean way to update.

Yes, I had tried to rebuild with the editor closed, but that didn’t change anything. Only deleting that .dll file manually worked. Normally I don’t ever have this problem with updating my class, but when I do, it’s consistently happening when I’m having a problem with Arrays. Every time.

Can you try to change something, make sure the editor is closed and then build. Save the log. Check if the thing hasn’t changed when you load the editor. If it hasn’t, post the log here.

Okay. I will copy my project and try to “break” it to reproduce my problem a little bit later and post my results back here with the logs.

I just exposed one of my structure properties to blueprints, closed the editor and rebuilt. Upon re-entering the editor I was unable to see that variable when I split the pins on my foreach loop. I closed the editor, deleted the UE4Editor-[gamename].dll file from the Binaries->Win64 directory in my project, reloaded the editor (which rebuilt this file) and my changes showed up.

Do the same thing again (confirming it’s broken,) but post the build log from visual studio.

Reconfirmed. This change only showed up after I deleted the .dll file.

Output from rebuild process:

1>------ Rebuild All started: Project: LabyrinthLarry, Configuration: DebugGame_Editor x64 ------
1> Cleaning LabyrinthLarryEditor Binaries…
1> Compiling game modules for hot reload
1> Creating makefile for hot reloading LabyrinthLarryEditor (no existing makefile)
1> Compiling game modules for hot reload
1> Performing full C++ include scan (no include cache file)
1> Parsing headers for LabyrinthLarryEditor
1> Running UnrealHeaderTool “D:\UEProjects\LabyrinthLarry - Copy\LabyrinthLarry.uproject” “D:\UEProjects\LabyrinthLarry - Copy\Intermediate\Build\Win64\LabyrinthLarryEditor\DebugGame\UnrealHeaderTool.manifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -installed
1> Reflection code generated for LabyrinthLarryEditor in 3.0075887 seconds
1> Performing 8 actions (4 in parallel)
1> [3/8] Resource ModuleVersionResource.rc.inl
1> [2/8] Resource PCLaunch.rc
1> PCH.LabyrinthLarry.h.cpp
1> Labyrinth.cpp
1> LabyrinthLarry.cpp
1> LabyrinthLarry.generated.cpp
1> MoonLight.cpp
1> [8/8] Link UE4Editor-LabyrinthLarry-7098-Win64-DebugGame.dll
1> Creating library D:\UEProjects\LabyrinthLarry - Copy\Intermediate\Build\Win64\UE4Editor\DebugGame\UE4Editor-LabyrinthLarry-7098-Win64-DebugGame.lib and object D:\UEProjects\LabyrinthLarry - Copy\Intermediate\Build\Win64\UE4Editor\DebugGame\UE4Editor-LabyrinthLarry-7098-Win64-DebugGame.exp
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1> Total build time: 31.58 seconds
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Are you launching the editor from VS? Because you’re compiling in Debug Game, not Development, which won’t be used by the editor if you start the editor from the launcher. If you start the editor by hitting f5 in VS, your Debug Game changes will take effect.

I’ve always started from the launcher. These problems didn’t start until after updating to 4.10.2, and then, it was mostly always dealing with crashing out on an array out of bounds error. For the most part, my changes hot reload just fine when I’m just dealing with general code logic. But adding and removing properties has occasionally required a restart of the editor after a build.

Anyway, pressing F5 from within VS gives me:

75587-vs+error.png

Did you change to the development build configuration in VS?

Hello Mbublitz,

is on the right track. Changing the build configuration to Development or Development Editor should have these changes reflect in the editor for you. Have you given that a try thus far?

We haven’t heard from you in a while, Mbublitz. Are you still experiencing this issue? If so, have you tried building in Development Editor as suggested in the previous comments? I’ll be marking this issue as resolved in the meantime for tracking purposes.

Yes, this happens regardless of the build mode I’m in–I’ve tried them all. One thing I recently saw in the notes for the 4.10.2 update was to not upgrade the VSC2015 to Service Pack 2. My development machine had recently had a failure with the SSD boot drive and I noticed that since getting my development machine rebuilt and all the software reinstalled that I am, in fact, running with Service Pack 2 installed (Not specifically by choice, but that was the version that installed after I re-downloaded it once my machine was up running again). Perhaps this is the cause of the problems I’m seeing, even though I’m presently working on 4.11 preview 4 now?

And again, just to reiterate, the main problem I’m seeing seemed to specifically be related to creating new arrays and getting the “array out of bounds” error. The only way I could recover from that was to delete the .dll file mentioned in the post and have the engine rebuild it upon reload of my project. It didn’t matter if I closed the editor, made the changes to my C++ class and recompiled with the editor closed or not. Unless I specifically deleted that file, none of my changes would take effect. (Even though I was able to reproduce that same behavior with the other posts in this thread.) I never had any of these problems until I had updated to the 4.10.2 build, and originally the only way I was able to get back into my project at the time was to upgrade to the 4.11 preview release (which forced that .dll file to be rebuilt.)

Thank you for that clarification. From rereading all of the information given thus far, are you experiencing the issue in any manner when using 4.11 Preview 4 or was this only an issue in 4.10.2?

Also, is this something that you’re able to reproduce from a fresh project? If so, could you provide some steps on how to get the issue to occur from a fresh project setup?

If we are able to get a reproduction case and this was something that was fixed somewhere in the 4.11 previews, we may be able to find where the fix was or at least get a proper report entered for the issue.

I just tried recreating the problem on both the 4.10.2 and the 4.11 preview 4 with a new project. It seems to work okay with a new project. I can reproduce the error, and get the editor to crash out while trying to load the level with the Array Out Of Bounds error, but editing my code seems to have the changes take place and allow the editor to open the project again.

Just for fun, I’m changing the build mode to Debug Game Editor to see what this does.

It’s working just fine with the Debug Game Editor build mode.

BUT It seems that if I use the Debug Game build mode (non-editor) then changes aren’t reflected unless I manually delete that file. But I guess this really isn’t an issue since that mode shouldn’t be selected anyway. But it’s good to know where to look if I come up with this problem again. I’ve had strange occurrences where various settings have changed themselves seemingly on their own.

As it wasn’t exactly confirmed; Is this issue occurring at all in 4.11 Preview 4? If so I would like to continue looking into it to find the root problem and report it. Otherwise, if the problem is only native to 4.10.2 then this wouldn’t need to be entered as 4.11 will be fixing it.

Can you clear up if this is occurring in 4.11 Preview 4 or not, Mbublitz? It would be very helpful to know.

So far I have NOT experienced this in 4.11 preview 4. I would say to go ahead and this as closed, and if I do have this problem again, I’ll open a new post with full repro information from a new project.