Skip to content

Firebase Database plugin crashes when calling UpdateChildrenAsync() #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
YoavR opened this issue May 23, 2019 · 21 comments
Closed

Firebase Database plugin crashes when calling UpdateChildrenAsync() #371

YoavR opened this issue May 23, 2019 · 21 comments

Comments

@YoavR
Copy link

YoavR commented May 23, 2019

Information

Unity editor version: 2019.1.3f1
Firebase Unity SDK version: 6.0.0
Firebase plugins in use (Auth, Database, etc.): Auth, Analytics, Database, Crashlytics, Functions
Additional SDKs you are using (Facebook, AdMob, etc.): Facebook, Playfab
Platform you are using the Unity editor on (Mac, Windows, or Linux): MacOS Mohave 10.14.1
Platform you are targeting (iOS, Android, and/or desktop): Android

Issue

This happened after upgrading the Unity editor from 2017.3.1p4 and Firebase Unity SDK 5.6.1
Most (not all) times that UpdateChildrenAsync() is called, Unity Editor crashes.
I've seen this was talked about in issue #191 but there hasn't been any updates for a while and was hoping to get some response.
Important to note, as in #191 , this only happens in the Unity editor.

@YoavR YoavR added the new New issue. label May 23, 2019
@chkuang-g
Copy link
Contributor

Hi @YoavR

Thank you for the information!

Could you obtain the call stack of the crash? You should be able to find the editor log here.
https://docs.unity3d.com/Manual/LogFiles.html

Thank you,
Shawn

@chkuang-g chkuang-g added type: question and removed new New issue. labels May 24, 2019
@YoavR
Copy link
Author

YoavR commented May 26, 2019

Hi @chkuang-g, thanks for the response.

I found two suspicious places that may point to the issue: The first is right when after I trigger the call to UpdateChildrenAsync():

Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2019.1.3f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.0.0.bundle

The second is at the end of the call trace, as Unity crashes:

Receiving unhandled NULL exception
Obtained 26 stack frames.
WARNING: Auth object 0xb0f8eee0 should be deleted before the App 0xb92bf500 it depends upon.
Firebase App initializing app __FIRAPP_DEFAULT (default 1).
Thread 0x70000826c000 may have been prematurely finalized
#0 0x007fff6b371777 in std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::basic_string(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)
Thread 0x70000826c000 may have been prematurely finalized
#1 0x0000017ab232ab in firebase::database::internal::Tree::Tree(firebase::database::internal::Tree const&)
Thread 0x70000826c000 may have been prematurely finalized
#2 0x0000017ab23172 in firebase::database::internal::Operation::Operation(firebase::database::internal::Operation::Type, firebase::database::internal::OperationSource const&, firebase::Path const&, firebase::Variant const&, firebase::database::internal::CompoundWrite const&, firebase::database::internal::Tree const&, firebase::database::internal::AckStatus)
Thread 0x70000826c000 may have been prematurely finalized
#3 0x0000017ab222af in firebase::database::internal::Operation::AckUserWrite(firebase::Path const&, firebase::database::internal::Tree const&, firebase::database::internal::AckStatus)
Thread 0x70000826c000 may have been prematurely finalized
#4 0x0000017ab22b9c in firebase::database::internal::OperationForChild(firebase::database::internal::Operation const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)
Thread 0x70000826c000 may have been prematurely finalized
#5 0x0000017ab309c9 in firebase::database::internal::SyncTree::ApplyOperationDescendantsHelper(firebase::database::internal::Operation const&, firebase::database::internal::Treefirebase::database::internal::SyncPoint, firebase::Variant const, firebase::database::internal::WriteTreeRef*)
Thread 0x70000826c000 may have been prematurely finalized
#6 0x0000017ab305f1 in firebase::database::internal::SyncTree::ApplyOperationHelper(firebase::database::internal::Operation const&, firebase::database::internal::Treefirebase::database::internal::SyncPoint, firebase::Variant const, firebase::database::internal::WriteTreeRef*)
Thread 0x70000826c000 may have been prematurely finalized
#7 0x0000017ab30691 in firebase::database::internal::SyncTree::ApplyOperationHelper(firebase::database::internal::Operation const&, firebase::database::internal::Treefirebase::database::internal::SyncPoint, firebase::Variant const, firebase::database::internal::WriteTreeRef*)
Thread 0x70000826c000 may have been prematurely finalized
#8 0x0000017ab30691 in firebase::database::internal::SyncTree::ApplyOperationHelper(firebase::database::internal::Operation const&, firebase::database::internal::Treefirebase::database::internal::SyncPoint, firebase::Variant const, firebase::database::internal::WriteTreeRef*)
Thread 0x70000826c000 may have been prematurely finalized
#9 0x0000017ab3043f in firebase::database::internal::SyncTree::ApplyOperationToSyncPoints(firebase::database::internal::Operation const&)
Thread 0x70000826c000 may have been prematurely finalized
#10 0x0000017ab31cf7 in std::__1::__function::__func<firebase::database::internal::SyncTree::AckUserWrite(long long, firebase::database::internal::AckStatus, firebase::database::internal::Persist)::$_0, std::__1::allocator<firebase::database::internal::SyncTree::AckUserWrite(long long, firebase::database::internal::AckStatus, firebase::database::internal::Persist)::$_0>, bool ()>::operator()()
Thread 0x70000826c000 may have been prematurely finalized
#11 0x0000017ab30138 in firebase::database::internal::PersistenceManager::RunInTransaction(std::__1::function<bool ()>)
Thread 0x70000826c000 may have been prematurely finalized
#12 0x0000017ab300a0 in firebase::database::internal::SyncTree::AckUserWrite(long long, firebase::database::internal::AckStatus, firebase::database::internal::Persist)
Thread 0x70000826c000 may have been prematurely finalized
#13 0x0000017ab252ec in firebase::database::internal::Repo::AckWriteAndRerunTransactions(long long, firebase::Path const&, firebase::database::Error)
Thread 0x70000826c000 may have been prematurely finalized
#14 0x0000017ab29bd3 in firebase::database::internal::Repo::UpdateChildren(firebase::Path const&, firebase::Variant const&, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle)::$_8::__invoke(firebase::SharedPtrfirebase::database::internal::connection::Response const&)
Thread 0x70000826c000 may have been prematurely finalized
#15 0x0000017ab19189 in firebase::database::internal::connection::PersistentConnection::HandlePutResponse(firebase::Variant const&, firebase::SharedPtrfirebase::database::internal::connection::Response const&, unsigned long long)
Thread 0x70000826c000 may have been prematurely finalized
#16 0x0000017ab15823 in firebase::database::internal::connection::PersistentConnection::OnDataMessage(firebase::Variant const&)
Thread 0x70000826c000 may have been prematurely finalized
#17 0x0000017ab113cd in firebase::database::internal::connection::Connection::ProcessMessage(char const*)
Thread 0x70000826c000 may have been prematurely finalized
#18 0x0000017ab122eb in firebase::database::internal::connection::Connection::OnMessage(char const*)::$_2::__invoke(firebase::internal::SafeReferencefirebase::database::internal::connection::Connection, char const*)
Thread 0x70000826c000 may have been prematurely finalized
#19 0x0000017ab128e1 in firebase::callback::CallbackValue1String1<firebase::internal::SafeReferencefirebase::database::internal::connection::Connection >::Run()
Thread 0x70000826c000 may have been prematurely finalized
#20 0x0000017acb5396 in firebase::scheduler::Scheduler::TriggerCallback(firebase::SharedPtrfirebase::scheduler::Scheduler::RequestData const&)
Thread 0x70000826c000 may have been prematurely finalized
#21 0x0000017acb4e6a in firebase::scheduler::Scheduler::WorkerThreadRoutine(void*)
Thread 0x70000826c000 may have been prematurely finalized
#22 0x0000017acb5eb4 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct >, void ()(void), void*> >(void*)
Thread 0x70000826c000 may have been prematurely finalized
#23 0x007fff6de92339 in _pthread_body
Thread 0x70000826c000 may have been prematurely finalized
#24 0x007fff6de952a7 in _pthread_start
Thread 0x70000826c000 may have been prematurely finalized
#25 0x007fff6de91445 in thread_start
Launching bug reporter

Thanks!

@alexames
Copy link

