pichillilorenzo / flutter_inappwebview

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
https://inappwebview.dev
Apache License 2.0
3.18k stars 1.55k forks source link

SIGABRT occurs when headlessWebView.run() is running while flutter_background_service is running #1281

Open Pumpkin-J opened 2 years ago

Pumpkin-J commented 2 years ago

Environment

Flutter version: 3.0.4 Plugin version: 5.4.3+7 iOS version: 15.5 Xcode version: 13.4.1 Device information: iPhone 13 mini Emurator

Description

When headlessWebView.run() is executed while flutter_background_service is running, SIGABRT occurs and the application crashes. Is it possible to avoid this by using headressWebView?

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Triggered by Thread: 22

Last

Exception Backtrace:

0 CoreFoundation 0x7fff204055f4 exceptionPreprocess + 226 1 libobjc.A.dylib 0x7fff201a4a45 objc_exception_throw + 48 2 CoreFoundation 0x7fff204054e2 -[NSException initWithCoder:] + 0 3 WebKit 0x7fff297b4255 WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker() + 127 4 WebKit 0x7fff29894b3c WTF::Ref<WebKit::CompletionHandlerCallChecker, WTF::RawPtrTraits >::~Ref() + 48 5 WebKit 0x7fff29974836 WTF::BlockPtr<void (NSURLSessionAuthChallengeDisposition, NSURLCredential)> WTF::BlockPtr<void (NSURLSessionAuthChallengeDisposition, NSURLCredential)>::fromCallable<WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge(WebKit::WebPageProxy&, WebKit::AuthenticationChallengeProxy&)::$_15>(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge(WebKit::WebPageProxy&, WebKit::AuthenticationChallengeProxy&)::$_15)::'lambda'(void const*)::invoke(void const) + 18 6 libsystem_blocks.dylib 0x7fff2008c438 _Block_release + 130 7 flutter_inappwebview 0x107d3b915 0x107c8c000 + 719125 8 libswiftCore.dylib 0x7fff30ca0480 _swift_release_dealloc + 16 9 flutter_inappwebview 0x107d3b7f5 0x107c8c000 + 718837 10 libswiftCore.dylib 0x7fff30ca0480 _swift_release_dealloc + 16 11 flutter_inappwebview 0x107d3c55d block_destroy_helper.183 + 13 12 libsystem_blocks.dylib 0x7fff2008c438 _Block_release + 130 13 libsystem_blocks.dylib 0x7fff2008c438 _Block_release + 130 14 libsystem_blocks.dylib 0x7fff2008c438 _Block_release + 130 15 Flutter 0x10a85d969 flutter::PlatformMessageResponseDarwin::~PlatformMessageResponseDarwin() + 63 16 Flutter 0x10a85d990 flutter::PlatformMessageResponseDarwin::~PlatformMessageResponseDarwin() + 14 17 Flutter 0x10adb40e3 std::1::hash_table<std::1::hash_value_type<int, fml::RefPtr >, std::1::unordered_map_hasher<int, std::1::hash_value_type<int, fml::RefPtr >, std::1::hash, true>, std::1::unordered_map_equal<int, std::1::hash_value_type<int, fml::RefPtr >, std::1::equal_to, true>, std::1::allocator<std::1::hash_value_type<int, fml::RefPtr > > >::deallocate_node(std::1::hash_node_base<std::1::hash_node<std::1::hash_value_type<int, fml::RefPtr >, void>>) + 51 18 Flutter 0x10adb4092 std::1::hash_table<std::1::hash_value_type<int, fml::RefPtr >, std::1::unordered_map_hasher<int, std::1::hash_value_type<int, fml::RefPtr >, std::1::hash, true>, std::1::unordered_map_equal<int, std::1::hash_value_type<int, fml::RefPtr >, std::1::equal_to, true>, std::1::allocator<std::1::hash_value_type<int, fml::RefPtr > > >::~hash_table() + 18 19 Flutter 0x10adb1d89 flutter::PlatformConfiguration::~PlatformConfiguration() + 21 20 Flutter 0x10adb1513 std::1::unique_ptr<flutter::PlatformConfiguration, std::__1::default_delete >::reset(flutter::PlatformConfiguration*) + 25 21 Flutter 0x10adb0c4a flutter::UIDartState::~UIDartState() + 160 22 Flutter 0x10ae13ea8 flutter::DartIsolate::~DartIsolate() + 14 23 Flutter 0x10ae1e4f4 flutter::RuntimeController::~RuntimeController() + 212 24 Flutter 0x10ae1e608 flutter::RuntimeController::~RuntimeController() + 14 25 Flutter 0x10ac9a017 flutter::Engine::~Engine() + 231 26 Flutter 0x10acadfdf std::1::unique_ptr<flutter::Engine, std::1::default_delete >::reset(flutter::Engine*) + 25 27 Flutter 0x10acb13f0 std::1::function::__func<fml::internal::CopyableLambda<flutter::Shell::~Shell()::$_3>, std::1::allocator<fml::internal::CopyableLambda<flutter::Shell::~Shell()::$_3> >, void ()>::operator()() + 26 28 Flutter 0x10abaf25c fml::MessageLoopImpl::FlushTasks(fml::FlushType) + 164 29 Flutter 0x10abb53d8 fml::MessageLoopDarwin::OnTimerFire(CFRunLoopTimer, fml::MessageLoopDarwin) + 26 30 CoreFoundation 0x7fff20372d6e CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20 31 CoreFoundation 0x7fff2037283c CFRunLoopDoTimer + 915 32 CoreFoundation 0x7fff20371dfd CFRunLoopDoTimers + 265 33 CoreFoundation 0x7fff2036c3e1 CFRunLoopRun + 2016 34 CoreFoundation 0x7fff2036b704 CFRunLoopRunSpecific + 562 35 Flutter 0x10abb5515 fml::MessageLoopDarwin::Run() + 65 36 Flutter 0x10abaf16c fml::MessageLoopImpl::DoRun() + 22 37 Flutter 0x10abb433f void std::1::thread_proxy<std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete >, fml::Thread::Thread(std::1::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0> >(void) + 187 38 libsystem_pthread.dylib 0x7fff701cb4e1 _pthread_start + 125 39 libsystem_pthread.dylib 0x7fff701c6f6b thread_start + 15

Supplement

・On Android, both the real machine and the emulator work under the same conditions. ・flutter_background_service  https://pub.dev/packages/flutter_background_service

github-actions[bot] commented 2 years ago

👋 @Pumpkin-J

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

Jinxishihenian commented 5 months ago

I'M ALSO HAVING THE ISSUE AND IOS OS VERSION 15.5 AND THE USE CASE IS A CRASH WHEN A WEB PAGE LOADS A 3D MODEL AND TRIGGERS A LARGE NUMBER OF REQUESTS:

Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x0000000000000000, 0x0000000000000000 
Exception Note: EXC_CORPSE_NOTIFY

And it works fine in other OS versions