[4.11 p8] html5 crashing 'randomly'

‘Randomly’ refers to me not knowing yet what exactly causes it, although it seems to be caused by the LoadGameFromSlot blueprint.

In the editor and in a packaged windows build I’m not getting any warnings, errors or crashes.

The crash I keep getting in html5 is:

Expression (Count>=0) failed in Runtime/CoreUObject/Public/UObject\UnrealType.h:2553!
Check console for details.

FScriptArrayHelper::EmptyAndAddValues(int)
UArrayProperty::SerializeItem(void*&, void*)
FPropertyTag::SerializeTaggedProperty?S(unsigned char**&)
UStruct::SerializeTaggedProperties?_(unsigned char*&, undefined?S?*)
UObject::SerializeScriptProperties(FArchive?&)
UObject::Serialize(FArchive?&)
UGameplayStatics::LoadGameFromSlot(int&)
UGameplayStatics::execLoadGameFromSlot(void*&)
UFunction::Invoke(void*&*)
UObject::CallFunction(void*&, UFunction?*)
UObject::execFinalFunction(void*&)
FFrame::Step(void**)
UObject::ProcessContextOpcode(void*&, bool)
UObject::execContext(void*&)
FFrame::Step(void**)
UObject::execLetObj(void*&)
FFrame::Step(void**)
UObject::ProcessInternal(void*&)
UObject::CallFunction(void*&, UFunction?*)
UObject::execVirtualFunction(void*&)
FFrame::Step(void**)
UObject::ProcessContextOpcode(void*&, bool)
UObject::execContext(void*&)
FFrame::Step(void**)
UObject::ProcessInternal(void*&)
UObject::CallFunction(void*&, UFunction?*)
UObject::execVirtualFunction(void*&)
FFrame::Step(void**)
UObject::ProcessInternal(void*&)
UObject::CallFunction(void*&, UFunction?*)
UObject::execVirtualFunction(void*&)
FFrame::Step(void**)
UObject::ProcessInternal(void*&)
UObject::CallFunction(void*&, UFunction?*)
UObject::execVirtualFunction(void*&)
FFrame::Step(void**)
UObject::ProcessInternal(void*&)
UObject::CallFunction(void*&, UFunction?*)
UObject::execVirtualFunction(void*&)
FFrame::Step(void**)
UObject::ProcessInternal(void*&)
UFunction::Invoke(void*&*)
UObject::ProcessEvent(void**)
UUserWidget::Construct()
UUserWidget::NativeConstruct()
UUserWidget::OnWidgetRebuilt()
UWidget::TakeWidget()
UWidgetSwitcherSlot::BuildSlot?1()
UWidgetSwitcher::RebuildWidget()
UWidget::TakeWidget()
UCanvasPanelSlot::BuildSlot?1()
UCanvasPanel::RebuildWidget()
UWidget::TakeWidget()
UUserWidget::RebuildWidget()
UWidget::TakeWidget()
UUserWidget::AddToScreen(int*)
UUserWidget::AddToPlayerScreen(int)
UUserWidget::execAddToPlayerScreen(void*&)
UFunction::Invoke(void*&*)
UObject::CallFunction(void*&, UFunction?*)
UObject::execFinalFunction(void*&)
FFrame::Step(void**)
UObject::ProcessContextOpcode(void*&, bool)
UObject::execContext(void*&)
FFrame::Step(void**)
UObject::execLetBool(void*&)
FFrame::Step(void**)
UObject::ProcessInternal(void*&)
UFunction::Invoke(void*&*)
UObject::ProcessEvent(void**)
AActor::ProcessEvent(void**)
AActor::ReceiveBeginPlay()
AActor::BeginPlay()
AWorldSettings::NotifyBeginPlay()
AGameMode::HandleMatchHasStarted()
AGameMode::SetMatchState?5()
AGameMode::StartMatch()
AGameMode::StartPlay()
UWorld::BeginPlay()
UEngine::LoadMap?F(FWorldContext?4?&)
UEngine::Browse?F(FWorldContext?4?&)
UGameInstance::StartGameInstance()
UGameEngine::Init(IEngineLoop?*)
FEngineLoop::Init()
HTML5_Init()
main()

Have you been able to reproduce this within a new project? Do you know the exact reproduction steps in order to get this to occur once again? Are the logs provided the full logs?

Thank you!

Create a 4.11p7 project (only tested it with a C++ project, but blueprint should also work).

Create a savegame.

  • add a String and a Byte[] to the savegame

Somewhere, like in the level blueprint:

  • create an instance of the savegame

  • set the string to “test”

  • set the bytes to a new byte array, with values: [184, 135, 228, 65, 61, 8, 95, 189, 29, 62, 167, 64, 152, 67, 221, 113, 185, 165, 60, 95]

  • save the savegame into a slot called “test”

  • load the savegame from the slot “test”

Export the project to html5 and open it in the browser.

While running the html5 instance of the game, the the loading of the savegame should cause a crash.

Note that the values in the byte array matter a lot. The crash doesn’t happen if I put 0, 0, 0 etc in there.

I followed your steps but did not run into a crash. Since I am not one who uses C++, I did create mine in Blueprints. I followed what you wrote down but also incorporated any steps I felt were missing through our documentation to ensure no steps were missed. Are you following the Save Game blueprint information that’s located within our [Blueprint Documentation][1] or [C++ Documentation][2]?

Are you able to reproduce this in a new project? Did you try a blueprint project, or no? Do you have a blank version of this project that you’re able to share for us to look at more closely?

By the way, I tried launching on and also packaging the project for HTML5.

Thanks!

https://docs.unrealengine.com/latest/INT/Gameplay/SaveGame/Blueprints/index.html
[2]: https://docs.unrealengine.com/latest/INT/Gameplay/SaveGame/Code/index.html

Hey

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’ve tried it again with 4.11 p8, with a C++ and a blueprint project, and I couldn’t reproduce the crash anymore.

However, my older project (which I converted to 4.11 during p3 or p4 I think), still does crash in html5 when trying to load a savegame with byte arrays in it.

You can try it out yourself, here:

Username: test

Password: (a single space)

You can off course also just register your own account, all accounts are currently only for testing purposes anyway, and they are constantly being removed.

Also note the html5 app is running on my own PC, so it might load slowly, and it could even be offline.

If would’ve rather have it be reproducible in a new ue4 application, but apparently that has been fixed, or I simply forgot how I managed to get it to crash the first time.

The app at is using 4.11 p8 by the way. I just now compiled it, tested it again, and put it online.

Anyway, about the crash in the test app. The authentication in the test app will save a password hash after logging in if the checkbox “Automatically log in?” is checked. The authentication data will then be load after logging in (to retrieve the username), and when you reload the webpage, which will both cause a crash. To fix it, clear the savegames (with the “Clear Stored Save” button) and reload the webpage.

The crash also only happens in html5. Also, the crash doesn’t happen when I don’t save the password hash in a savegame, meaning it doesn’t happen when there are no byte arrays being saved or load.

Anyway, besides that crash, some other things also seem to crash the html5 app. Press some random buttons, try using a controller, etc, perhaps you can find anything else worth noting.

Lastly, if you want the source code of the app, let me know. I’ll zip it up and send you a private message with the url for it then.

Never mind, after trying some things out in a new project, I managed to get it to crash in a new project as well.

What I did was I renamed the saveslot name to “authentication”, the savegame string variable to “Username” and the savegame byte array variable to “PasswordHash”. No idea why this does crash and why “test”, “MyString”, “MyByteArray” doesn’t, but there you go.

You can download the project here:

Blueprint project:

C++ project:

The code is in the level blueprint.

Export the project to HTML5 and run the HTML5 version of the game. The game will crash after 2 seconds (because I added a delay node of 2 seconds).

I opened your project and of course it converted to 4.11.0, from preview 8. After testing your project, I went ahead and created a new one in 4.11.0. When I pushed the project to HTML5, I actually did not run into a crash. I’m starting to wonder whether or not if the issue vanished once 4.11.0 was released.

I see that you made these projects in 4.11 preview 8. By any , did you double check the creation of your project once 4.11.0 was released?

I just tried it with 4.11.0 and the crash still occurs.

I’ve zipped the HTML5 packing output of the blueprint project linked earlier:

Some details that might matter:

I use Windows 7 x64.

I use Emscripten 1.35.0 x64.

I use Unreal Engine 4.11.0 (from the launcher, not a source compiled build).

I use Firefox 45.0.1 x64.

I host the HTML5 app with the HTML5LaunchHelper.exe.

I access the HTML5 app by going to:

About the crash:

I first get a popup that says: “Expression (Count>=0) failed in Runtime/CoreUObject/Public/UObject\UnrealType.h:2553!
Check console for details.”

Then a red div with the text:

And in the console it says this:

Thank you for your patience, we’re currently investigating the crash you’re running in to. We will post a reply once we know more!

I heard word from our Developer. Luckily, he figured out what was missing. Please follow these instructions to fix the crash you’re running in to:

  • In the file: Engine/Source/Runtime/HTML5/HTML5JS/Private/HTML5JavaScriptFx.js
  • Edit in both functions: UE_LoadGame() and UE_LoadGame()
  • Change from: Module.HEAP8.subarray
  • To: Module.HEAPU8.subarray

This issue will be corrected in a later version of the engine. Thanks!