It looks like you've enabled the C++ implementation of RTDB for desktop, which is not yet supported. We have plans to officially enable this in the future but as you can see it's not quite there yet. For now, I recommend sticking with the Mono implementation we have enabled by default.

@madgreg99
Copy link

I have the same issue, I use Unity Editor 2018.3.10f1 and it crashes when I use UpdateChildrenAsync. How do you switch implementation from C++ to mono?

@stewartmiles
Copy link
Contributor

@madgreg99 by default when you import the plugin the Mono implementation is enabled. So reimport the database plugin to revert to the intended settings.

@madgreg99
Copy link

@stewartmiles thanks for the answer, I switched back to Mono but this implementation keep throwing this error: "PM [Error] WebSocket: ws_0 - could not connect"
So connection to RTDB in my app doesn't work anymore :(

@stewartmiles
Copy link
Contributor

@madgreg99 yes in some cases we've seen issues with Unity's network stack in some version so check the known issues on https://firebase.google.com/docs/unity/setup#known_issues

Also, some corporate networks like to block websockets which may be causing your problems.

@madgreg99
Copy link

@stewartmiles I'm at home without VPN and I tried also using connection of my phone, same error. I don't see any work around in your known issues. The only work around I see is this one: #106 (comment)
But then it crashes on UpdateChildrenAsync...
So I'm wondering, is there a stable version that works in the Unity Editor? I'm using firebase 6.1.1

@alexames
Copy link

alexames commented Jul 3, 2019

This should be fixed as of the latest release, 6.2.0

@alexames alexames closed this as completed Jul 3, 2019
@QuentinGprd
Copy link

UpdateChildrenAsync() still not working in the Editor with Firebase SDK v6.2.0

Information
Unity editor version: 2018.3.14f1
Firebase Unity SDK version: 6.2.0
Firebase plugins in use (Auth, Database, etc.): Auth, Analytics, Database, Crashlytics, Messaging
Platform you are using the Unity editor on (Mac, Windows, or Linux): MacOS Mojave 10.14.5
Platform you are targeting (iOS, Android, and/or desktop): iOS, Android

Issue
UpdateChildrenAsync() is called, values are updated in the database, then Unity Editor crashes.

@alexames alexames reopened this Jul 11, 2019
@alexames
Copy link

Hi QuentinGprd, can you post a call stack of the crash? And logs too.

Can you reproduce this issue in the quickstart testapp?

@QuentinGprd
Copy link

QuentinGprd commented Jul 11, 2019

I tried to reproduce the problem in the quickstart testapp, UpdateChildrenAsync() worked without issues.

