firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.25k stars 1.39k forks source link

Hang risk detected by Xcode 15.3 in Google Utilities framework (GULNetworkURLSession) #12640

Open aureliencolas opened 1 month ago

aureliencolas commented 1 month ago

Description

Just bumped to Xcode 15.3 and it now reports a hang risk in the GoogleUtilities framework on which depends the Firebase framework.

The warning deals with a call to the NSFileManager API from the main thread in the method GULNetworkURLSession.removeTempItemAtURL (GoogleUtilities>GoogleUtilities>Network>GULNetworkURLSession.m)

For more details, here is a screenshot of the code where the warning is triggered: image

Not sure if the warning is a false positive, it's just to let you know (in case you don't already).

Environment:

Reproducing the issue

No response

Firebase SDK Version

10.22.1

Xcode Version

15.3

Installation Method

Swift Package Manager

Firebase Product(s)

Analytics, Crashlytics, Messaging

Targeted Platforms

iOS

Relevant Log Output

The warning says: 

{"message":"This code path does I/O on the main thread underneath that can lead to UI responsiveness issues. Consider ways to optimize this code path","antipattern trigger":"-[NSFileManager removeItemAtURL:error:]","message type":"suppressable","show in console":"0"}

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
```json { "pins" : [ { "identity" : "abseil-cpp-binary", "kind" : "remoteSourceControl", "location" : "https://github.com/google/abseil-cpp-binary.git", "state" : { "revision" : "df308b8b46607675f2b9ec8e569109008f9155ce", "version" : "1.2022062300.1" } }, { "identity" : "app-check", "kind" : "remoteSourceControl", "location" : "https://github.com/google/app-check.git", "state" : { "revision" : "3e464dad87dad2d29bb29a97836789bf0f8f67d2", "version" : "10.18.1" } }, { "identity" : "appauth-ios", "kind" : "remoteSourceControl", "location" : "https://github.com/openid/AppAuth-iOS.git", "state" : { "revision" : "7e2c09cbeb3bb799f26c268dbedb26325ea722a9", "version" : "1.7.3" } }, { "identity" : "chargebee-ios-tvos", "kind" : "remoteSourceControl", "location" : "https://github.com/aureliencolas/chargebee-ios-tvos", "state" : { "branch" : "master", "revision" : "a53c78e9d3d5e57004fea99e60312bdd2ae1c3fa" } }, { "identity" : "facebook-ios-sdk", "kind" : "remoteSourceControl", "location" : "https://github.com/facebook/facebook-ios-sdk", "state" : { "revision" : "e14f349945ba3f9516e3292107f42be19fe9fbe5", "version" : "12.3.2" } }, { "identity" : "firebase-ios-sdk", "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk.git", "state" : { "revision" : "be49849dcba96f2b5ee550d4eceb2c0fa27dade4", "version" : "10.22.1" } }, { "identity" : "googleappmeasurement", "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { "revision" : "482cfa4e5880f0a29f66ecfd60c5a62af28bd1f0", "version" : "10.22.1" } }, { "identity" : "googledatatransport", "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleDataTransport.git", "state" : { "revision" : "a637d318ae7ae246b02d7305121275bc75ed5565", "version" : "9.4.0" } }, { "identity" : "googlesignin-ios", "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleSignIn-iOS.git", "state" : { "revision" : "7932d33686c1dc4d7df7a919aae47361d1cdfda4", "version" : "7.0.0" } }, { "identity" : "googleutilities", "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { "revision" : "26c898aed8bed13b8a63057ee26500abbbcb8d55", "version" : "7.13.1" } }, { "identity" : "grpc-binary", "kind" : "remoteSourceControl", "location" : "https://github.com/google/grpc-binary.git", "state" : { "revision" : "ea4cb5cc0c39c732b85386263116d2e2fdbbdc61", "version" : "1.49.2" } }, { "identity" : "gtm-session-fetcher", "kind" : "remoteSourceControl", "location" : "https://github.com/google/gtm-session-fetcher.git", "state" : { "revision" : "76135c9f4e1ac85459d5fec61b6f76ac47ab3a4c", "version" : "3.3.1" } }, { "identity" : "gtmappauth", "kind" : "remoteSourceControl", "location" : "https://github.com/google/GTMAppAuth.git", "state" : { "revision" : "cee3c709307912d040bd1e06ca919875a92339c6", "version" : "2.0.0" } }, { "identity" : "interop-ios-for-google-sdks", "kind" : "remoteSourceControl", "location" : "https://github.com/google/interop-ios-for-google-sdks.git", "state" : { "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648", "version" : "100.0.0" } }, { "identity" : "kingfisher", "kind" : "remoteSourceControl", "location" : "https://github.com/onevcat/Kingfisher.git", "state" : { "revision" : "5b92f029fab2cce44386d28588098b5be0824ef5", "version" : "7.11.0" } }, { "identity" : "leveldb", "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/leveldb.git", "state" : { "revision" : "43aaef65e0c665daadf848761d560e446d350d3d", "version" : "1.22.4" } }, { "identity" : "lottie-spm", "kind" : "remoteSourceControl", "location" : "https://github.com/airbnb/lottie-spm.git", "state" : { "revision" : "3bd43e12d6fb54654366a61f7cfaca787318b8ce", "version" : "4.4.1" } }, { "identity" : "nanopb", "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/nanopb.git", "state" : { "revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1", "version" : "2.30910.0" } }, { "identity" : "promises", "kind" : "remoteSourceControl", "location" : "https://github.com/google/promises.git", "state" : { "revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac", "version" : "2.4.0" } }, { "identity" : "sentry-cocoa", "kind" : "remoteSourceControl", "location" : "https://github.com/getsentry/sentry-cocoa.git", "state" : { "revision" : "cf43eac1aa12017868c257ad3854ad87a5de0758", "version" : "7.31.5" } }, { "identity" : "swift-protobuf", "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { "revision" : "65e8f29b2d63c4e38e736b25c27b83e012159be8", "version" : "1.25.2" } }, { "identity" : "swiftkeychainwrapper", "kind" : "remoteSourceControl", "location" : "https://github.com/jrendel/SwiftKeychainWrapper", "state" : { "revision" : "185a3165346a03767101c4f62e9a545a0fe0530f", "version" : "4.0.1" } }, { "identity" : "swiftyxml", "kind" : "remoteSourceControl", "location" : "https://github.com/chenyunguiMilook/SwiftyXML.git", "state" : { "revision" : "30040f38675bc3a1666a0b0f6417adabaf26a3c6", "version" : "3.1.0" } } ], "version" : 2 } ```

If using CocoaPods, the project's Podfile.lock

No response

google-oss-bot commented 1 month ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

1729patrick commented 9 hours ago

I have the same problem, and it's causing a crash for about 2% of my users. Have someone managed to fix it?

1729patrick commented 8 hours ago

Indeed, I consistently receive warnings about the Network component, yet I also encounter warnings regarding the GoogleDataTransport without experiencing any crashes.

Screenshot 2024-05-03 at 4 23 17 PM Screenshot 2024-05-03 at 4 23 10 PM Screenshot 2024-05-03 at 4 23 13 PM