#
Bug Description
—
## 1. Summary
On Fire TV OS 2.0, every **Debug** build of our React Native 0.83 app aborts (SIGABRT) about 8 minutes after launch, regardless of what the app is doing. The process runs out of its 1024 open-file limit: in the seconds before the abort the graphics driver fails with `err=24` (EMFILE), or `std::random_device` fails to open. The leak is a steady ~2 descriptors per second from launch and is not tied to any screen, video playback or image loading. **Release** builds of the same code do not leak, including one that keeps all of our own logging and tracing. We believe the leak is in the RN 0.83 / KeplerScript Debug runtime or dev tooling.
**App Name**: STARZ
**App Link on Amazon Appstore**: [fill in]
**Bug Severity**
Select one that applies [x]
* [ ] Impacts operation of app
* [x] Blocks current development
* [ ] Improvement suggestion
* [ ] Issue with documentation
* [ ] Other
Debug sessions last at most ~8 minutes, which blocks any longer debugging session or soak test (for example live playback across Widevine key rotations) in Debug. Shipped (Release) builds are not affected.
## 2. Steps to Reproduce
1. Build and install a Debug package of an RN 0.83 app (Vega SDK 0.24.9859, armv7) on a Fire TV Stick running OS 2.0.
2. Start Metro and attach it: `vda reverse tcp:8081 tcp:8081`, then `vlcm launch-app orpheus://`.
3. Leave the app in the foreground; sitting idle on the home screen is enough. (OS 2.0 goes to Standby when idle, so we sent a D-pad Right/Left pair every 3 minutes to keep the app in the foreground.)
4. About 8 minutes after launch the app aborts. Building the same code as Release and repeating steps 3–4 does not reproduce it.
## 3. Observed Behavior
```
Every Debug run we timed aborted between 7m33s and 8m17s after launch, on two devices:
Launch (UTC) Abort (UTC) Time to abort What the app was doing
20:03:52 20:12:00 8m08s Live playback
21:17:14 21:25:31 8m17s Live playback
21:41:24 21:49:16 7m52s Idle on a details page, no video played at all, 159 image loads
17:39:10 17:46:43 7m33s Idle on Home, Reactotron disabled
15:49:41 15:57:39 7m58s Idle on Home (controlled run, see Additional Context)
Last lines before an abort during live playback (debug-crash-1_emfile_last-seconds.log):
E MESA:DMA_BUF_IOCTL_EXPORT_SYNC_FILE failed (err=24)
E MESA:panfrost_batch_submit failed: -1
E MESA:drmPrimeHandleToFD() failed (err=24)
E GWSI_LOG:604 Failed to get valid fence from 3D Driver. display = 0xaba05418
Another run (debug-crash-3_random_device_last-seconds.log):
ERROR Volta: Volta:Reporting Fatal Exception:
ERROR Volta: Volta:Error: Exception in HostFunction: random_device::random_device(const std::string&): device not available
When the app is idle with nothing redrawing, it aborts on the same clock without an err=24 line first.
Crash reports: CrashReason:SIGABRT, crashed thread ending in
libkeplerscript-runtime-loader-4.so.4.0 + 0x736db, and 284–306 threads in the process at each abort.
```
## 4. Expected Behavior
```
A Debug build should run indefinitely without leaking file descriptors, as the Release build of the same code does.
```
### 4.a Possible Root Cause & Temporary Workaround
```
Root cause: unknown, but bisected to Debug-only code. With the same app code:
Build Result
Debug (Metro attached) Aborts at ~8 min, every time
Debug with Reactotron removed from the app Aborts at 7m33s
Release Alive after 49 min of continuous live playback
(four Widevine key rotations); zero err=24
Release keeping all of our app logging and perf tracing Alive at 10m25s; zero err=24
(our KEEP_LOGS build)
So the leak is not in app code shared by Debug and Release, not in our logging, and not in
Reactotron. That leaves the KeplerScript Debug runtime or RN dev tooling (Metro / Fast Refresh
connection, LogBox, DevTools / inspector connection, or dev-mode React).
We could not count descriptors directly: `vda shell` runs in a sandboxed pid namespace and
cannot see /proc//fd.
Workaround: use Release builds for any session longer than a few minutes.
```
## 5. Logs or crash report
Attached:
* `debug-crash-1_emfile_last-seconds.log` — last seconds before an abort during live playback, showing the `err=24` cascade.
* `debug-crash-2_no-video_last-seconds.log` — last seconds before an abort with no video played.
* `debug-crash-3_random_device_last-seconds.log` — the `random_device` variant.
* `debug-crash-1b_live.acr`, `debug-crash-2_no-video.acr`, `debug-crash-4_reactotron-off.acr`, `debug-crash-5_controlled-pair.acr` — crash reports for four of the aborts, including the controlled Debug run.
* Full `loggingctl log -f` captures for each run are available on request.
## 6. Environment
* **SDK Version:** Active SDK Version 0.24.9859, Vega CLI Version 1.2.22
* **React Native Version:** RN 0.83 (`react-native` 0.83.0, `@amazon-devices/react-native-kepler` 4.0.1+rn0.83.0)
* **App State:** Foreground
* **Devices:** two Fire TV Stick (callie, armv7) units, serial GT533M0751441WDB and a second unit over Wi-Fi.
* **OS Information:** every crash report above records `OsBuildNumber:2602000051520`, `SystemVersion:4.0.512374.0(3072cab629675a74)/515N` (OS 2.0, TV Ship/515). After the last run the USB stick updated to TV Ship/529; we have not re-tested on 529 yet. Current `cat /etc/os-release` on that stick:
```
NAME=“OS”
OE_VERSION=“4.0.0”
OS_MAJOR_VERSION=“2”
OS_MINOR_VERSION=“0”
RELEASE_ID=“26”
OS_VERSION=“2.0”
BRANCH_CODE=“TV Ship”
BUILD_DESC=“OS 2.0 (TV Ship/529)”
BUILD_FINGERPRINT=“4.0.539433.0(3072cab629675a74)/529N:user/release-keys”
BUILD_VARIANT=“user”
BUILD_TAGS=“release-keys”
BUILD_DATE=“Sat Oct 17 02:49:03 UTC 2026”
BUILD_TIMESTAMP=“1792205343”
VERSION_NUMBER=“2602000052920”
```
## 7. Example Code Snippet / Screenshots / Screengrabs
No specific component triggers it; the app aborts while idle. Relevant configuration:
```
// react-native.config.js
module.exports = {
project: {
kepler: {
runtimeFeatures: {
PLATFORM_DENSITY_INDEPENDENT_PIXEL: false,
},
},
},
};
// Debug package: react-native build-kepler --build-type Debug --target armv7
// JS served from Metro: npm start, vda reverse tcp:8081 tcp:8081
```
We have not yet reproduced it with a minimal new RN 0.83 app; we can try that if it would help.
—
##
Playback Issues
—
```
N/A — the abort happens with or without playback (one run played no video at all).
```
—
##
Additional Context
—
```
Controlled pair, same device and conditions (USB stick, both builds on the same backend, app idle
on Home in the foreground, a Right/Left key pair every 3 minutes to prevent Standby, foreground
state sampled every minute):
Build Launch (UTC) Result
Release 15:24:32 Same instance in the foreground at every sample through 15:44:38 (20+ min);
zero err=24; no crash entry
Debug 15:49:41 Aborted at 15:57:39 (7m58s), in the foreground until then
Questions:
1. Is there a supported way to read a running app’s open file descriptors on a retail device,
or a Debug runtime flag that logs them?
2. Is this a known issue in the RN 0.83 Debug runtime on OS 2.0, and is there a flag to disable
individual dev features (inspector/DevTools connection, Fast Refresh) so we can narrow it
further?
```
debug-crash-1_emfile_last-seconds.log (69.7 KB)
debug-crash-1b_live.acr (1.1 MB)
debug-crash-2_no-video_last-seconds.log (11.6 KB)
debug-crash-2_no-video.acr (940.9 KB)
debug-crash-3_random_device_last-seconds.log (3.7 KB)
debug-crash-4_reactotron-off.acr (1.1 MB)
debug-crash-5_controlled-pair.acr (1.0 MB)
report.md (7.5 KB)