From my project, here is the Editor.log at the moment of the crash:

Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/Frameworks/Mono/lib/libAssets/Plugins/x86_64/Firebase/FirebaseCppApp-6.2.0.bundle
Receiving unhandled NULL exception
Obtained 28 stack frames.
INFO: Firebase App initializing app __FIRAPP_DEFAULT (default 1).
cameraDeviceStartCameraSuccessfully created Target Finder.cameraDeviceStartCameraINFO: Firebase App initializing app __FIRAPP_DEFAULT (default 1).
cameraDeviceStartCameraSuccessfully created Target Finder.cameraDeviceStartCameraThread 0x700016c8e000 may have been prematurely finalized
#0  0x007fff6afc25b7 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Thread 0x700016c8e000 may have been prematurely finalized
#1  0x000001575b565b in firebase::database::internal::Tree<bool>::Tree(firebase::database::internal::Tree<bool> const&)
Thread 0x700016c8e000 may have been prematurely finalized
#2  0x000001575b5512 in firebase::database::internal::Operation::Operation(firebase::database::internal::Operation::Type, firebase::database::internal::OperationSource const&, firebase::Path const&, firebase::Variant const&, firebase::database::internal::CompoundWrite const&, firebase::database::internal::Tree<bool> const&, firebase::database::internal::AckStatus)
Thread 0x700016c8e000 may have been prematurely finalized
#3  0x000001575b46df in firebase::database::internal::Operation::AckUserWrite(firebase::Path const&, firebase::database::internal::Tree<bool> const&, firebase::database::internal::AckStatus)
Thread 0x700016c8e000 may have been prematurely finalized
#4  0x000001575b4f66 in firebase::database::internal::OperationForChild(firebase::database::internal::Operation const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Thread 0x700016c8e000 may have been prematurely finalized
#5  0x000001575c3d63 in firebase::database::internal::SyncTree::ApplyOperationDescendantsHelper(firebase::database::internal::Operation const&, firebase::database::internal::Tree<firebase::database::internal::SyncPoint>*, firebase::Variant const*, firebase::database::internal::WriteTreeRef*)
Thread 0x700016c8e000 may have been prematurely finalized
#6  0x000001575c399c in firebase::database::internal::SyncTree::ApplyOperationHelper(firebase::database::internal::Operation const&, firebase::database::internal::Tree<firebase::database::internal::SyncPoint>*, firebase::Variant const*, firebase::database::internal::WriteTreeRef*)
Thread 0x700016c8e000 may have been prematurely finalized
#7  0x000001575c3a3c in firebase::database::internal::SyncTree::ApplyOperationHelper(firebase::database::internal::Operation const&, firebase::database::internal::Tree<firebase::database::internal::SyncPoint>*, firebase::Variant const*, firebase::database::internal::WriteTreeRef*)
Thread 0x700016c8e000 may have been prematurely finalized
#8  0x000001575c3a3c in firebase::database::internal::SyncTree::ApplyOperationHelper(firebase::database::internal::Operation const&, firebase::database::internal::Tree<firebase::database::internal::SyncPoint>*, firebase::Variant const*, firebase::database::internal::WriteTreeRef*)
Thread 0x700016c8e000 may have been prematurely finalized
#9  0x000001575c3a3c in firebase::database::internal::SyncTree::ApplyOperationHelper(firebase::database::internal::Operation const&, firebase::database::internal::Tree<firebase::database::internal::SyncPoint>*, firebase::Variant const*, firebase::database::internal::WriteTreeRef*)
Thread 0x700016c8e000 may have been prematurely finalized
#10 0x000001575c3a3c in firebase::database::internal::SyncTree::ApplyOperationHelper(firebase::database::internal::Operation const&, firebase::database::internal::Tree<firebase::database::internal::SyncPoint>*, firebase::Variant const*, firebase::database::internal::WriteTreeRef*)
Thread 0x700016c8e000 may have been prematurely finalized
#11 0x000001575c382b in firebase::database::internal::SyncTree::ApplyOperationToSyncPoints(firebase::database::internal::Operation const&)
Thread 0x700016c8e000 may have been prematurely finalized
#12 0x000001575c5096 in std::__1::__function::__func<firebase::database::internal::SyncTree::AckUserWrite(long long, firebase::database::internal::AckStatus, firebase::database::internal::Persist, long long)::$_0, std::__1::allocator<firebase::database::internal::SyncTree::AckUserWrite(long long, firebase::database::internal::AckStatus, firebase::database::internal::Persist, long long)::$_0>, bool ()>::operator()()
Thread 0x700016c8e000 may have been prematurely finalized
#13 0x000001575c3524 in firebase::database::internal::PersistenceManager::RunInTransaction(std::__1::function<bool ()>)
Thread 0x700016c8e000 may have been prematurely finalized
#14 0x000001575c348c in firebase::database::internal::SyncTree::AckUserWrite(long long, firebase::database::internal::AckStatus, firebase::database::internal::Persist, long long)
Thread 0x700016c8e000 may have been prematurely finalized
#15 0x000001575b7c24 in firebase::database::internal::Repo::AckWriteAndRerunTransactions(long long, firebase::Path const&, firebase::database::Error)
Thread 0x700016c8e000 may have been prematurely finalized
#16 0x000001575bd2f7 in firebase::database::internal::Repo::UpdateChildren(firebase::Path const&, firebase::Variant const&, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle<void>)::$_8::__invoke(firebase::SharedPtr<firebase::database::internal::connection::Response> const&)
Thread 0x700016c8e000 may have been prematurely finalized
#17 0x000001575aa989 in firebase::database::internal::connection::PersistentConnection::HandlePutResponse(firebase::Variant const&, firebase::SharedPtr<firebase::database::internal::connection::Response> const&, unsigned long long)
Thread 0x700016c8e000 may have been prematurely finalized
#18 0x000001575a7023 in firebase::database::internal::connection::PersistentConnection::OnDataMessage(firebase::Variant const&)
Thread 0x700016c8e000 may have been prematurely finalized
#19 0x000001575a294d in firebase::database::internal::connection::Connection::ProcessMessage(char const*)
Thread 0x700016c8e000 may have been prematurely finalized
#20 0x000001575a38db in firebase::database::internal::connection::Connection::OnMessage(char const*)::$_2::__invoke(firebase::internal::SafeReference<firebase::database::internal::connection::Connection>, char const*)
Thread 0x700016c8e000 may have been prematurely finalized
#21 0x000001575a3da1 in firebase::callback::CallbackValue1String1<firebase::internal::SafeReference<firebase::database::internal::connection::Connection> >::Run()
Thread 0x700016c8e000 may have been prematurely finalized
#22 0x0000015778f95a in firebase::scheduler::Scheduler::TriggerCallback(firebase::SharedPtr<firebase::scheduler::Scheduler::RequestData> const&)
Thread 0x700016c8e000 may have been prematurely finalized
#23 0x0000015778f62a in firebase::scheduler::Scheduler::WorkerThreadRoutine(void*)
Thread 0x700016c8e000 may have been prematurely finalized
#24 0x00000157790338 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(void*), void*> >(void*)
Thread 0x700016c8e000 may have been prematurely finalized
#25 0x007fff6df892eb in _pthread_body
Thread 0x700016c8e000 may have been prematurely finalized
#26 0x007fff6df8c249 in _pthread_start
Thread 0x700016c8e000 may have been prematurely finalized
#27 0x007fff6df8840d in thread_start
Launching bug reporter
[Performance] CurlRequestCheck                        :        4 samples, Peak.   134 ms (4.0x), Avg.  33.4 ms, Total. 133.7 ms (0.1%)
[Performance] PackageManager::RunRequestSynchronously :        4 samples, Peak.  28.3 ms (4.0x), Avg.  7.10 ms, Total. 28.40 ms (0.0%)
[Performance] ApplicationTickTimer                    :     4227 samples, Peak.  9.46 s (908.6x), Avg.  10.4 ms, Total. 44.02 s (32.8%)
[Performance] License.Tick                            :     1089 samples, Peak.  47.1 us (59.8x), Avg.   787 ns, Total. 856.9 us (0.0%)
[Performance] VCProvider                              :     4228 samples, Peak.  51.0 us (38.6x), Avg.  1.32 us, Total. 5.589 ms (0.0%)
[Performance] MonoCompiler.Tick                       :      164 samples, Peak.  2.16 ms (56.9x), Avg.  37.9 us, Total. 6.219 ms (0.0%)
[Performance] Internal_SwitchSkin                     :     4228 samples, Peak.  7.99 us (63.8x), Avg.   125 ns, Total. 528.9 us (0.0%)
[Performance] UnityConnect.Tick                       :      545 samples, Peak.   203 ms (539.8x), Avg.   375 us, Total. 204.5 ms (0.2%)
[Performance] HubClient.CheckCurlRequests             :        3 samples, Peak.   341 us (2.7x), Avg.   125 us, Total. 374.1 us (0.0%)
[Performance] UnityConnect.PollInfo                   :       12 samples, Peak.  42.1 us (3.5x), Avg.  12.1 us, Total. 145.2 us (0.0%)
[Performance] Collab.Tick                             :      545 samples, Peak.  1.08 ms (261.8x), Avg.  4.13 us, Total. 2.251 ms (0.0%)
[Performance] WebView.Tick                            :     1088 samples, Peak.   158 ms (379.1x), Avg.   416 us, Total. 452.9 ms (0.3%)
[Performance] CurlRequest.Tick                        :      301 samples, Peak.  27.3 ms (292.6x), Avg.  93.2 us, Total. 28.05 ms (0.0%)
[Performance] WebSocketClient.Tick                    :      301 samples, Peak.  2.36 ms (75.0x), Avg.  31.5 us, Total. 9.477 ms (0.0%)
[Performance] SceneBackgroundTask.Tick                :      212 samples, Peak.  2.98 us (7.2x), Avg.   414 ns, Total. 87.74 us (0.0%)
[Performance] Scheduler.Tick                          :     1805 samples, Peak.  9.19 ms (290.2x), Avg.  31.7 us, Total. 57.15 ms (0.0%)
[Performance] RepaintAllProfilerWindows               :       72 samples, Peak.  8.47 ms (61.1x), Avg.   139 us, Total. 9.975 ms (0.0%)
[Performance] PlayerUpdates.Tick                      :      545 samples, Peak.   171 us (8.7x), Avg.  19.7 us, Total. 10.75 ms (0.0%)
[Performance] GlobalCallbacks                         :     4228 samples, Peak.  91.0 ms (1007.4x), Avg.  90.3 us, Total. 381.8 ms (0.3%)
[Performance] EditorAnalytics.Tick                    :      137 samples, Peak.   194 us (42.6x), Avg.  4.56 us, Total. 624.2 us (0.0%)
[Performance] GI.Tick                                 :      346 samples, Peak.  91.0 ms (95.7x), Avg.   951 us, Total. 329.0 ms (0.2%)
[Performance] Video.Update                            :     4228 samples, Peak.  52.0 us (41.3x), Avg.  1.26 us, Total. 5.316 ms (0.0%)
[Performance] UnitySynchronization.ExecuteTasks       :      358 samples, Peak.  1.30 ms (124.6x), Avg.  10.4 us, Total. 3.725 ms (0.0%)
[Performance] PreloadManager                          :     3617 samples, Peak.   109 us (9.5x), Avg.  11.5 us, Total. 41.57 ms (0.0%)
[Performance] SceneTracker                            :     4228 samples, Peak.  8.69 s (2498.4x), Avg.  3.48 ms, Total. 14.70 s (11.0%)
[Performance] ConsoleLog.Tick                         :      164 samples, Peak.   258 us (24.0x), Avg.  10.8 us, Total. 1.766 ms (0.0%)
[Performance] HierarchyWindow.Tick                    :      204 samples, Peak.  3.34 ms (66.6x), Avg.  50.1 us, Total. 10.22 ms (0.0%)
[Performance] Inspector.Tick                          :      204 samples, Peak.  1.58 ms (3.9x), Avg.   407 us, Total. 83.01 ms (0.1%)
[Performance] Tooltip.Tick                            :      530 samples, Peak.  16.2 ms (63.5x), Avg.   255 us, Total. 135.3 ms (0.1%)
[Performance] RequestRepaintForPanels                 :     4215 samples, Peak.   454 us (88.1x), Avg.  5.15 us, Total. 21.73 ms (0.0%)
[Performance] UpdateSceneIfNeeded                     :     4214 samples, Peak.   908 ms (296.9x), Avg.  3.06 ms, Total. 12.88 s (9.6%)
[Performance] ConsoleWindow.OnGUI                     :      126 samples, Peak.  41.7 ms (40.0x), Avg.  1.04 ms, Total. 131.5 ms (0.1%)
[Performance] SceneView.OnGUI                         :      378 samples, Peak.   139 ms (103.7x), Avg.  1.34 ms, Total. 506.2 ms (0.4%)
[Performance] InspectorWindow.OnGUI                   :      272 samples, Peak.   698 ms (157.4x), Avg.  4.43 ms, Total. 1.206 s (0.9%)
[Performance] SceneHierarchyWindow.OnGUI              :      132 samples, Peak.  28.8 ms (22.7x), Avg.  1.27 ms, Total. 167.7 ms (0.1%)
[Performance] UpdateVideoTextures                     :     3604 samples, Peak.  5.01 us (13.7x), Avg.   366 ns, Total. 1.318 ms (0.0%)
[Performance] PackageImporter.Tick                    :      163 samples, Peak.  4.05 us (14.7x), Avg.   275 ns, Total. 44.82 us (0.0%)
[Performance] InspectorBackground.Tick                :      208 samples, Peak.  3.10 us (2.9x), Avg.  1.06 us, Total. 219.9 us (0.0%)
[Performance] ChangeLayoutIfNeeded                    :     4227 samples, Peak.  7.99 us (64.6x), Avg.   124 ns, Total. 522.7 us (0.0%)
[Performance] AsyncReadManager.ForceCloseFiles        :       41 samples, Peak.  88.0 us (6.4x), Avg.  13.8 us, Total. 564.3 us (0.0%)
[Performance] GameView.OnGUI                          :     1228 samples, Peak.  54.9 ms (88.1x), Avg.   622 us, Total. 764.3 ms (0.6%)
[Performance] InactiveGI.Tick                         :        5 samples, Peak.   637 us (1.1x), Avg.   566 us, Total. 2.829 ms (0.0%)
[Performance] RepaintAll                              :       13 samples, Peak.  3.89 ms (13.0x), Avg.   300 us, Total. 3.899 ms (0.0%)
Assertion failed on expression: 'Thread::EqualsCurrentThreadID(Thread::mainThreadId)'
 
