SIGSEGV in libGLESv2_adreno.so during RenderContextGLImpl::flush (Android, Factory.rive)

Repo to file in: rive-app/rive-flutter (the native frames are in `rive_native`, so rive-runtime may be the better home. Rive can move it.)


## Summary


Our production Android app crashes with SIGSEGV inside Qualcomm's Adreno GLES driver. The crash comes from `rive::gpu::RenderContextGLImpl::flush`, called from the `Factory.rive` renderer. The crash happens on a full-screen Rive animation. It is spread across many devices and OS versions, and we cannot reproduce it on demand.


## Environment


| Item | Value |

|---|---|

| `rive` | 0.14.11 |

| `rive_native` | 0.1.11 |

| Flutter | 3.44.7 |

| Platform | Android only (no iOS crashes on this screen) |

| Renderer | `Factory.rive` (the default) |

| Android versions seen | 9 to 17 |

| ABI | arm64-v8a (in the stacks we read) |

| GPU | Adreno (the trace shows `libGLESv2_adreno.so`). We do not have the GPU model per crash. |


## Stack trace


Representative crash (from a sample of 100 events, every one has the same Rive frame):


```

NDK crash detected with signal: SIGSEGV


0  [vdso]                     __kernel_rt_sigreturn+0

1  libc.so                    memcpy+108

2  libGLESv2_adreno.so        pc 003d5e7c

3  libGLESv2_adreno.so        pc 001bb238

4  libGLESv2_adreno.so        pc 001b2684

5  librive_native.so          ZN4rive3gpu19RenderContextGLImpl5flushERKNS015FlushDescriptorE+6908

6  librive_native.so          ZN4rive3gpu13RenderContext5flushERKNS114FlushResourcesE+2780

7  librive_native.so          flush+464

```


All 100 sampled events end in the same Rive frame (`RenderContextGLImpl::flush`). The Adreno offsets differ between events, so more than one driver build is probably involved. We did not compare the Adreno frames across all 100 events. In 96 of the 100, the first frame is `libc.so` with no symbol. In the other 4 it is `memcpy`.


## How often it happens


Data is from our crash reporting, Android only, for one screen.


- Last 7 days: 178 Rive/Adreno crashes on this screen, across 168 distinct users and 178 sessions. Most users crash once.

- No single device model dominates (the highest has 2 crashes). By brand: Samsung 88, Motorola 74, OnePlus 7, Google 4, others 5.

- Rate: about 5 crashes per 100 views of the screen on app versions that ship `rive` 0.14.11 (5.3, 5.4 and 6.1 across three releases).

- We shipped `rive` 0.14.4 / `rive_native` 0.1.4 before. The rate on those builds (our app versions 3.109 to 3.115) was similar: about 4 to 8 per 100 views. The two oldest builds in our 90-day window were higher (26 and 31 per 100 views), and we do not know why the rate fell. So the 0.14.11 upgrade did not cause the crash and did not fix it.


## What the animation does


- One `RiveWidget` with `Fit.fill`, full screen, behind the app bar.

- The file loads from a CDN URL, with data binding (view model) and trigger inputs fired from Flutter.

- The Rive file is decoded ahead of time ("prewarmed") on an earlier screen and may be shared between widgets that use the same file. We do not think this is related (rate did not change when it shipped) but we are mentioning it.


## What we do not know


- We have no reliable repro. It does not happen on our test devices.

- We do not know the exact Adreno GPU or driver version for each crash.

- We do not know if the crash relates to the render texture size. Our widget uses the default `RenderResolution.display()`.

- We have not tried `Factory.flutter` for this animation yet.


## Questions


1. Is this a known Adreno driver issue with the Rive GL renderer (the `memcpy` in the driver during `flush`)?

2. Is there a workaround, for example a texture size cap with `RenderResolution`, or avoiding a particular feature in the artboard?

3. Is there a debug build of `rive_native` that logs the buffer sizes passed to the driver in `flush`? We can run it in a staged rollout.

4. Which information would help you most? We can add GPU model and driver version to our crash reports if you tell us what to collect.