flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.12k stars 27.43k forks source link

SIGSEGV art::InvokeVirtualOrInterfaceWithVarArgs<T> #152084

Closed escamoteur closed 2 months ago

escamoteur commented 3 months ago

Steps to reproduce

Found in sentry since we switched to Fluttter 3.22.0 Only seen in Android 13 and 14 so far

Expected results

no crah

Actual results

OS Version: Android 13 (TP1A.220624.014.G780FXXSHFXF3)
Report Version: 104

Exception Type: Unknown (SIGSEGV)

Application Specific Information:
Segfault

Thread 0 Crashed:
0   libart.so                       0x7511139174        art::InvokeVirtualOrInterfaceWithVarArgs<T>
1   libart.so                       0x7511359f78        <unknown> + 502799900536
2   split_config.arm64_v8a.apk      0x750c055308        globalEnv_CallObjectMethod
3   split_config.arm64_v8a.apk      0x746f56c61c        _kDartVmSnapshotInstructions
4   split_config.arm64_v8a.apk      0x746f5aece4        _kDartIsolateSnapshotInstructions
5   split_config.arm64_v8a.apk      0x746fe38fd4        _kDartIsolateSnapshotInstructions
6   split_config.arm64_v8a.apk      0x746fe38c18        _kDartIsolateSnapshotInstructions
7   split_config.arm64_v8a.apk      0x746ff09498        _kDartIsolateSnapshotInstructions
8   split_config.arm64_v8a.apk      0x746f57dc78        _kDartIsolateSnapshotInstructions
9   split_config.arm64_v8a.apk      0x746f57dd70        _kDartIsolateSnapshotInstructions
10  split_config.arm64_v8a.apk      0x746f57e278        _kDartIsolateSnapshotInstructions
11  split_config.arm64_v8a.apk      0x746f57e094        _kDartIsolateSnapshotInstructions
12  split_config.arm64_v8a.apk      0x746f57c074        _kDartIsolateSnapshotInstructions
13  split_config.arm64_v8a.apk      0x746f57bca4        _kDartIsolateSnapshotInstructions
14  split_config.arm64_v8a.apk      0x746f57bc10        _kDartIsolateSnapshotInstructions
15  split_config.arm64_v8a.apk      0x746f57e7f0        _kDartIsolateSnapshotInstructions
16  split_config.arm64_v8a.apk      0x746f57e8b4        _kDartIsolateSnapshotInstructions
17  split_config.arm64_v8a.apk      0x746fe110c0        _kDartIsolateSnapshotInstructions
18  split_config.arm64_v8a.apk      0x746fe112f0        _kDartIsolateSnapshotInstructions
19  split_config.arm64_v8a.apk      0x746f57ba90        _kDartIsolateSnapshotInstructions
20  split_config.arm64_v8a.apk      0x746f57b988        _kDartIsolateSnapshotInstructions
21  split_config.arm64_v8a.apk      0x746f57b94c        _kDartIsolateSnapshotInstructions
22  split_config.arm64_v8a.apk      0x746f56edb0        _kDartVmSnapshotInstructions
23  split_config.arm64_v8a.apk      0x747fe46c50        dart::DartEntry::InvokeFunction (dart_entry.cc:125)
24  split_config.arm64_v8a.apk      0x747ff818cc        Dart_InvokeClosure (dart_api_impl.cc:4676)
25  split_config.arm64_v8a.apk      0x747fdb7db0        [inlined] tonic::DartPersistentValue::value (dart_persistent_value.h:27)
26  split_config.arm64_v8a.apk      0x747fdb7db0        tonic::DartMicrotaskQueue::RunMicrotasks (dart_microtask_queue.cc:77)
27  split_config.arm64_v8a.apk      0x747fa75c38        [inlined] std::_fl::function<T>::operator() (function.h:1187)
28  split_config.arm64_v8a.apk      0x747fa75c38        [inlined] fml::MessageLoopImpl::FlushTasks (message_loop_impl.cc:130)
29  split_config.arm64_v8a.apk      0x747fa75c38        fml::MessageLoopImpl::RunExpiredTasksNow (message_loop_impl.cc:139)
30  split_config.arm64_v8a.apk      0x747fa79784        [inlined] fml::MessageLoopAndroid::OnEventFired (message_loop_android.cc:91)
31  split_config.arm64_v8a.apk      0x747fa79784        [inlined] fml::MessageLoopAndroid::MessageLoopAndroid::lambda::operator() (message_loop_android.cc:41)
32  split_config.arm64_v8a.apk      0x747fa79784        fml::MessageLoopAndroid::MessageLoopAndroid::lambda::__invoke (message_loop_android.cc:39)
33  libutils.so                     0x75a85e87ac        android::Looper::pollInner
34  libutils.so                     0x75a85e8328        android::Looper::pollOnce
35  libandroid.so                   0x7507aaa13c        ALooper_pollOnce
36  split_config.arm64_v8a.apk      0x747fa79890        fml::MessageLoopAndroid::Run (message_loop_android.cc:67)
37  split_config.arm64_v8a.apk      0x747fa77938        [inlined] fml::MessageLoopImpl::DoRun (message_loop_impl.cc:94)
38  split_config.arm64_v8a.apk      0x747fa77938        [inlined] fml::MessageLoop::Run (message_loop.cc:49)
39  split_config.arm64_v8a.apk      0x747fa77938        [inlined] fml::Thread::Thread::lambda::operator() (thread.cc:154)
40  split_config.arm64_v8a.apk      0x747fa77938        [inlined] std::_fl::__invoke[abi:v15000]<T> (invoke.h:403)
41  split_config.arm64_v8a.apk      0x747fa77938        [inlined] std::_fl::__invoke_void_return_wrapper<T>::__call<T> (invoke.h:488)
42  split_config.arm64_v8a.apk      0x747fa77938        [inlined] std::_fl::__function::__alloc_func<T>::operator()[abi:v15000] (function.h:185)
43  split_config.arm64_v8a.apk      0x747fa77938        std::_fl::__function::__func<T>::operator() (function.h:359)
44  split_config.arm64_v8a.apk      0x747fa7772c        [inlined] std::_fl::function<T>::operator() (function.h:1187)
45  split_config.arm64_v8a.apk      0x747fa7772c        [inlined] fml::ThreadHandle::ThreadHandle::lambda::operator() (thread.cc:76)
46  split_config.arm64_v8a.apk      0x747fa7772c        fml::ThreadHandle::ThreadHandle::lambda::__invoke (thread.cc:73)
47  libc.so                         0x75a8f0a678        <unknown> + 505345517176
48  libc.so                         0x75a8ea730c        <unknown> + 505345110796

Code sample

Code sample ```dart [Paste your code here] ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Logs

Logs ```console [Paste your logs here] ```

Flutter Doctor output

Doctor output ```console [√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.19045.4651], locale de-DE) • Flutter version 3.22.0 on channel stable at C:\Users\escam\fvm\versions\3.22.0 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5dcb86f68f (2 months ago), 2024-05-09 07:39:20 -0500 • Engine revision f6344b75dc • Dart version 3.4.0 • DevTools version 2.34.3 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.2) • Android SDK at C:\Users\escam\AppData\Local\Android\sdk • Platform android-34, build-tools 33.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.2) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.6.33723.286 • Windows 10 SDK version 10.0.22000.0 [√] Android Studio (version 2022.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694) [√] VS Code, 64-bit edition (version 1.91.1) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.92.0 [√] Connected device (4 available) • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64 • Android 13 (API 33) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.4651] • Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.128 • Edge (web) • edge • web-javascript • Microsoft Edge 126.0.2592.113 [√] Network resources • All expected network resources are available. • No issues found! ```
jonahwilliams commented 3 months ago

@escamoteur do you have any more information on what the app is doing? Are you using experimental JNI? Do you have particular plugins? Are you able to repro? Without more context there isn't anything we can do with this.

escamoteur commented 3 months ago

Hi Jonah, if I had an idea I would tell you. We get this in Sentry. Only package with JNI I m aware of if cronet_http. Am 22. Juli 2024, 18:41 +0100 schrieb Jonah Williams @.***>:

@escamoteur do you have any more information on what the app is doing? Are you using experimental JNI? Do you have particular plugins? Are you able to repro? Without more context there isn't anything we can do with this. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

jonahwilliams commented 3 months ago

OK! that package definitely uses JNI:

https://github.com/dart-lang/http/blob/master/pkgs/cronet_http/lib/src/jni/jni_bindings.dart

knowing that, this is probably an issue with that packge, either a problem with object lifetimes, threading, missing API, null pointer, et cetera.

FYI @HosseinYousefi in case you have seen similar issues.

HosseinYousefi commented 3 months ago

globalEnv_CallObjectMethod is a package:jni method. I will also need more information to repro.

HosseinYousefi commented 3 months ago

@escamoteur What version of cronet_http are you using?

escamoteur commented 3 months ago

Sorry, I forgot it is 1.3.1 so maybe one of the recent fixes might already have solved this too

a-siva commented 3 months ago

//cc @brianquinlan

a-siva commented 2 months ago

This has been fixed in cronet-http 1.3.2

github-actions[bot] commented 2 months ago

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.