(Filename: /Users/builduser/buildslave/unity/build/Editor/Src/SceneInspector.cpp Line: 532)

Assertion failed on expression: 'Thread::EqualsCurrentThreadID(Thread::mainThreadId)'
 
(Filename: /Users/builduser/buildslave/unity/build/Editor/Src/SceneInspector.cpp Line: 532)

Cancelling DisplayDialog because it was run from a thread that is not the main thread: Scene(s) Have Been Modified Do you want to save the changes you made in the scenes:
 Assets/Scenes/master-scene.unity

Your changes will be lost if you don't save them.

 
(Filename: /Users/builduser/buildslave/unity/build/Editor/Platform/OSX/EditorUtility.mm Line: 335)

[Unity Package Manager (Upm)]
Parent process [1437] was terminated

Let me know if you need anything else.

@MiguelGutierrez-PG
Copy link

We are having the same issue with UpdateChildrenAsync(). We were able to reproduce it in the quickstart testapp database.

It happens when UpdateChildrenAsync() is used in a node that have an eventListener (using the method ValueChanged) in the same or below hierarchy level.

So here we attach the modified UIHandler script that triggers the error.
To reproduce the error push the "Update Test" button. It works in the device but makes the editor crash.

By the way, another issue we found is when you push the button "SetValue Test", the event handler of the method ValueChanged is called twice when the parameter passed in is: "ServerValue.TimeStamp", also this happens in Android Device. Is this the expected behaviour or a bug?

