Native Crash - Firebase 5.2.1 FCM Messaging with Unity

436 views
Skip to first unread message

Luke Boniface

unread,
Aug 30, 2018, 10:02:34 AM8/30/18
to Firebase Google Group
Hello

We have just integrated FCM for handling push notifications in our latest release. 
This has introduced a native crash that we are seeing affect 1-2% of our user base ( by checking the Google Play Console ).

- From the Google Play Console we can’t see a correlation in device model or Android version. 
- We have been unable to reproduce the issue with our Android test devices.
We are only using Firebase.Messaging

I am in contact with Firebase support directly, but unfortunately they won't move things forward without a reproducible setup - which is understandable, but it's also unlikely for us to get this to them any time soon.

Our setup :
Unity 2017.2.1p4 
Firebase Unity SDK 5.2.1 (issue also observed in 5.2.0) 

Please find attached a sample backtrace of the occurring issue, and a sample of how we are using the Firebase API.

Any help or suggestions of how to move this issue forward would be greatly appreciated.

Regards
Luke

AndroidFirebaseService.txt
backtrace1.txt

Stewart Miles

unread,
Aug 30, 2018, 1:03:03 PM8/30/18
to Firebase Google Group
Hi Luke,

Thanks for the bug report.

From what I can tell, it looks like the stack trace points at a crash from the message being passed to Unity / MonoVM from the message processing thread rather than the Unity main thread where it's supposed to occur.  In particular, the bold part of the callstack should not be happening: 

#00  pc 00000000005b8dec  /data/app/net.company.our_game_id-C_1SEdVsu0hPbyZjbqM8sw==/lib/arm/libunity.so
  #01  pc 00000000005cc0ac  /data/app/net.company.our_game_id-C_1SEdVsu0hPbyZjbqM8sw==/lib/arm/libunity.so
  #02  pc 0000000000128b0c  /data/app/net.company.our_game_id-C_1SEdVsu0hPbyZjbqM8sw==/lib/arm/libmono.so
  #03  pc 0000000000022564  /data/app/net.company.our_game_id-C_1SEdVsu0hPbyZjbqM8sw==/lib/arm/libmono.so
  #04  pc 00000000002c1b21  /data/app/net.company.our_game_id-C_1SEdVsu0hPbyZjbqM8sw==/lib/arm/libmono.so
  #05  pc 0000000000018968  /system/lib/libc.so
  #06  pc 00000000000d6a0e  /data/app/net.company.our_game_id-C_1SEdVsu0hPbyZjbqM8sw==/lib/arm/libFirebaseCppApp-5.2.1.so (firebase::messaging::ProcessMessages()+1609)
  #07  pc 00000000000d71b5  /data/app/net.company.our_game_id-C_1SEdVsu0hPbyZjbqM8sw==/lib/arm/libFirebaseCppApp-5.2.1.so (firebase::messaging::MessageProcessingThread(void*)+124)
  #08  pc 00000000000478d7  /system/lib/libc.so (__pthread_start(void*)+22)
  #09  pc 000000000001b341  /system/lib/libc.so (__start_thread+32)

Any chance you have more context for this crash?

Cheers,
Stewart


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/74eea45f-76f6-4337-acd0-c029378a6e30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

luke.b...@gmail.com

unread,
Aug 31, 2018, 10:56:51 AM8/31/18
to Firebase Google Group
Hi Stewart,

Thanks for your thoughts. As for context, unfortunately we have so far been unable to get any more info about the User's behaviour before the crash occurs. But for general usage of the API please see the AndroidFirebaseService.txt sample.
Potentially of note is that at certain points in our application we unregister and re-register to the FirebaseMessaging.TokenReceived and FirebaseMessaging.MessageReceived events.
This unregistering/registering happens in succession, and has caused some threading issues in C#, and led to us adding the “lock (FirebaseApp.DefaultInstance)” before unregistering, as seen in the sample function "Dispose()".

Thanks
Luke

Stewart Miles

unread,
Jan 25, 2019, 6:07:33 PM1/25/19
to Firebase Google Group
Followed up on https://github.com/firebase/quickstart-unity/issues/294 we should have a release out in a few days that will be more stable.

Reply all
Reply to author
Forward
0 new messages