PushkinStudio / AppCenter-SDK-UE4

Development repository for the App Center SDK for Unreal Engine 4 platforms
MIT License
13 stars 8 forks source link

Crash module disabled since 4.26+ #20

Open nucleiis opened 2 years ago

nucleiis commented 2 years ago

Hi everyone,

We are trying to re-enable crash module on UE4 4.26~4.27 but it crashes right after calling [MSACAppCenter start ..] at AppCenter_IOS.cpp #212,

[MSACAppCenter start : AppSecret
    withServices : AppCenterModules];

Any idea regarding crash module on 4.26+?

Best regards, UJ

dorgonman commented 2 years ago

I had same issue, after dig into it, and finally find out how to enable the Plugin with crash report.

I test it in 4.27.1 with sdk version 4.3.0

  1. The crash is actually happen inside sqlite when calling sqlite3GlobalConfig.m.xMalloc(nFull), which means the pointer function to memory allocator is invalidate. And you will find callstack located in Engine\Plugins\Runtime\Database\SQLiteCore\Source\SQLiteCore\Private\sqlite\sqlite3.inl.

So we will need move MSACAppCenter start function into FAppCenterModule::StartupModule, and add SQLiteCore as plugin dependency, so SQLiteCore Module has chance to do some initialization(ex: setup unreal's malloc function) for SQLite before MSACAppCenter start.

  1. After that, the crash is fixed, but you will find out AppCenter SDK emit message like this:
ERROR: +[MSACDBStorage executeQuery:inOpenedDatabase:withValues:usingBlock:]/355 Failed to finalize SQLite statement, result=10
disk I/O error

It seems there has some disk writing issues when using unrael's FMemory::Malloc, so you can try to disable it in UBT, by setting bCompileCustomSQLitePlatform to false, so sqlite will use default function without any errors, and AppCenter sdk will start to works.