quickstart-unity icon indicating copy to clipboard operation
quickstart-unity copied to clipboard

Crash on iPhone 6 on iOS 12 with Realtime Database

Open sourcetreehugger opened this issue 1 year ago • 2 comments

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2021.3.32f1
  • Firebase Unity SDK version: 11.6.0
  • Source you installed the SDK: Unity package manager via tgz
  • Problematic Firebase Component: Realtime database
  • Other Firebase Components in use: None
  • Additional SDKs you are using: None
  • Platform you are using the Unity editor on: MacOS 14.0 with xCode version 15.0.1
  • Platform you are targeting: iPhone 6 iOS 12.5.7
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the issue here:

When trying to register for a value changed in the realtime database, the app crashes on the iPhone 6. This only occurs on the iPhone 6 and not on later iPhones. When the app crashes, xcode outputs a cryptic message:

0x100aa4000: .long 0xfeedfacf ; unknown opcode

Steps to reproduce:

  • Install firebase through the package manager
  • Add GoogleService-Info to the project
  • Add the script below (see following section)
  • Build the project through xCode
  • Notice the crash on iPhone 6.
  • Notice that the crash does not occur on more 'modern' iPhones, which my collegues have

I was also able to reproduce this issue in the samples project.

I also tried downgrading the firebase SDK to 10.6.0 and the issue also occured here.

Relevant Code:

public void ReadSomeValueChange()
    {
        string dataBaseUrl = "https://<yourfirebaseurl>.firebasedatabase.app/";
        Debug.Log("Before getting instance");
        var dataBase = FirebaseDatabase.GetInstance(dataBaseUrl);
        Debug.Log("Before getting reference");
        var somePath = dataBase.GetReference("/test");
        Debug.Log("Before registering to value changed");
        somePath.ValueChanged += HandleValueChanged; // APP CRASHES HERE
    }

    private void HandleValueChanged(object sender, ValueChangedEventArgs args)
    {
        // app does not reach this line
        Debug.Log("Value changed");
    }

sourcetreehugger avatar Nov 12 '23 19:11 sourcetreehugger

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Nov 12 '23 19:11 google-oss-bot

We're also experiencing similar problems with iOS 12.5.5 and iOS 12.5.7, using Firebase 11.5.

We saw two separate crashes, one from realtime database:

0 UnityFramework
threadpool-ms-io.cpp - Line 656
selector_thread(void*) (.cold.1) + 656
1 UnityFramework
firebase::FutureBackingData::~FutureBackingData() + 112
2 UnityFramework
firebase::FutureBackingData::~FutureBackingData() + 28
3 UnityFramework
firebase::ReferenceCountedFutureImpl::ReleaseFuture(firebase::FutureHandle const&) + 280
4 UnityFramework
firebase::FutureBase::Release() + 88
5 UnityFramework
firebase::ReferenceCountedFutureImpl::~ReferenceCountedFutureImpl() + 112
6 UnityFramework
firebase::ReferenceCountedFutureImpl::~ReferenceCountedFutureImpl() + 28
7 UnityFramework
firebase::ReferenceCountedFutureImpl::~ReferenceCountedFutureImpl() + 28
8 UnityFramework
firebase::FutureManager::CleanupOrphanedFutureApis(bool) + 532
9 UnityFramework
firebase::FutureManager::ReleaseFutureApi(void*) + 204
10 UnityFramework
firebase::database::internal::QueryInternal::~QueryInternal() + 72
11 UnityFramework
firebase::database::internal::DatabaseReferenceInternal::~DatabaseReferenceInternal() + 164
12 UnityFramework
firebase::database::internal::DatabaseReferenceInternal::~DatabaseReferenceInternal() + 28
13 UnityFramework
firebase::database::internal::DatabaseReferenceInternal::~DatabaseReferenceInternal() + 28
14 UnityFramework
firebase::database::Query::~Query() + 108
15 UnityFramework
firebase::database::DatabaseReference::~DatabaseReference() + 60
16 UnityFramework
firebase::database::DatabaseReference::~DatabaseReference() + 28
17 UnityFramework
firebase::database::DatabaseReference::~DatabaseReference() + 28
18 UnityFramework
Firebase_Database_CSharp_delete_InternalDatabaseReference + 96 

As well as a couple that start in different places:

0 UnityFramework
threadpool-ms-io.cpp - Line 656
selector_thread(void*) (.cold.1) + 656
1 UnityFramework
firebase::FutureBackingData::~FutureBackingData() + 112
2 UnityFramework
firebase::FutureBackingData::~FutureBackingData() + 28
3 UnityFramework
firebase::ReferenceCountedFutureImpl::ReleaseFuture(firebase::FutureHandle const&) + 280
4 UnityFramework
firebase::FutureBase::Release() + 88
5 UnityFramework
firebase::FutureBase::operator=(firebase::FutureBase&&) + 32
6 UnityFramework
firebase::ReferenceCountedFutureImpl::AllocInternal(int, void*, void (*)(void*)) + 320
7 UnityFramework
firebase::FutureHandle firebase::ReferenceCountedFutureImpl::AllocInternal<bool>(int) + 80
8 UnityFramework
firebase::SafeFutureHandle<bool> firebase::ReferenceCountedFutureImpl::SafeAlloc<bool>(int) + 48
9 UnityFramework
firebase::remote_config::internal::RemoteConfigInternal::Activate() + 48
10 UnityFramework
firebase::remote_config::RemoteConfig::Activate() + 36
11 UnityFramework
Firebase_RemoteConfig_CSharp_FirebaseRemoteConfigInternal_Activate + 136 
0 UnityFramework
threadpool-ms-io.cpp - Line 656
selector_thread(void*) (.cold.1) + 656
1 UnityFramework
firebase::callback::CallbackString::Run() + 964
2 UnityFramework
firebase::callback::CallbackEntry::Execute() + 144
3 UnityFramework
firebase::callback::CallbackDispatcher::DispatchCallbacks() + 116
4 UnityFramework
firebase::callback::PollCallbacks() + 68
5 UnityFramework
Firebase_App_CSharp_PollCallbacks + 12 

Ceikry avatar Dec 01 '23 16:12 Ceikry