UIHandler.zip

@alexames
Copy link

Hi all, I've been able to reproduce the issue and will have a fix shortly. Sorry for the trouble.

@craNich
Copy link

craNich commented Jul 24, 2019

I have same issues. When we can expect the fix?

@alexames
Copy link

Hi everyone, this issue is fixed in the most recent release, v6.2.2. Give that a try and let me know if you still experience issues.

@craNich
Copy link

craNich commented Jul 29, 2019

Hello. I just installed it and it still didnt fix the issue for me.
I have similar issue with update and listener. I am getting an error while I am updating two different paths with listener attached to one of this path. When I make two updates with each updating just one path, everything works fine.
The error is actualy on the listener:
System.NullReferenceException: Object reference not set to an instance of an object.

@craNich
Copy link

craNich commented Jul 29, 2019

Ok. This update actualy gave me another issue with listener. After the update of firebase one of the listeners I have in my app is called twice doing same operation twice in same time which leads to duplication of some things. Very very strange. Changed to previous version with same code = no issues with that. Of course I can fix it with some checking if its been already processed, but ...
I think there is something wrong with listeners overall. No update included here. Just Pushing a new record, then listening for an event - called twice for no reason I think. At least in previous version it was called just once.

@PabloArd
Copy link

Hello, with v.6.6.2, crash of UpdateChildrenAsync is gone, but now I'm experimenting more errors:
-When a Listener of ChildAdded or ChildChanged is called on Android, it is called twice.
-Also, I experienced a strange behaviour in Editor:
After receiving ChildAdded, that works fine, if in the same route is called ChildChanged(but modified from an Android device only), the Listener it is not being called on Editor.
But if I do the same process only on Editor it works fine both Listeners(ChildAdded and ChildChanged).
Thanks in advance.

