[firebase_crashlytics]: Android reports the APK's libapp.so build ID for Dart code-push (Shorebird) patches, so their crashes use the wrong symbols
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- android, dart, firebase
- Lĩnh vực
- mobile, observability
Hướng nghiên cứu
Start by reading FlutterFirebaseCrashlyticsPlugin.recordError and ElfBuildIdReader in the Android Crashlytics plugin, then trace how the Dart VM snapshot build ID is obtained from the stack trace. Check the existing Android Crashlytics tests for build ID selection. Done when an opt-in lets Dart errors report the running Dart code's build ID and tests cover both the default ELF ID and the opt-in behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues.
Which plugins are affected?
Crashlytics
Which platforms are affected?
Android
Description
When an app uses a Dart code-push tool such as Shorebird, Crashlytics symbolicates Dart crashes from a patch with the original release's symbols, so the stack trace shows unrelated functions with no warning.
A Shorebird patch is a full recompile of the app's Dart. It is downloaded at runtime and loaded instead of the libapp.so in the installed APK, which stays the release's. On Android, FlutterFirebaseCrashlyticsPlugin.recordError picks the build ID like this:
// Prefer the ELF build ID from libapp.so over the Dart VM's snapshot build ID.
// The firebase-crashlytics-buildtools JAR uses the ELF build ID when uploading symbols,
// so we must report the same ID for Crashlytics to match them.
val effectiveBuildId = elfBuildId ?: dartBuildId
elfBuildId is read by ElfBuildIdReader from the APK's libapp.so, so for a patched app it is always the release's build ID, even though the code that crashed came from the patch. Uploading the patch's symbols with firebase crashlytics:symbols:upload doesn't help, because the event never carries the patch's build ID. Every frame from a patch is decoded against the wrong symbol file, including frames from code the patch didn't change, since a recompile moves it.
Expected: a way to have the event carry the build ID of the Dart code that is actually running, so the patch's uploaded symbols are used.
Actual: the event always carries the APK's libapp.so build ID.
I understand why the ELF ID is preferred by default, so I'm not asking to change the default. An opt-in would be enough, for example:
- an option to prefer the Dart VM's snapshot build ID (
dartBuildId, from the stack trace'sbuild_id:line) over the ELF one, or - an API to set the build ID reported with Dart errors, which an app could set from its code-push SDK when a patch is running.
Reproducing the issue
- Create a Shorebird release of an Android app with
firebase_crashlytics, built with--obfuscate --split-debug-info, and upload its symbols to Crashlytics. - Publish a Shorebird patch whose new code throws, e.g.
throw StateError('patch crash test')from a new function called on a button tap. - Install the release, restart it twice so the patch is running, and trigger the error.
- In Crashlytics, the event's plain-text stack trace shows the release's
BuildId(it matcheslibapp.sopulled from the device, not the patch's symbol file), and the function names come from the release, e.g. the new throwing function appears as an unrelated existing method. - Passing the same
pcoffsets tollvm-symbolizerwith the patch's symbol file gives the correct trace, with the throwing function on top.
Firebase Core version
4.15.0 (firebase_crashlytics 5.4.0)
Flutter Version
3.47.7 (Shorebird's Flutter fork, Shorebird CLI 1.6.134)
Relevant Log Output
No response
Flutter dependencies
No response
Additional context and comments
iOS has a related gap, but that one isn't in the plugin: Crashlytics only symbolicates iOS Dart frames through dSYMs, and a Shorebird patch has no dSYM, so patched iOS frames stay as raw abs … virt … lines. I'll raise that through Firebase Support.
- Ngôn ngữ chính
- Dart
- Star
- 9.3k
- Fork
- 4.1k
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 78
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/flutterfire
-
🚀 [firebase_core] Bump Firebase C++ SDK (14.1.0 → 14.2.0)Có thể đã có người làm @SelaseKay đã nhận hôm nay. Đang mởNeeds Attention type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
firebase/flutterfire#18977 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[firebase_core_web]: Firebase.initializeApp never completes when a Firebase JS SDK script fails to loadCó thể đã có người làm @LasseLegarth đã nhận 5 ngày trước. Đang mởNeeds Attention platform: web plugin: core reproduced type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
firebase/flutterfire#18964 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
blocked: external dependency platform: web plugin: ai type: bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
firebase/flutterfire#18938 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[cloud_firestore][Windows] Invalid field names (empty or `__x__`) close the app instead of throwing a FirebaseExceptionCó thể đã có người làm @SelaseKay đã nhận 5 ngày trước. Đang mởNeeds Attention platform: windows plugin: cloud_firestore reproduced type: bug type: crash
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
firebase/flutterfire#18928 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs Attention plugin: ai type: enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
firebase/flutterfire#18917 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của firebase/flutterfire
Issue tương tự
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
[BUG] 172.2* 排除域名包含公网IPĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
agent: is checked on a wrapper holding several checkables answers from the first one in tree orderĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AlphaWaveSystems/flutter-probe#865 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
ubuntu/app-center#2306 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
spotiflacapp/SpotiFLAC-Mobile#923 ·