Skip to content
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

ANR com.google.firebase.iid.FirebaseInstanceIdReceiver #15

Closed
belrvn opened this issue Mar 9, 2021 · 6 comments
Closed

ANR com.google.firebase.iid.FirebaseInstanceIdReceiver #15

belrvn opened this issue Mar 9, 2021 · 6 comments

Comments

@belrvn
Copy link

belrvn commented Mar 9, 2021

We are seeing a lot of ANRs :

#00 pc 000000000013e5a6 /system/lib/libart.so (art::DexFile::FindClassDef(art::dex::TypeIndex) const+33)
#00 pc 0000000000150aad /system/lib/libart.so (art::DexFileVerifier::CheckInterClassDefItem()+964)
#00 pc 0000000000151bc3 /system/lib/libart.so (art::DexFileVerifier::CheckInterSectionIterate(unsigned int, unsigned int, art::DexFile::MapItemType)+366)
#00 pc 000000000014a611 /system/lib/libart.so (art::DexFileVerifier::Verify()+132)
#00 pc 000000000014a4a1 /system/lib/libart.so (art::DexFileVerifier::Verify(art::DexFile const*, unsigned char const*, unsigned int, char const*, bool, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>)+120)
#00 pc 000000000013d871 /system/lib/libart.so (art::DexFile::OpenOneDexFileFromZip(art::ZipArchive const&, char const
, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, bool, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, art::DexFile::ZipOpenErrorCode)+616)
#00 pc 000000000013d38d /system/lib/libart.so (art::DexFile::OpenAllDexFilesFromZip(art::ZipArchive const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, bool, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, std::__1::vector<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const>>, std::__1::allocator<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const>>>>)+440)
#00 pc 000000000013cfdd /system/lib/libart.so (art::DexFile::OpenZip(int, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, bool, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, std::__1::vector<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const>>, std::__1::allocator<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const>>>>)+276)
#00 pc 000000000013cda9 /system/lib/libart.so (art::DexFile::Open(char const*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, bool, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, std::__1::vector<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const>>, std::__1::allocator<std::__1::unique_ptr<art::DexFile const, std::__1::default_delete<art::DexFile const>>>>)+376)
#00 pc 000000000031e7c3 /system/lib/libart.so (art::OatFileManager::OpenDexFilesFromOat(char const*, _jobject*, _jobjectArray*, art::OatFile const**, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>>>)+3890)
#00 pc 00000000002ed9b9 /system/lib/libart.so (art::DexFile_openDexFileNative(_JNIEnv
, _jclass*, _jstring*, _jstring*, int, _jobject*, _jobjectArray*)+96)
#00 pc 00000000000519fb /system/framework/arm/boot-core-libart.oat (Java_dalvik_system_DexFile_openDexFileNative__Ljava_lang_String_2Ljava_lang_String_2ILjava_lang_ClassLoader_2_3Ldalvik_system_DexPathList_00024Element_2+194)
at dalvik.system.DexFile.openDexFileNative (DexFile.java)
at dalvik.system.DexFile.openDexFile (DexFile.java:353)
at dalvik.system.DexFile. (DexFile.java:100)
at dalvik.system.DexFile. (DexFile.java:74)
at dalvik.system.DexPathList.loadDexFile (DexPathList.java:374)
at dalvik.system.DexPathList.makeDexElements (DexPathList.java:337)
at dalvik.system.DexPathList. (DexPathList.java:157)
at dalvik.system.BaseDexClassLoader. (BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader. (PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader (ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader (ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader (ApplicationLoaders.java:69)
at android.app.ApplicationLoaders.getClassLoader (ApplicationLoaders.java:35)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked (LoadedApk.java:693)
at android.app.LoadedApk.getClassLoader (LoadedApk.java:727)
at android.app.ContextImpl.getClassLoader (ContextImpl.java:300)
at android.webkit.WebViewFactory.getProviderClass (WebViewFactory.java:394)
at android.webkit.WebViewFactory.getProvider (WebViewFactory.java:194)
at android.webkit.WebView.getFactory (WebView.java:2530)
at android.webkit.WebView.ensureProviderCreated (WebView.java:2525)
at android.webkit.WebView.setOverScrollMode (WebView.java:2590)
at android.view.View. (View.java:4574)
at android.view.View. (View.java:4706)
at android.view.ViewGroup. (ViewGroup.java:597)
at android.widget.AbsoluteLayout. (AbsoluteLayout.java:55)
at android.webkit.WebView. (WebView.java:643)
at android.webkit.WebView. (WebView.java:588)
at android.webkit.WebView. (WebView.java:571)
at android.webkit.WebView. (WebView.java:558)
at android.webkit.WebView. (WebView.java:548)
at com.audienceproject.userreport.InAppEventsTrack.getUserAgentString (InAppEventsTrack.java:221)
at com.audienceproject.userreport.InAppEventsTrack. (InAppEventsTrack.java:64)
at com.audienceproject.userreport.UserReport.initTracker (UserReport.java:130)
at com.audienceproject.userreport.UserReport.init (UserReport.java:94)
at com.audienceproject.userreport.UserReport. (UserReport.java:56)
at com.audienceproject.userreport.UserReport.configure (UserReport.java:67)
at com.audienceproject.userreport.UserReport.configure (UserReport.java:81)
at fi.iltalehti.nyt.IlApp.initUserReport (IlApp.java:107)
at fi.iltalehti.nyt.IlApp.onCreate (IlApp.java:51)
at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1120)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:5763)
at android.app.ActivityThread.-wrap1 (ActivityThread.java)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1659)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6526)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:807)

This row made me to publish it here at com.audienceproject.userreport.InAppEventsTrack.getUserAgentString (InAppEventsTrack.java:221)

@hmvs
Copy link
Contributor

hmvs commented Mar 9, 2021

Thank you for the report. Are there any additional details? Like the device, android version.

@belrvn
Copy link
Author

belrvn commented Mar 9, 2021

This ANR is mainly an issue on firebase side: firebase/firebase-android-sdk#2014

But it happens on :
Android 8.1 (SDK 27)
Android 9 (SDK 28)
Android 7.0 (SDK 24)
Android 8.0 (SDK 26)

Devices affected by this ANR :
Lenovo Tab E10 43.1%
Samsung Galaxy Tab A 10.1 17.4%
Nokia 3. 16.5%

@hmvs
Copy link
Contributor

hmvs commented Mar 9, 2021

Thank you @Belka1000867.
Do you have any ideas on how we can fix it?

@belrvn
Copy link
Author

belrvn commented Mar 15, 2021

I think that should be fixed in Firebase library. I see other same type ANRs from firebase.iid

@hmvs
Copy link
Contributor

hmvs commented Mar 16, 2021

Ok. In this case, can you link to the issue in their repository?
The only workaround I thought of is to create WebView, not in the main thread. Though, I am not sure, is it worth doing? What do you think?

private void setUserAgent(Context context) {
    AsyncTask<Context, Void, Void> task = new AsyncTask<Context, Void, Void>() {
        @Override
        protected Void doInBackground(Context... contexts) {
            try {
                new Handler(Looper.getMainLooper()).post(() ->
                        defaultUserAgent = new WebView(context).getSettings().getUserAgentString());
            } catch (Exception ex) {
                ex.printStackTrace();
                return null; // exception might appear if there is no google APIs
            }
            return null;
        }
    };
    task.execute(context);
}

@hmvs
Copy link
Contributor

hmvs commented Jun 11, 2021

@Belka1000867 So you've found the root cause in the firebase library. I guess we can close this one. Right?

@hmvs hmvs closed this as completed Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants