Webview is crashing when error handlers are triggered

Description

App Name: Peacock
App Link on Amazon Appstore [N/A]

The team noticed that Webview has some unexpected behaviour when handling error scenarios.

We’ve stripped down the app to just an error boundary and a webview loading a faulty URL which should force a webview onError. Looking at the crash logs from that scenario, as far as we can see, it seems to be a side effect from simply destroying the webview component - the fatal native error that forces the OS to terminate the app happens in the native Webview component’s C++ class destructor. Specifically, destroying the webview component after a webview onError or onHttpError event is fired.

For debugging purposes, the team created a debug overlay component that triggers both a 404 error and an unresolved URL error.

Steps to reproduce

(Using debug build shared with POC)

  1. Launch the app
  2. Double click the remote menu button to open the debug overlay component
  3. Choose 404 option, error screen will show. Retry button a couple times.
  4. Repeat process but choose unresolved URL option. Error screen will show. Retry button a couple times.

The current behavior

(Write your answer here.)
When webview handles an error scenario, sometimes it crashes.

The expected behavior

(Write your answer here.)
Webview should not crash when handling error scenarios.

Is this a blocker? Do you have any workarounds?

Although it could be user impacting, it would be a side effect of bad user network scenarios anyway, so the app would be unlikely to load in this case anyway, but we’d still prefer to present the error screen reliably.

Code example

(Write your answer here.)

System information

Checking installation status at /Users/ncr20/.kepler/kntools/sdk/0.19.6
A different location can be specified via environment variable KEPLER_SDK_PATH.

βœ” System: macOS 15.5
  Architecture: aarch64
βœ” Rosetta not enabled
βœ” username and token found in knrc file
βœ” git found in the path
βœ” curl found in the path
βœ” Node.js binary compiled for aarch64
βœ” VSCode found in the path
βœ” XCode Command Line Tools is up to date
βœ” /Users/ncr20/.kepler/kntools/sdk/0.19.6 exists; /Users/ncr20/.kepler/kntools exists
βœ” licenses and legal notices found in /Users/ncr20/.kepler/kntools/sdk/0.19.6
βœ” Installed system packages:
  autossh 1.4g
  binutils 2.44
  coreutils 9.5
  gawk 5.3.1
  findutils 4.10.0
  glib 2.84.0_1
  gnutls 3.8.4
  grep 3.11
  jpeg 9f
  jq 1.7.1
  libepoxy 1.5.10
  libpng 1.6.47
  libslirp 4.9.0
  libssh 0.11.1
  libusb 1.0.27
  lzo 2.10
  lz4 1.10.0
  nettle 3.10.1
  openssh 9.9p2
  pixman 0.44.2
  sdl2 2.32.4
  snappy 1.2.1
  tmux 3.5a
  unzip 6.0_8
  vde 2.3.3
  xz 5.8.1
  gnu-sed 4.9
  watchman 2025.03.10.00
  zstd 1.5.7
βœ” pyenv version 2.5.7 installed
βœ” python version 3.12.6 installed
βœ” pip version 24.2 installed
βœ” pyenv virtualenv version 1.2.4 installed
βœ” virtualenv 'kepler-0.19.6' created
βœ” Installed Python packages: 
  conan 2.0.17
  docopt 0.6.2
  flatbuffers 23.5.26
  langcodes 3.3.0
  psutil 7.0.0
  PyYAML 6.0.1
  tomli 2.0.1
  wheel 0.41.3
  zstandard 0.22.0
βœ” debugger server found
βœ” simulator exists at /Users/ncr20/.kepler/kntools/sdk/0.19.6/simulator/tools/runsimulator
βœ” vda version 2.1.0 installed
βœ” Vega Packaging Tools vpt binary exists in /Users/ncr20/.kepler/kntools/sdk/0.19.6/vegapackagingtool/bin/vpt
βœ” Hermes Compiler binary exists at /Users/ncr20/.kepler/kntools/sdk/0.19.6/hermes/072/bin/hermesc
βœ” kvdi skipped since simulator is installed
βœ” kvd-tv skipped since simulator is installed
βœ” Heaptrack Tools binaries exist in /Users/ncr20/.kepler/kntools/sdk/0.19.6/heaptrack_prebuilts
βœ” Kepler Debugging Tools binaries exist in /Users/ncr20/.kepler/kntools/sdk/0.19.6/kepler_debugging_tools/tools/scripts
βœ” Kepler Manifest Module Remapper amzn-kepler-manifest-module-remapper binary exists in /Users/ncr20/.kepler/kntools/sdk/0.19.6/kepler_manifest_module_remapper/bin/amzn-kepler-manifest-module-remapper
βœ” CPU profiling tool for performance analysis binaries exist in /Users/ncr20/.kepler/kntools/sdk/0.19.6/simpleperf_prebuilts
βœ” Corretto JDK version 11.0.20.8.1 installed
βœ” Kepler Performance CLI binaries exist in /Users/ncr20/.kepler/kntools/sdk/0.19.6/kepler_perf_cli
βœ” Kepler Studio extensions installed in VSCode
βœ” environment setup file exists at /Users/ncr20/.kepler/kntools/sdk/0.19.6/environment-setup-sdk.sh and has correct contents
βœ” /Users/ncr20/.kepler/kntools/sdk/0.19.6/environment-setup-sdk.sh is sourced from /Users/ncr20/.zprofile
βœ” Telemetry Service exists at /Users/ncr20/.kepler/kntools/sdk/0.19.6/kepler-telemetry/telemetry. Configuration file exists at /Users/ncr20/.kepler/kntools/sdk/0.19.6/kepler-telemetry/config.json. Collection of anonymous usage data is enabled


Kepler CLI prerequisites are all correctly installed.

✨  Done in 24.99s.

Logs or crash report

Crash logs excerpt:

#0  0x9fbf8c2e in logging::LogMessage::HandleFatal(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#1  0x9fbf89de in logging::LogMessage::Flush() () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#2  0x9fbf8ca2 in logging::LogMessageFatal::~LogMessageFatal() () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#3  0xa251f0f4 in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_webview.so
#4  0x9f6e3380 in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#5  0x9f6e2b9e in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#6  0x9f6e38ba in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#7  0x9f6e1866 in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#8  0x9f617190 in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#9  0x9f6a449e in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#10 0x9f6a553a in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#11 0x9f6d5bbe in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#12 0x9f631dfa in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#13 0x9f7b7160 in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#14 0x9f7b792a in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_slatium.so
#15 0xa250ae6e in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_webview.so
#16 0xa250aec2 in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkepler_webview.so
#17 0xa25e383a in ?? ()
#18 0xa25e121a in volta::WebViewRenderObject::~WebViewRenderObject() ()
#19 0xb442375c in ?? () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libtoolkit-core.so.2.0
#20 0xb4466f86 in volta::RenderObject::~RenderObject() () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libtoolkit-core.so.2.0
#21 0xb522f5a2 in volta::react::KeplerViewComponent::~KeplerViewComponent() () from /private/var/folders/0h/18z4grwj7cdc77358vxn8q100000gp/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#22 0xa25b1204 in ?? ()

on-error-crash.txt (3.0 MB)

Additional Info

Hi @Nuno_Castro ,

We have reported this to our internal team.

Thanks,
Rohit

1 Like

Hi @Nuno_Castro ,

Could you please provide more detailed steps to reproduce with screenshots for triggering this crash? Our team tried the steps you provided in description, but could not find 404 option so.

Thanks,
Rohit

Hi @Nuno_Castro ,

We are closing this post for now due to inactivity.

Please feel free to create a new post if required.

Thanks,
Rohit

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.