-
Notifications
You must be signed in to change notification settings - Fork 1.6k
App crashes in Release mode while logging App start session event #11403
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
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
This may be the result of building the nanopb library without specifying the right options. For example see https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseCrashlytics.podspec#L101
|
Above mentioned flags are being passed, From the example I shared, I am passing the flags here - https://github.com/sanju-naik/bazel-demo-github/blob/firebase-sessions-crash-in-opt/BazelDemo/Pods/nanopb/BUILD.bazel#L24 . But still the app crashes. |
Those flags also need to be passed to the clients of nanopb since the clients need to have the right |
Ok, let me examine the
By Clients here you mean Targets that depend on nanopb? i.e the Firebase Pods or Is it the iOS Application Targer? Also in the same setup, it runs fine in |
Any Firebase product that sets the options in the podspec like https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseCrashlytics.podspec#L101 needs to be built with those options. Crashes from alignment issues can be randomish since they depend on how linking occurs and whether or not data happens to fall on a required alignment boundary or not. |
All the flags mentioned in the Podspec file are passed in all of the Firebase Pods as well as nanopb pod but it still crashes in Would it be possible to Debug this using the example I provided above and provide more insights onto which flag is causing this issue? 🙏 |
@sanju-naik I don't seem to have access to the repository anymore. Were you able to get this working? |
Hey @sanju-naik. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
I was able to reproduce with the following project https://github.com/sergiocampama/SessionsTestApp on Xcode 15.3 beta 3, wasn't able to repro on 15.2, both attempts on a 17.2 iPhone simulator. It looks to be related to Xcode beta then. The project is configured to run on the simulator using the Release configuration. It does not reproduce on the Debug configuration. I believe you should be able to just download that project, pod install and then run on a simulator using xcode 15.3 beta 3 to reproduce. ![]() ![]() |
@sanju-naik did you replace nanopb with an xcframework on a cocoapods project? could you share how you did it? |
@sergiocampama Thanks for the repro, but I'm not able to reproduce the crash on Xcode 15.3 beta 3. Maybe the crash is specific to Arm Macs, and I have an Intel Mac? |
You should be able to connect an iPhone as well, a bit more cumbersome since you'll need to add your account to Xcode, change the bundle ID of the app and set your development team on the signing settings, but it should also reproduce there |
Could also reproduce on a different Apple Silicon machine, same config as the above, could be that x86 simulators are unaffected. |
Thanks. On an iPhone 13, I don't see a crash, but I see several log messages like:
that doesn't occur when built in Debug mode. And on closer inspection, the log failure DOES reproduce on the simulator when built in Release mode. |
Looks like the issue could be related to type conversions between Swift UnsafeMutablePointers and C types. Note the difference between fields[1] and its corresponding entry in the original array. The random? memory values in the entries after array element 0 would also explain sometimes crashing and sometimes logging an error message. |
I tested the linked PR on a locally modified copy of Firebase, and the crash does not occur any more on my repro cases 🚀 thanks for looking into it over the weekend! wish I could send you a peer bonus :) |
@sergiocampama Thanks for isolating it to a reproducible example and testing the proposed fix! I'll ask the team to review it this week and target it for our next release. |
@sergiocampama For a release we download all of xcframeworks from a firebase using their source code zip linkhttps://github.com/firebase/firebase-ios-sdk/releases/download/10.21.0/Firebase.zip , and then we are hosting these xcframeworks in our internal artifactory with our own forked podspecs. This way we replaced all of our Firebase Pods from source code to xcframeworks . Since the crash was happening when we compile using Bazel, after moving to pre-built xcframework crash was resolved. |
And glad to see now the crash is fixed on source code based Pod as well ❤️ |
@paulb777 Is there any way to prevent this occurrence? Would utilizing an earlier version of the Firebase SDK potentially address the issue, until a fix is released? |
The problematic source code was introduced in Firebase 10.6.0 so it may work to use an earlier version. It might be easier to stay on Xcode 15.2 instead though until the fix releases in 10.22.0. |
Has this fix also been added to the react-native-firebase 19.0.1 release? I was seeing this issue as well after the upgrade to 17.4 and want to release a fix as soon as possible |
just upgraded and it did fix the issue^ |
Description
App works fine in

Debug
mode but crashes inRelease
mode upon App launch while logging App start session event.Reproducing the issue
We are observing this issue when using Bazel(https://bazel.build/) build system hence the Demo project is also built using Bazel.
To reproduce.
Clone this repo - https://github.com/sanju-naik/bazel-demo-github , and checkout
firebase-sessions-crash-in-opt
branch.brew install bazelisk
BazelDemo
and runbazel run //:BazelDemo_gen
to generate project.BazelDemo.xcodeproj
and buildBazelDemo-Release
scheme you would notice crash as attached in above screenshot.Firebase SDK Version
10.7.0
Xcode Version
14.3
Installation Method
CocoaPods
Firebase Product(s)
Analytics, Crashlytics, Performance
Targeted Platforms
iOS
Relevant Log Output
No response
If using Swift Package Manager, the project's Package.resolved
Expand
Package.resolved
snippetReplace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippetThe text was updated successfully, but these errors were encountered: