Skip to content

[Android] Crash (SIGSEGV in GLFunctorDrawable) when a ScrollView containing an off-screen WebView is overscrolled — regression in 10.0.100 #38080

Description

@kellymmcd

Description

Scrolling a ScrollView to either extreme kills the process with a native SIGSEGV on the render thread, when the ScrollView contains a WebView that is currently scrolled out of view.

It also crashes on back navigation, not just scrolling.

Works on 10.0.60, crashes on 10.0.100.

Steps to Reproduce

  1. New MAUI app on Microsoft.Maui.Controls 10.0.100.
  2. Replace MainPage with the code below.
  3. Deploy to Android and fling to the bottom or the top.
  4. App will crash

MainPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiWebViewCrash.MainPage">
    <ScrollView>
        <VerticalStackLayout x:Name="ContentStack" Padding="12" Spacing="12" />
    </ScrollView>
</ContentPage>

MainPage.xaml.cs

namespace MauiWebViewCrash;

public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();

        AddFiller(50);

        // Single WebView, mid-list, so it is off screen at both extremes.
        ContentStack.Add(new WebView
        {
            HeightRequest = 220,
            Source = new HtmlWebViewSource
            {
                Html = "<html><body style='background:#d6e4ff'><h3>WebView</h3></body></html>"
            }
        });

        AddFiller(50);
    }

    private void AddFiller(int rows)
    {
        for (int i = 1; i <= rows; i++)
        {
            ContentStack.Add(new Label { Text = $"Filler row {i}", FontSize = 20 });
        }
    }
}

Link to public reproduction project repository

No response

Version with bug

10.0.100

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

10.0.60

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

WebViewHandler.Mapper.AppendToMapping("SoftwareLayer", (handler, _) =>
    handler.PlatformView.SetLayerType(Android.Views.LayerType.Software, null));

Relevant log output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions