Closed kangwang1988 closed 6 years ago
@eseidelGoogle After we distributed it for thousands of users,it crashed for dozens of users. Would you help use figure out how to fix it?
https://github.com/flutter/engine/wiki/Symbolicating-production-crash-stacks can help us get the line numbers. @jason-simmons may know what's going on.
Some sort of null pointer dereference on the ui_thread it looks like.
Can you provide information about the exact build of libflutter.so that was used to generate these stack traces? Specifically the commit of the Flutter engine and the build variant (debug, profile, or release)
I tried to symbolize the stack traces against debug and release binaries from commit e61bb9a
but they don't seem to match.
@jason-simmons @eseidelGoogle As I don't know how to email you jason, I've sent Matt Sullivan mattsullivan@google.com a email including details including our repo(engine&skia)commit and built apk.You can get those informations from him. Thanks.
We noticed that if we remove the app_flutter directory. It will work fine. Currently, we're using multiple process in one application. i.e., multiple FlutterApplication.onCreate() will be called, the icudtl.dat may be broken. We've refactored this logic.
@jason-simmons Hi, Jason. We've made two modifications for this issue. One is to apply your commit about "prevent multiple calls...". Another is to delete the app_flutter folder at the very beginning of our Application's onCreate Function. In our test phase, it disappears. Then in our released app, we found that issue still exists. The ratio is about 0.9% user may face this situation, but not continuously crash. I run the add2line and the result is as below:
KyleWongdeMacBook-Pro:src kylewong$ ./third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-addr2line -e out/android_release/libflutter.so 0036101c 0035fa19 0036342b 00363d2d 0006a6c5 000680f5 000680af 003cfac3 003d002d
/Users/kylewong/Codes/Flutter/engine/src/out/android_release/../../flutter/third_party/txt/src/minikin/WordBreaker.cpp:55
/Users/kylewong/Codes/Flutter/engine/src/out/android_release/../../flutter/third_party/txt/src/minikin/LineBreaker.cpp:74
/Users/kylewong/Codes/Flutter/engine/src/out/android_release/../../flutter/third_party/txt/src/txt/paragraph.cc:256
/Users/kylewong/Codes/Flutter/engine/src/out/android_release/../../flutter/third_party/txt/src/txt/paragraph.cc:395
/Users/kylewong/Codes/Flutter/engine/src/out/android_release/../../flutter/lib/ui/text/paragraph_impl_txt.cc:54
/Users/kylewong/Codes/Flutter/engine/src/out/android_release/../../topaz/lib/tonic/dart_args.h:150
/Users/kylewong/Codes/Flutter/engine/src/out/android_release/../../topaz/lib/tonic/dart_args.h:198
/Users/kylewong/Codes/Flutter/engine/src/out/android_release/../../third_party/dart/runtime/vm/native_entry.cc:198
/Users/kylewong/Codes/Flutter/engine/src/out/android_release/../../third_party/dart/runtime/vm/native_entry.cc:348
This is the top one native crash in our product, do you have some ideas about how can we fix it? @jason-simmons
This is happening when the text engine is unable to create a line breaker using the ICU library: https://github.com/flutter/engine/blob/master/third_party/txt/src/minikin/WordBreaker.cpp#L36
If you can collect more logs when this happens, then I would try logging the error code returned by ICU here. Also log the state of the icudtl.dat file (whether it exists, the size of the file, maybe even a checksum).
The app should not delete app_flutter - FlutterMain should be the only code that touches app_flutter. Deleting app_flutter may leave the device in a state where the icudtl.dat file is missing at the time when WordBreaker needs it.
@jason-simmons If i refactor my FlutterApplication related logic like this: I've only one FlutterApplication as TaobaoApplication's instance variable and ensure that we only initialize it for our main(UI) process. As long as we ensure that FlutterApplication's FlutterMain.startInitialization(this) is called once, getter/setter for mCurrentActivity can return/save the value store in it. Remove the remove the app_flutter folder logic, can I fix those two issues? Besides, do i need to call FlutterMain.ensureInitializationComplete() everytime in my customized activity's onCreate, Currently, it's called only once? It's not a FlutterActivity, just a normal one, and only one FlutterNativeView.
@jason-simmons In the very beginning, there is no remove the app_flutter folder logic, as we found that continuously crash may occur in a Nexus5(Android7) device, we cherry-picked your commit to ensure that multiple calls for "FlutterMain.startInitialization" is safe. Even so, the continuously crash occurs. So we add the remove the app_flutter folder logic.
@jason-simmons should we combine this with https://github.com/flutter/flutter/issues/16919 ?
Yes - from what I can tell the common issue is corruption of the assets managed by the ResourceExtractor
@kangwang1988 @mjohnsullivan What is the status of this issue? Is there anything we still need to do on our end? Is it still a blocker issue?
@Hixie Sorry to reply you late. After we fix the corrupted icudtl.dat. This problem disappears. So this issue cane be closed now. Now we've upgraded our flutter to latest v0.3.1 version, it seems fine. If we found any crash related to this issue after we've released, I will reopen it later.
@kangwang1988 I just ran into this problem. From the very beginning,I thought it was because icudtl.dat in the app_flutter directory was broken,so I checked the CRC checksum between the local one and the assets one every time my app started.If that failed,I would extract the resource again.And it worked,well,in some way.The crash still appeared with lower frequency. So I want to know what did you exactly do to 'fix the corrupted icudtl.dat',thank you very much!
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
Steps to Reproduce
In our application,one detail page is written in flutter while the others use java. However, in our test, we noticed that after my detail page crashes one time, it will continuously crash when entering any detail page again after relaunching.
The Crash log is given below:
Please tell us what you were doing and what went wrong. If you are running flutter tools from the command line, please try adding the
-v
or--verbose
option to gather more information.If the problem is with your application's rendering, please attach a screenshot and any relevant source code. If you are getting an exception in the logs, and your code is implicated in the first few frames, then please include the source code for the functions involved.
Logs
Run your application with
flutter run
and attach all the log output.Run
flutter analyze
and attach any output of that command also.Flutter Doctor
[✓] Flutter (Channel beta, v0.1.6-pre.39, on Mac OS X 10.13.4 17E199, locale en-CN) • Flutter version 0.1.6-pre.39 at /Users/kylewong/Codes/fwn_idlefish/flutter • Framework revision 5cac396777 (2 days ago), 2018-04-17 13:09:18 +0800 • Engine revision e61bb9ac3a • Dart version 2.0.0-dev.35.flutter-290c576264
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3) • Android SDK at /Users/kylewong/Library/Android/sdk • Android NDK at /Users/kylewong/Library/Android/sdk/ndk-bundle • Platform android-27, build-tools 27.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) • All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 9.3, Build version 9E145 • ios-deploy 1.9.2 • CocoaPods version 1.2.0
[✓] Android Studio (version 3.1) • Android Studio at /Applications/Android Studio.app/Contents • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] Connected devices (1 available) • KyleWong's iPhone • 1c8e085cf2ff6fa27643ab4afec4bf4a077688af • ios • iOS 11.3
• No issues found!
Paste the output of running
flutter doctor -v
here.Questions
Besides how to fix this problem, I'm curious how can I know which function/file-linenum the address in a released libflutter.so matches? Do you have any good ideas for me to know which file/linenum triggered this crash?