Skip to content

Conversation

@Jarred-Sumner
Copy link
Collaborator

What does this PR do?

This does two things:

  1. Fix an ASAN use-after-poison on macOS involving ws module when running websocket.test.js. This was caused by the open callback firing before the .upgrade function call returns. We need to update the socket value on the ServerWebSocket to ensure the NodeHTTPResponse object is kept alive for as long as it should be, but the us_socket_t address can, in theory, change due to realloc being used when adopting the socket.
  2. Fixes an "undefined is not a function" error when the websocket upgrade fails. This occurred because the _httpMessage property is not set when a socket is upgraded

How did you verify your code works?

There is a test and the asan error no longer triggers

@robobun
Copy link
Collaborator

robobun commented Aug 14, 2025

Updated 4:21 PM PT - Aug 14th, 2025

@autofix-ci[bot], your commit 601bb1a has 4 failures in Build #22970:


🧪   To try this PR locally:

bunx bun-pr 21867

That installs a local version of the PR into your bun-21867 executable, so you can run:

bun-21867 --bun

@cirospaciari cirospaciari merged commit ff372f4 into main Aug 14, 2025
57 of 61 checks passed
@cirospaciari cirospaciari deleted the jarred/asan-ws branch August 14, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants