RN 0.83 Debug builds leak file descriptors and abort (SIGABRT) ~8 minutes after launch on OS 2.0 – Release unaffected

# :backhand_index_pointing_right: 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.

—

## :backhand_index_pointing_right: Playback Issues

—

```

N/A — the abort happens with or without playback (one run played no video at all).

```

—

## :backhand_index_pointing_right: 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)

Hi @Phi_Huynh,

Thank you for the detailed bug report on the file descriptor leak and SIGABRT in RN 0.83 Debug builds on OS 2.0, and for the controlled Debug/Release comparison, logs and crash reports.

Our team is investigating this issue, including your questions about inspecting open file descriptors and turning off individual dev features. We will provide an update as soon as we have more information. In the meantime, using Release builds for longer sessions, as you’re doing now, is the right approach.

To help with the investigation, could you please:

  1. Share the full log captures you mentioned, ideally for the controlled Debug run, from launch until the crash.
  2. Retest a Debug build on TV Ship/529 and let us know whether the crash still happens at around 8 minutes.

Thanks for helping us improve the Vega platform.

Warm regards,
Aishwarya

Hi Aishwarya, thanks for looking into this.

  1. Attached is the full loggingctl log -f capture for the controlled Debug run, from before launch (15:49:20 UTC) to after the abort (PID 28711, SIGABRT at 15:57:37 UTC): debug-crash-5_controlled-pair_full-log_launch-to-crash.log.gz.
  2. It still happens on TV Ship/529 (4.0.539433.0(3072cab629675a74)/529N). For example, a Debug build launched at 20:26:11 UTC was killed at 20:33:59 UTC (7m48s), and we saw the same ~8-minute kill on several other runs over the last two days, including with SDK 0.24.12112. Release builds on 529 are still fine.

Happy to capture a full log from a 529 run as well if that would help.

debug-crash-5_controlled-pair_full-log_launch-to-crash.log (18.2 MB)

Hi @Phi_Huynh,

Thank you for sharing the full log capture of the controlled Debug run and for retesting on TV Ship/529.

Our team has reproduced the issue, and a fix is included in an upcoming Vega OS update. The issue affects Debug builds only. Release builds and Appstore submissions are not affected.

Answers to your questions:

  1. Reading a running app’s open file descriptors: In Developer Mode, vda shell runs in its own sandbox with its own PID namespace, and each app also runs in its own PID namespace, so your app’s /proc/[pid]/fd isn’t visible from that shell. As a proxy, you can check the thread count, which is in plain text in every crash report (ACR), for example “Total Threads: 290”. A healthy RN 0.83 app typically runs with about 35 to 50 threads, so a much higher count at the abort points to this issue.

  2. Disabling individual dev features: there’s no flag to turn off the React DevTools connection or the Metro inspector in RN 0.83 Debug builds. Fast Refresh isn’t involved. Both connections retry every 2 seconds while nothing is listening. With only Metro running, the React DevTools connection to localhost:8097 keeps failing, and that’s what triggers the issue in your setup.

Until the update is available, you can use the following temporary workaround: keep both connections open for the whole Debug session.

Metro, as you have now

npm start
vda reverse tcp:8081 tcp:8081

plus a React DevTools frontend on 8097, left open for the whole session

npx react-devtools@6.1.5
vda reverse tcp:8097 tcp:8097

If you close React DevTools or stop Metro while the app is running, the app starts retrying again, so reopen it. You’ll need to restart the app to fully recover. If you work over SSH to a remote host, port 8097 must be reachable on the machine where your vda server runs, so forward 8097 the same way you forward 8081.

With both connected, a Debug session should run well past 8 minutes. If it still aborts at around 8 minutes, please let us know and share that crash report (ACR).

Thanks for helping us improve the Vega platform.

Warm regards,
Aishwarya

Hi @Phi_Huynh,

Following up on my previous reply about the Debug build abort at around 8 minutes. Could you share an update on whether keeping both Metro (8081) and React DevTools (8097) connected lets your Debug sessions run past 8 minutes?

If the app still aborts at around 8 minutes with both connected, please share the crash report (ACR) from that run.

Thanks for helping us improve the Vega platform.

Warm regards,
Aishwarya

Hi Aishwarya, we’re a different team (FOX Local) hitting the same issue, so here’s our data for your question. We can confirm the workaround.

Environment: Fire TV Stick (armv7), OS 2.0 TV Ship/532 (4.0.555992.0(3072cab629675a74)/532N), Vega SDK 0.24.12112, @amazon-devices/react-native-kepler 4.0.1+rn0.83.0, react-devtools-core 6.1.5.

Debug build setup Result
Metro connected, nothing on 8097 Failed 8m53s after launch
Metro connected, nothing on 8097 (repeat) Failed 8m41s after launch
Metro connected + WebSocket listener on 8097 (DevTools backend connected once, no retries) Ran 23.5 min with no errors; stopped manually
Embedded bundle (no Metro), app-side guard that stops the 8097 retries Ran 18+ min with no errors; stopped manually

On our device the failure shows up as thread exhaustion rather than EMFILE:

[KeplerScript-JavaScript] [Error: Exception in HostFunction: Resource temporarily unavailable]
Timer:ERROR:failed to create thread to dispatch timerEntry, err=11

After that, every JS timer fails. We didn’t get a crash report for the runs with both connections, because nothing crashed.

Request: the workaround doesn’t help debug builds installed with an embedded bundle (for example QA/CI builds), because there’s no machine to run Metro or React DevTools. In our case, QA builds stopped JS timers after about 8 minutes, so our 10-minute data polling never ran. Two questions:

  1. Which Vega OS version will contain the fix?
  2. Will it also cover the Metro inspector retry for embedded-bundle debug builds?

For anyone else hitting this, the retries come from the system bundle’s Libraries/Core/setUpReactDevTools.js. Its amznmod_react change calls connectToDevTools with websocket: null, so react-devtools-core creates a new WebSocket on every 2-second retry. Our temporary app-side guard wraps globalThis.WebSocket early in index.js. In __DEV__ with an embedded bundle, it returns an inert socket for ws://localhost:8097, so no retry is ever scheduled.