firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
837 stars 433 forks source link

Crash on iPhone 6 on iOS 12 with Realtime Database #1360

Open sourcetreehugger opened 1 year ago

sourcetreehugger commented 1 year ago

[REQUIRED] Please fill in the following fields:

[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:

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");
    }
google-oss-bot commented 1 year ago

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

Ceikry commented 12 months ago

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