Skip to content

CRITICAL LibUV Bug Kills whole server before route execution #10241

@AjaniBilby

Description

@AjaniBilby

Edited to summarise so far

There are potentially two issues, one which can only take down a development server, and once which can take down a production remix.js * express.js server (haven't tested on other adapters).

Both issues trigger the same libuv assertion which is not handled anywhere causing the entire node instance to exit.
The lowest JS function which ends up calling the libuv function has not yet be found and may not be part of remix.js, but it does affect remix.js servers so I'll keep this issue open until the true fault is found.

Note, this crash is causing the server to close so fast that the console.log buffers are not flushed which makes finding the culpret function quite annoying.

Reproduction

  1. Clone AjaniBilby/remix-lib-uv-assert
  2. Install deps npm i

Malformed URL

  1. Start the development server npm run dev
  2. Make the following curl request
curl -i -X POST \
   -d \
'{}' \
'http://localhost:3000/api/address/validate/%E1%9C%84%C8%BAy%F0%90%9E%B2:%F0%9E%A2%A2%F0%98%B4%87%F0%90%80%80'%C2%A53%CC%9E[%3Ci$?%F0%9C%BC%86%DF%8E%EF%BF%BDC%EF%BF%BD%E2%80%97%F0%91%84%BC%E3%81%B6%27'

Fails an assertion in what I assume is libuv, however it appears to fail so rapidly that morgan doesn't get to log the request.

App listening on http://localhost:3000
Assertion failed: w_target_len == 0, file c:\ws\deps\uv\src\idna.c, line 408

Malformed Packet

  1. Start the production server npm run start or dev `npm run dev
  2. Send the corrupted packet node kill.js
> cross-env NODE_ENV=production node ./server.js

App listening on http://localhost:3000
Assertion failed: w_target_len == 0, file c:\ws\deps\uv\src\idna.c, line 408

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (22) x64 Intel(R) Core(TM) Ultra 7 155H
    Memory: 4.30 GB / 15.74 GB
  Binaries:
    Node: 22.2.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (128.0.2739.42)
    Internet Explorer: 11.0.22621.3527

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions