openmultiplayer / openmultiplayer/open.mp

Console reader permanently dies on Linux when fd 0 becomes non-blockin

Open
#1,268 0 comments 0 reactions 1 assignee View on GitHub

@AmyrAhmady is already working on this.

Since Sep 10, 2026.

bug nightly
Dominant language
C++
Stars
641
Forks
208
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

On Linux, the server console stops responding to typed commands after a plugin/component puts stdin (fd 0) into non-blocking mode.
The Console still echoes keystrokes and accepts Enter, but no command is executed and even Unknown command or variable: is never printed.

Windows is unaffected, Under Windows, the Node environment does not receive events from stdin.
However, this changes under Linux.

To Reproduce

This is a edge case, I encountered it in the samp-node environment, but I suspect that omp-node same.
I have tried passing kNoStdioInitialization to node::InitializeOncePerProcess, but it seems to have no effect.
This probably caused by node libuv behavior.

I don't know if the same issue exists for stdin in other languages, such as omp-rs, ompgo, sampsharp?
You will encounter it when you use the node:process, and many packages you depend on will be used, such as mysql.

import process from "node:process";
process.stdin.on('data', (chunk) => {
  console.log(`Received data: ${chunk}`);
});

Enter anything on the console, such as foo
For the first time, you can see something like Unknown command or variable: foo
After that, no matter what you type in, there's just an echo

Expected behavior

Console should remain in blocking mode of fd0 and should not be affected by plugins or components for compatibility.

Screenshots and/or logs

Showing echo but no server response.
No crash, no error in the log.

Image

Commit hash in master

91a38854

Additional context
I've already run one actions, so if anyone needs to test?
https://github.com/dockfries/open.mp/actions/runs/34498389091

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.