@kreys
Copy link

kreys commented Sep 19, 2019

Hello,
we're still experiencing this issue, both on Firebase 6.4.0 and Firebase 6.5.0 (Unity 2019.2.3f1).

On editor on windows it is crashing after UpdateChildrenAsync method:

0x00007FFACA0B0584 (FirebaseCppApp-6_4_0) SWIGRegisterStringCallback_StorageInternal
0x00007FFACA0A461E (FirebaseCppApp-6_4_0) SWIGRegisterStringCallback_StorageInternal
0x00007FFACA0DBAB2 (FirebaseCppApp-6_4_0) Firebase_DynamicLinks_CSharp_DynamicLinkGetMatchStrength
0x00007FFACA0B5E74 (FirebaseCppApp-6_4_0) SWIGRegisterStringCallback_StorageInternal
0x00007FFACA0B63C0 (FirebaseCppApp-6_4_0) SWIGRegisterStringCallback_StorageInternal
0x00007FFACA0AF5C7 (FirebaseCppApp-6_4_0) SWIGRegisterStringCallback_StorageInternal
0x00007FFACA0AF6E7 (FirebaseCppApp-6_4_0) SWIGRegisterStringCallback_StorageInternal
0x00007FFACA0B60DE (FirebaseCppApp-6_4_0) SWIGRegisterStringCallback_StorageInternal
0x00007FFAC9FD34CF (FirebaseCppApp-6_4_0) SWIGRegisterStringCallback_StorageInternal
0x00007FFAC9F8DAD9 (FirebaseCppApp-6_4_0) SWIGRegisterStringCallback_StorageInternal
0x00007FFACA159A41 (FirebaseCppApp-6_4_0) Firebase_App_CSharp_InitializePlayServicesInternal
0x00007FFB308B7BD4 (KERNEL32) BaseThreadInitThunk
0x00007FFB30E2CEE1 (ntdll) RtlUserThreadStart

