[Crash] Reading from or writing to config in 4.8.3

Since updating to 4.8.3 the editor has been crashing when I try to show my plugin’s UI. Specifically, two of the fields in the UI load some data from a config file and display it. If there’s any changes, they write that data back out.

So when I load up the UI is hidden. At this point another bit of code which needs that data successfully loads the data from the config file.

When I try to show the UI however, it tries to the config file again and crashes in ConfigCacheIni.cpp on line 1656.

First-chance exception at 0x000007FEDE99CE50 (UE4Editor-Core.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

That line is:

FRemoteConfig::Get()->FinishRead(*Filename); // Ensure the remote file has been loaded and processed

At first I thought that the config file I was using was starting to get massive (around 260k) so I switched to a smaller one and pre-populated it with my settings, but nothing changed from the above outcome.

The code leading in to that…

FString Password;    bool Success;
Success = GConfig->GetString(TEXT("MYTHING"), TEXT("MyThingPassword"), Password, IniFile);
if (Success) return Password;

The file exists, the content is there, the earlier config file works, etc.

I thought one of the functions of GConfig->GetString() was that it was cached in memory, so you could keep calling it and not worry about building your own cache? Could multiple reads of the file be the problem?

Update: if I comment out the config write it stops crashing, but trying to write to the file also crashes. Getting frustrating.

Hey -

There are a couple questions that will help me understand your issue better. Is this crash happening when you open the project or when you do something specifically inside the editor. Also, could you post the callstack and the log files from the crash as well?

The crash happens when I try to write to or from the config file using the delegates associated with the plugin UI. It doesn’t seem to crash when reading from the config file in a process not directly associated with the UI. These functions were previously all working.

If I comment out the GetString line in the example above, the crash goes away.

Here’s the call stack:

link text

And the log:

link text

I’ve done a bit of search-and-replace to block out what I’m actually working on with the text “MyThing” so if stuff looks a little weird, that’s why.

So I’ve poked around, refactored things and quadruple checked that I’m not doing anything too dumb. I did find an infinite loop, but even with that resolved it still has problems and still traces back to the same line in the engine.

Is anyone else experiencing this?

Hey -

Are you able to reproduce this in a new project that you could send to us or provide steps to follow so I can attempt to setup a UI in the same way? If this doesn’t reproduce in a new project could you send your project for us to investigate. If you’re able to upload either project to dropbox you can send me a private message on the forums with a link to download the project.

Cheers

Can do, I’ll sort something out on Monday. Thanks! :slight_smile:

Hello , have you had a chance to put together a repro case as of yet?

Nope, lemme sanitize it and send something now. 20 minutes.

That sounds great. You can either upload it here or to a third party website and provide a link. If you would prefer it to remain private, you can send the link to me in a private message on the forums. Here is a link to my [profile][1].

Done, thanks!

Hi , has passed your query onto me to look into.

It seems that the config system is not being used correctly. In your case it looks like IniFile isnt loaded and that is what is causing your issue. From looking at your project you are expecting the Editor.ini file to live inside a UE4/Engine/Saved/Windows folder, and that does not and will not exist. The reason the editor is continuing to try and the ini is because it is missing.

I recommend that you use the file GEditorIni instead of using your own path or even GEditorSettingsIni. E.g.

GConfig->GetString(TEXT("TEST"), TEXT("Test2"), Name, GEditorIni);

These will have been cached by the ini system at startup.

Hope this helps.

/

Edit: Changed the line of code a bit

Gotcha, thanks! Can you please modify your comment and delete the line of code you just pasted though?

Hi ,

I edited out the specifics in it, but kept the structure there for reference. Is that good enough? If not, let me know and I’ll remove the whole thing.

Perfect :slight_smile: