Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Segfault OOM when displaying Icon widgets with Shadows #164303

Closed
@mootw

Description

@mootw

Steps to reproduce

  1. Create a new flutter project on flutter 3.29.0 and use the code provided in main.dart. On my phone, after reaching around 600 to 1400 icons, the app crashes due to an out of memory segfault and it lags heavily up until then. Remove line 64: shadows: [const Shadow(blurRadius: 4)],, and there is no crash (i let it run up to 6000 easily with no shadows). I tested on a Z flip 6 running android 14 (oneui 6.1.1)

Expected results

No crash

Actual results

Crash

Code sample

Code sample
import 'dart:async';
import 'dart:math';

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _count = 200;

  @override
  void initState() {
    // TODO: implement initState
    Timer.periodic(Duration(seconds: 1), (_) {
      setState(() {
        _count += 50;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text('~ $_count'),
            for (int x = 0; x < sqrt(_count); x++)
              Row(
                children: [
                  for (int y = 0; y < sqrt(_count); y++)
                    Icon(
                      shadows: [const Shadow(blurRadius: 4)],
                      Icons.bolt,
                      size: 14,
                      color: Colors.grey[300],
                    ),
                ],
              ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
W/Adreno-GSL(23604): <sharedmem_gpuobj_alloc:3544>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
E/Adreno-GSL(23604): <gsl_memory_alloc_pure_64:3791>: ERROR: kgsl_sharedmem_alloc() failed! Allocation size: (16 KB); Flags: (0x890c2500)
F/libc    (23604): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c in tid 23670 (1.raster), pid 23604 (.segfault_icons)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/b6quew/b6q:14/UP1A.231005.007/F741U1UES2AYA7:user/release-keys'
Revision: '14'
ABI: 'arm64'
Processor: '7'
Timestamp: 2025-02-27 09:36:20.330140268-0600
Process uptime: 13s
Cmdline: com.example.segfault_icons
pid: 23604, tid: 23670, name: 1.raster  >>> com.example.segfault_icons <<<
uid: 10451
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x000000000000001c
Cause: null pointer dereference
    x0  00000000ffffffff  x1  0000000000000000  x2  0000007057b79c44  x3  0000006c3b4152b8
    x4  0000000000000248  x5  0000000013f61ace  x6  0000000000000000  x7  7f7f7f7f7f7f7f7f
    x8  00000000ffffffff  x9  000000000058017e  x10 0000000000000320  x11 0000000000000002
    x12 000000000000ea4c  x13 0000006c0d5afe24  x14 0000000000004000  x15 0000000000000000
    x16 0000000000000000  x17 0000007057ae0488  x18 0000006c140b8000  x19 b400006dd8e62250
    x20 0000000000000003  x21 0000000000000001  x22 0000000000000003  x23 00000000ffffffff
    x24 0000000000000000  x25 0000000000000001  x26 0000000000000000  x27 0000000000000000
    x28 b400006e15208fe0  x29 0000006c3b4153c0
    lr  0000006c0d54730c  sp  0000006c3b4153b0  pc  0000006c0d54724c  pst 0000000060001000
47 total frames
backtrace:
      #00 pc 00000000000d524c  /vendor/lib64/hw/vulkan.adreno.so (!!!0000!65bb4f16e1c4caf7a56f18c58bd23d!11e73fe00cb!+252) (BuildId: 78d1f327f7b2936485f1cd8cd2abd2b1)
      #01 pc 000000000010aa04  /vendor/lib64/hw/vulkan.adreno.so (!!!0000!5d51db99116934eb298ea0edb653cf!11e73fe00cb!+2228) (BuildId: 78d1f327f7b2936485f1cd8cd2abd2b1)
      #02 pc 000000000010921c  /vendor/lib64/hw/vulkan.adreno.so (!!!0000!803c04a83cada1864e63faf3eba95b!11e73fe00cb!+412) (BuildId: 78d1f327f7b2936485f1cd8cd2abd2b1)
      #03 pc 00000000000ff350  /vendor/lib64/hw/vulkan.adreno.so (!!!0000!a8a5578ec7eb449d8c8076f2948068!11e73fe00cb!+880) (BuildId: 78d1f327f7b2936485f1cd8cd2abd2b1)
      #04 pc 00000000000fd3b0  /vendor/lib64/hw/vulkan.adreno.so (qglinternal::vkCmdBeginRenderPass(VkCommandBuffer_T*, VkRenderPassBeginInfo const*, VkSubpassContents)+960) (BuildId: 78d1f327f7b2936485f1cd8cd2abd2b1)
      #05 pc 0000000000028428  /system/lib64/libvulkan.so (vulkan::api::(anonymous namespace)::CmdBeginRenderPass(VkCommandBuffer_T*, VkRenderPassBeginInfo const*, VkSubpassContents)+136) (BuildId: 9b06a1f4deaf795678bf690c75f1f9af)
      #06 pc 0000000002129b38  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #07 pc 0000000002110f34  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #08 pc 0000000001d921f8  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #09 pc 00000000020c82d8  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #10 pc 00000000020c8230  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #11 pc 00000000020d9c9c  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #12 pc 00000000020d9480  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #13 pc 00000000020d7b3c  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #14 pc 00000000020d7a20  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #15 pc 00000000020ebfec  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #16 pc 00000000020b5320  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #17 pc 00000000020b6674  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #18 pc 0000000001d6ddac  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #19 pc 00000000020baa7c  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #20 pc 0000000001d6e4dc  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #21 pc 0000000001d6d864  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #22 pc 0000000001d6dcfc  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #23 pc 00000000020bbdc0  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #24 pc 00000000021bfa80  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #25 pc 000000000203730c  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #26 pc 00000000020371ec  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #27 pc 0000000002037274  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #28 pc 000000000214a0e8  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #29 pc 0000000002149b9c  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #30 pc 0000000002148a38  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #31 pc 000000000214940c  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #32 pc 000000000214afd4  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #33 pc 0000000002148ea8  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #34 pc 0000000002148c40  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #35 pc 0000000002157370  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #36 pc 0000000001d077dc  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #37 pc 0000000001d0d364  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #38 pc 0000000000018b70  /system/lib64/libutils.so (android::Looper::pollInner(int)+1252) (BuildId: a0e0ad47138267db6c479fc556e32d00)
      #39 pc 0000000000018628  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+124) (BuildId: a0e0ad47138267db6c479fc556e32d00)
      #40 pc 000000000001a184  /system/lib64/libandroid.so (ALooper_pollOnce+104) (BuildId: eed5d73f8789bca316be244a36f12599)
      #41 pc 0000000001d0d2ec  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #42 pc 0000000001d07728  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #43 pc 0000000001d0b5d0  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #44 pc 0000000001d0b468  /data/app/~~9THvwvO-pgtz9Mao7HzQ9Q==/com.example.segfault_icons-8NcS66-EN2_Q9LyOS0wHiw==/lib/arm64/libflutter.so (BuildId: 816a1a1c92b262314abb1fe2e9ff814ce75bf278)
      #45 pc 00000000000c37b4  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: 37f537c2ba9dcbb262a0a68f41a21da4)
      #46 pc 000000000005d084  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: 37f537c2ba9dcbb262a0a68f41a21da4)

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.0, on Arch Linux 6.13.4-arch1-1, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2024.2)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consolec: fatal crashCrashes that terminate the processe: impellerImpeller rendering backend issues and features requestsengineflutter/engine repository. See also e: labels.found in release: 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions