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

Firebase/Performance pod causing UI API called on a background thread #213

Closed
ljaderman opened this issue Aug 23, 2017 · 4 comments
Closed

Comments

@ljaderman
Copy link

[REQUIRED] Step 2: Describe your environment

  • Xcode version: Version 9.0 beta 6 (9M214v)_
  • Firebase SDK version: _Firebase 4.0.4, ____
  • Library version: FirebasePerformance (1.0.3)___
  • Firebase Product: _____ Performance Monitoring

[REQUIRED] Step 3: Describe the problem

Including Firebase/Performance causes Main Thread Checker to flag a "UI API called on a background thread" error.

Steps to reproduce:

Install performance monitoring: pod 'Firebase/Performance'
Running the app causes the following backtrace (below). Remove the Performance pod, rebuild and run and main thread checker issue does not occur.

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 600, TID: 236079, Thread name: (none), Queue name: com.google.firebase.auth.serialTaskQueue, QoS: 0
Backtrace:
4 App 0x00000001015c6ac4 -[FPRTraceBackgroundActivityTracker init] + 116
5 App 0x00000001015ccf2c -[FPRNetworkTrace start] + 96
6 App 0x00000001015d10cc __InstrumentDataTaskWithRequest_block_invoke + 120
7 App 0x000000010128c5e4 -[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:] + 8948
8 App 0x0000000101289474 -[GTMSessionFetcher beginFetchWithCompletionHandler:] + 388
9 App 0x00000001014df400 -[FIRAuthBackendRPCIssuerImplementation asyncPostToURL:body:contentType:completionHandler:] + 496
10 App 0x00000001014e0d28 -[FIRAuthBackendRPCImplementation postWithRequest:response:callback:] + 384
11 App 0x00000001014dff30 -[FIRAuthBackendRPCImplementation secureToken:callback:] + 204
12 App 0x00000001014decf8 +[FIRAuthBackend secureToken:callback:] + 100
13 App 0x00000001014d6a18 -[FIRSecureTokenService requestAccessToken:] + 264
14 App 0x00000001014d64e4 __65-[FIRSecureTokenService fetchAccessTokenForcingRefresh:callback:]_block_invoke + 204
15 App 0x00000001014d5ff0 __38-[FIRAuthSerialTaskQueue enqueueTask:]_block_invoke + 116
16 libdispatch.dylib 0x0000000102de149c _dispatch_call_block_and_release + 24
17 libdispatch.dylib 0x0000000102de145c _dispatch_client_callout + 16
18 libdispatch.dylib 0x0000000102df0110 _dispatch_queue_serial_drain + 692
19 libdispatch.dylib 0x0000000102de49a4 _dispatch_queue_invoke + 332
20 libdispatch.dylib 0x0000000102deff30 _dispatch_queue_serial_drain + 212
21 libdispatch.dylib 0x0000000102de49a4 _dispatch_queue_invoke + 332
22 libdispatch.dylib 0x0000000102df1104 _dispatch_root_queue_drain_deferred_wlh + 424
23 libdispatch.dylib 0x0000000102df8100 _dispatch_workloop_worker_thread + 652
24 libsystem_pthread.dylib 0x000000018663efe0 _pthread_wqthread + 932
25 libsystem_pthread.dylib 0x000000018663ec30 start_wqthread + 4
2017-08-23 14:02:48.833133-0700 App[600:236079] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 600, TID: 236079, Thread name: (none), Queue name: com.google.firebase.auth.serialTaskQueue, QoS: 0
Backtrace:
4 App 0x00000001015c6ac4 -[FPRTraceBackgroundActivityTracker init] + 116
5 App 0x00000001015ccf2c -[FPRNetworkTrace start] + 96
6 App 0x00000001015d10cc __InstrumentDataTaskWithRequest_block_invoke + 120
7 App 0x000000010128c5e4 -[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:] + 8948
8 App 0x0000000101289474 -[GTMSessionFetcher beginFetchWithCompletionHandler:] + 388
9 App 0x00000001014df400 -[FIRAuthBackendRPCIssuerImplementation asyncPostToURL:body:contentType:completionHandler:] + 496
10 App 0x00000001014e0d28 -[FIRAuthBackendRPCImplementation postWithRequest:response:callback:] + 384
11 App 0x00000001014dff30 -[FIRAuthBackendRPCImplementation secureToken:callback:] + 204
12 App 0x00000001014decf8 +[FIRAuthBackend secureToken:callback:] + 100
13 App 0x00000001014d6a18 -[FIRSecureTokenService requestAccessToken:] + 264
14 App 0x00000001014d64e4 __65-[FIRSecureTokenService fetchAccessTokenForcingRefresh:callback:]_block_invoke + 204
15 App 0x00000001014d5ff0 __38-[FIRAuthSerialTaskQueue enqueueTask:]_block_invoke + 116
16 libdispatch.dylib 0x0000000102de149c _dispatch_call_block_and_release + 24
17 libdispatch.dylib 0x0000000102de145c _dispatch_client_callout + 16
18 libdispatch.dylib 0x0000000102df0110 _dispatch_queue_serial_drain + 692
19 libdispatch.dylib 0x0000000102de49a4 _dispatch_queue_invoke + 332
20 libdispatch.dylib 0x0000000102deff30 _dispatch_queue_serial_drain + 212
21 libdispatch.dylib 0x0000000102de49a4 _dispatch_queue_invoke + 332
22 libdispatch.dylib 0x0000000102df1104 _dispatch_root_queue_drain_deferred_wlh + 424
23 libdispatch.dylib 0x0000000102df8100 _dispatch_workloop_worker_thread + 652
24 libsystem_pthread.dylib 0x000000018663efe0 _pthread_wqthread + 932
25 libsystem_pthread.dylib 0x000000018663ec30 start_wqthread + 4

@paulb777
Copy link
Member

Thanks for the report.

This issue is not part of the open source repo and being tracked internally as b/64213975.

The fix is targeted for an upcoming FirebasePerformance release.

We'll update here when the release goes out.

@ljaderman
Copy link
Author

Thanks, Paul. We're hoping this and the other critical bugs will be resolved prior to the general release of iOS11, as we (and I'm sure many others) are hoping to use firebase for several production apps targeted for the iOS11 general release.

@paulb777
Copy link
Member

The fix was released with Firebase 4.1.1 and FirebasePerformance 1.0.4.

christibbs added a commit that referenced this issue Jan 25, 2019
* compile and run

* unit tests pass and swift target compiles

* dump build version in activity log

* standardize cross sdk imports in firebase iam code (#211)

standardize cross sdk imports & polish with style script

* using new sample app for testing non-development fiam sdk (#213)

* in-app messaging public interface cleanup (#216)

* slim down public header files

* move testing source files to their correct folders

* compiles

* style script fine-tune

* adding root object creation methods to follow the firebse iOS convension

* IAM url following refactor (#218)

* @available not supported by blaze build yet (#220)

* Clearcut integration for in-app messaging (#222)

* Update iam-master to catch up with latest master (#223)

* Support multiple triggers defined for the same iam message (#224)

* FIAM Clearcut Client Implmentation Improvement (#226)

* fixing action url bug and set auto dismiss to be 12 seconds (#227)

* use official public api dns name (#233)

* Logging firebase analytics events for fiam (#232)

* Fine tuning of fiam's code for loading data from caches (#234)

* fiam ui fine tuning before EAP (#235)

* allow fiam SDK functions to be disabled/enabled dynamically (#247)

* analytics event parameter name tuning (#253)

* migrate off @import for fiam code (#261)

* different modes for fiam sdk at runtime (#262)

* realtime clearcut when in running in simulator (#265)

* Update interface based on the Firebase API review feedback  (#267)

* check existence of fiam SDK resource bundle (#268)

* handling api keys with application restrictions (#269)

* fixing typo and refoctor for unit testing (#270)

* fix color method name clash and layout adjust (#271)

* Yongmao/layout issue and class rename (#273)

* fix long text height calc error

* rename class

* fiam modal view layout tuning (#274)

* test on device for ios client (#275)

* dynamic testing mode handling (#277)

* main header file comment update and run style.sh (#281)

* honor global firebase auto data collection flag in fiam (#283)

* honor global firebase auto data collection flag in fiam

* address comments

* tuning

* address review comments

* tuning for comments

* Rename Core global data collection switch (#287)

* Support displaying a messages defined as recurring (#286)

* continue

* Adjust some inapp messaging dependeces due to the firebase core changes from the upcoming release

* bump up version for in-app messaging

* Fix impression log clearing race condition bug. (#289)

* fix impression handling race condition bug

* podspec and interacting interfaces for new firebaseinappmessagingdisplay pod (#290)

* create inapp messaging display podspec

* Default fiam display UI implementation (#292)

* Default fiam display UI implementation. Created the new pod for FirebaseInAppMessagingDisplay

* Make FirebaseInAppMessaging headless (#293)

* import path tuning

* log test message events (#296)

* respect fetch wait time from server (#297)

* add changelog.md for fiam headless sdk (#300)

* port the fetch wait time change back into github (#304)

* remove resource bundle check for headless sdk

* fix a bug in which the test-on-device message does not follow action url

* Add category on NSString to interlace two strings, use it to obfuscate clearcut host name

* Use FIR prefix to avoid collisions

* Change method name for getting server hostname

* Delete Swift example project, its coverage is already duplicated in the FIRInAppMessagingDisplay UITests

* Miscellaneous open sourcing cleanup tasks

* Convert FIAM to use the Analytics connector (#336)

* Convert FIAM to use Analytics connector along with converting to the FIRLibrary component registration model.
* Update interop headers for missing methods
* Convert existing unit tests

* Fix style for fiam sources (#342)

* Clean up non-idiomatic ObjC method names

* Clean up Swift test target from Podfile

* Use dummy GoogleService-Info.plist and don't expose api keys (#343)

* Update plist to include fake API keys

* Remove changes in non fiam code from iam-master branch (#350)

* Fix a few method and parameter naming nits

* Fix comment typos in several files

* Delete remaining Swift project files
@longhoang2984
Copy link

It still happen on v2.0.1

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

No branches or pull requests

3 participants