[GH-ISSUE #458] Segmentation fault when using <input /> #119

Closed
opened 2026-03-02 23:44:41 +03:00 by kerem · 6 comments
Owner

Originally created by @superhighfives on GitHub (Dec 30, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/458

Originally assigned to: @msmps on GitHub.

First off, opentui is awesome. Thanks for releasing it open source. Came across a bug today that I thought worth sharing. I have an app that stores and runs commands. Here's some screenshots recreating the bug:


Image Image Image

This code example shows a crash I'm getting on macOS Tahoe 26.2. When I run a command which has an input, the app crashes. To recreate, try running greet interactively with bun run src/index.tsx.

The quirk is that it only occurs when the search in the interactive menu is an <input /> (in CommandList.tsx). If I change that to <text /> and add the events manually, it doesn't crash. You can see an example of it working on main:

~/Development/projects/comma main !3 ?5                                                                                                                                                                                                                                                   07:06:02 PM
❯ npm run dev

> comma@0.1.0 dev
> bun run --watch src/index.tsx

============================================================
Bun v1.3.4 (5eb2145b) macOS Silicon
macOS v26.2
CPU: fp aes crc32 atomics
Args: "bun" "run" "--watch" "src/index.tsx"
Features: Bun.stdin(2) Bun.stdout(2) debugger fetch jsc transpiler_cache tsconfig 
Builtins: "bun:ffi" "bun:main" "node:buffer" "node:console" "node:events" "node:fs" "node:fs/promises" "node:os" "node:path" "node:stream" "node:url" "node:util" 
Elapsed: 2264ms | User: 156ms | Sys: 38ms
RSS: 104.89MB | Peak: 107.30MB | Commit: 1.07GB | Faults: 72 | Machine: 51.54GB

panic(main thread): Segmentation fault at address 0x103BA00B0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.3.4/Mr15eb2145gDsgpgC____mrki+Cmrki+Cmrki+Cmrki+C_235h+Cmrki+C____mrki+Cmrki+C235h+Cmrki+C_A2Cgrgo3D

--- Bun is auto-restarting due to crash [time: 1767063967022] ---

You can check it out here:
https://github.com/superhighfives/comma/pull/1

Originally created by @superhighfives on GitHub (Dec 30, 2025). Original GitHub issue: https://github.com/anomalyco/opentui/issues/458 Originally assigned to: @msmps on GitHub. First off, `opentui` is awesome. Thanks for releasing it open source. Came across a bug today that I thought worth sharing. I have an app that stores and runs commands. Here's some screenshots recreating the bug: --- <img width="427" height="167" alt="Image" src="https://github.com/user-attachments/assets/afd5f1a7-e026-42a6-a653-5432ff068d9d" /> <img width="559" height="201" alt="Image" src="https://github.com/user-attachments/assets/526f2d41-88d7-4c00-a3eb-85e2edfdf45d" /> <img width="494" height="318" alt="Image" src="https://github.com/user-attachments/assets/38c45fdb-65e3-41ed-891a-cff7d2ae19f4" /> --- [This code example](https://github.com/superhighfives/comma/pull/1) shows a crash I'm getting on macOS Tahoe 26.2. When I run a command which has an input, the app crashes. To recreate, try running `greet` interactively with `bun run src/index.tsx`. The quirk is that it only occurs when the search in the interactive menu is an `<input />` (in `CommandList.tsx`). If I change that to `<text />` and add the events manually, it doesn't crash. You can see an example of it working on [main](https://github.com/superhighfives/comma): ```bash ~/Development/projects/comma main !3 ?5 07:06:02 PM ❯ npm run dev > comma@0.1.0 dev > bun run --watch src/index.tsx ============================================================ Bun v1.3.4 (5eb2145b) macOS Silicon macOS v26.2 CPU: fp aes crc32 atomics Args: "bun" "run" "--watch" "src/index.tsx" Features: Bun.stdin(2) Bun.stdout(2) debugger fetch jsc transpiler_cache tsconfig Builtins: "bun:ffi" "bun:main" "node:buffer" "node:console" "node:events" "node:fs" "node:fs/promises" "node:os" "node:path" "node:stream" "node:url" "node:util" Elapsed: 2264ms | User: 156ms | Sys: 38ms RSS: 104.89MB | Peak: 107.30MB | Commit: 1.07GB | Faults: 72 | Machine: 51.54GB panic(main thread): Segmentation fault at address 0x103BA00B0 oh no: Bun has crashed. This indicates a bug in Bun, not your code. To send a redacted crash report to Bun's team, please file a GitHub issue using the link below: https://bun.report/1.3.4/Mr15eb2145gDsgpgC____mrki+Cmrki+Cmrki+Cmrki+C_235h+Cmrki+C____mrki+Cmrki+C235h+Cmrki+C_A2Cgrgo3D --- Bun is auto-restarting due to crash [time: 1767063967022] --- ``` You can check it out here: https://github.com/superhighfives/comma/pull/1
kerem 2026-03-02 23:44:41 +03:00
Author
Owner

@msmps commented on GitHub (Dec 30, 2025):

Hey @superhighfives, thanks for reporting this! It looks like your reproduction is inaccessible at the moment.

<!-- gh-comment-id:3698805789 --> @msmps commented on GitHub (Dec 30, 2025): Hey @superhighfives, thanks for reporting this! It looks like your reproduction is inaccessible at the moment.
Author
Owner

@superhighfives commented on GitHub (Dec 30, 2025):

Well, that is deeply embarassing. Made it public. Thanks for flagging, @msmps. 😊

<!-- gh-comment-id:3700078666 --> @superhighfives commented on GitHub (Dec 30, 2025): Well, that is deeply embarassing. Made it public. Thanks for flagging, @msmps. 😊
Author
Owner

@msmps commented on GitHub (Jan 1, 2026):

Well, that is deeply embarassing. Made it public. Thanks for flagging, @msmps. 😊

I will continue to dive into this when time allows this weekend but it feels like the cause is the renderer.destroy() call in the onExit method! It looks like the renderer is still trying to interact with something during this (perhaps a focus call on the input)

This is a strange one!

<!-- gh-comment-id:3704167477 --> @msmps commented on GitHub (Jan 1, 2026): > Well, that is deeply embarassing. Made it public. Thanks for flagging, [@msmps](https://github.com/msmps). 😊 I will continue to dive into this when time allows this weekend but it feels like the cause is the `renderer.destroy()` call in the `onExit` method! It looks like the renderer is still trying to interact with something during this (_perhaps a focus call on the input_) This is a strange one!
Author
Owner

@superhighfives commented on GitHub (Jan 4, 2026):

Sounds good! Happy to help however I can, and for full disclosure this was a largely vibe-coded-with-the-docs project, so I may be using renderer.destroy() incorrectly. Thanks @msmps!

<!-- gh-comment-id:3707485533 --> @superhighfives commented on GitHub (Jan 4, 2026): Sounds good! Happy to help however I can, and for full disclosure this was a largely vibe-coded-with-the-docs project, so I may be using `renderer.destroy()` incorrectly. Thanks @msmps!
Author
Owner

@msmps commented on GitHub (Jan 7, 2026):

@superhighfives This should be fixed now and in main soon! If you could test with this snapshot 🤞

@opentui/core@0.0.0-20260106-bb82df43
@opentui/react@0.0.0-20260106-bb82df43
<!-- gh-comment-id:3718063604 --> @msmps commented on GitHub (Jan 7, 2026): @superhighfives This should be fixed now and in main soon! If you could test with this snapshot 🤞 ```sh @opentui/core@0.0.0-20260106-bb82df43 @opentui/react@0.0.0-20260106-bb82df43 ```
Author
Owner

@superhighfives commented on GitHub (Jan 8, 2026):

Awesome, tested and fixed. Thanks so much! 😊

<!-- gh-comment-id:3725375552 --> @superhighfives commented on GitHub (Jan 8, 2026): Awesome, tested and fixed. Thanks so much! 😊
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#119
No description provided.