Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno panics unexpectedly when put under heavy load #15124

Closed
umgefahren opened this issue Jul 8, 2022 · 3 comments · Fixed by #15220
Closed

Deno panics unexpectedly when put under heavy load #15124

umgefahren opened this issue Jul 8, 2022 · 3 comments · Fixed by #15220
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@umgefahren
Copy link

We are currently developing a server benchmark for various languages and runtimes. While developing our stress-tester we discovered a bug in Deno.

This is the backtrace:

Platform: macos x86_64
Version: 1.23.3
Args: ["deno", "run", "--allow-net", "mod.ts"]

thread 'main' panicked at 'internal error: entered unreachable code: Unexpected missing emit: file://.../server-language-benchmark/Deno/src/server.ts

Try reloading with the --reload CLI flag or deleting your DENO_DIR.', cli/proc_state.rs:571:23
stack backtrace:
   0:        0x11005690b - <unknown>
   1:        0x10f6ab36a - <unknown>
   2:        0x1100397f8 - <unknown>
   3:        0x110045d1d - <unknown>
   4:        0x110045a21 - <unknown>
   5:        0x10f63b72b - <unknown>
   6:        0x1100467b9 - <unknown>
   7:        0x110056da4 - <unknown>
   8:        0x110056d19 - <unknown>
   9:        0x110046145 - <unknown>
  10:        0x1112ffc43 - <unknown>
  11:        0x10f4ee8d3 - <unknown>
  12:        0x10f4eed07 - <unknown>
  13:        0x10f7925b8 - <unknown>
  14:        0x10f7c6399 - <unknown>
  15:        0x110463538 - <unknown>
  16:        0x1104630b2 - <unknown>
  17:        0x110462557 - <unknown>

The code we ran can be found here: https://github.com/umgefahren/server-language-benchmark/tree/main/Deno

The code of the client can be found here: https://github.com/umgefahren/server-language-client

Steps to reproduce the issue with the client:

  • Build the client (in release mode) cargo build --release
  • Generate data with ./target/release/server-language-client generate 10000000
  • Run the benchmark (after starting the deno server) ./target/release/server-language-client benchmark 1m

The issue might be somewhere hidden in the TCP stack, although I'm definitely not certain. But we did some unholy things with TCP in order to put such a high load on the server (https://github.com/umgefahren/server-language-client/blob/bc5eaf085f399cb76a4aa1e796696c5fd274c360/src/worker.rs#L99).

I consider this bug somewhat dangerous, as it might increase vulnerability to DOS attacks.

@umgefahren
Copy link
Author

Additional Note: I only tested on the same computer, not over network.

@bartlomieju
Copy link
Member

CC @dsherret

@dsherret
Copy link
Member

dsherret commented Jul 8, 2022

It's probably #13302. I am actually working on a fix right now for 1.24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir
Projects
None yet
4 participants