On editor on mac os it is crashing even earlier on database init:

Obtained 16 stack frames.
#0  0x0000016321cbcd in firebase::database::internal::DatabaseInternal::~DatabaseInternal()
#1  0x0000016323d52e in firebase::database::Database::DeleteInternal()
#2  0x0000016323d44b in firebase::database::Database::~Database()
#3  0x000001631eab93 in firebase::CppInstanceManager<firebase::database::Database>::ReleaseReference(firebase::database::Database*)
#4  0x0000016c7e7b5b in  (wrapper managed-to-native) Firebase.Database.Internal.DatabaseInternalPINVOKE:InternalFirebaseDatabase_ReleaseReferenceInternal (System.Runtime.InteropServices.HandleRef) {0x7faecffee838} + 0x11b (0x16c7e7a40 0x16c7e7c65) [0x165d31c80 - Unity Child Domain]
#5  0x0000016c7e722e in  Firebase.Database.FirebaseDatabase:Dispose () {0x7faeafae7738} + 0x3ae (0x16c7e6e80 0x16c7e72fb) [0x165d31c80 - Unity Child Domain]
#6  0x0000016c7e6de3 in  Firebase.Database.FirebaseDatabase:Finalize () {0x7faeafae76e8} + 0x73 (0x16c7e6d70 0x16c7e6e68) [0x165d31c80 - Unity Child Domain]
#7  0x0000016a2a920c in  (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) {0x7faecf43d2d0} + 0x16c (0x16a2a90a0 0x16a2a9415) [0x165d31c80 - Unity Child Domain]
#8  0x0000013f77e363 in mono_gc_run_finalize
#9  0x0000013f77ffa9 in finalizer_thread
#10 0x0000013f746b1b in start_wrapper
#11 0x0000013f7ba9f2 in GC_inner_start_routine
#12 0x0000013f7ba987 in GC_start_routine
#13 0x007fff68a642eb in _pthread_body
#14 0x007fff68a67249 in _pthread_start
#15 0x007fff68a6340d in thread_start
Launching bug reporter

We're also using Analytics, Auth, InstanceId, Messaging and RemoteConfig.

@alexames
Should I create a new issue with this one?

@chkuang-g
Copy link
Contributor

chkuang-g commented Oct 5, 2019

Hi folks,

Sorry the closed issue usually would be out of our support radar. If it is a different issue to the original post, please create a new thread.

@craNich Could you detail your issue in a new thread?

@PabloArd and @kreys We did fix a couple of Database editor related bugs in 6.6.0.
https://firebase.google.com/support/release-notes/unity#version_660_-_september_25_2019

Please try to upgrade to 6.6.0 and see if your issue is resolved. If not, please file another issue and file out the template.

Thank you,
Shawn

@firebase firebase locked and limited conversation to collaborators Oct 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants