Closed panva closed 1 month ago
Tested again with https://github.com/denoland/deno/releases/tag/v1.44.1, issue still persists.
Looks like this will be fixed by https://github.com/denoland/deno/pull/24128.
@panva we've been investigating this issue with @nathanwhit and so far we established that the problem appeared when we upgraded from V8 12.4 to V8 12.6. The investigation leads us to believe that it might be a V8 bug, we're trying to strip down the reproduction and validate the idea.
I was able to minimize the reproduction and I'm now fairly sure this is a V8 bug. You can see the reproducer here: https://github.com/nathanwhit/v8-async-module-hang (that relies on part of V8). There's an equivalent reproducer for deno here: https://github.com/nathanwhit/deno-async-module-hang (there are a couple tiny differences with the above due to some differences in event loops).
I've reported this upstream (here), and I'll try to update here once I hear back
The reproduction reproduces in all versions of Deno down to at least 1.15.0 - seems to be a long standing bug in V8.
How come in the reproduction case you only encounter it the first time the code runs in a given directory? And only since a couple releases ago?
@panva It's timing dependant - I can reproduce it every time on an M1 MacBook Air.
Anyway, it is a confirmed upstream bug - I'm working with Shu from V8 to figure out a fix.
The fix has landed in https://chromium-review.googlesource.com/c/v8/v8/+/5631143. We'll most likely will need to wait until the next minor release as it will require to update V8.
The bug was fixed in V8, just waiting for it to be available in one of the lkgr
branches.
I believe this has been resolved with 1.46.0
That's right, the fix should have been included in V8 12.8 which Deno 1.46 ships with. Thanks for providing the repro.
Version: Deno 1.44.0
Happened since the latest two releases after running
npm upgrade
(but never again after) and intermittenly in CI after denoland/setup-deno@v1.Reproduction steps (What runs in CI)
If you run the last command again it'll pass. Running the same set of steps in a folder previously not used reproduces again. I'm assuming code cache has something to do with this.
edit:
CI runs:
1: https://github.com/panva/jose/actions/runs/9349170914/job/25729896095 2: https://github.com/panva/jose/actions/runs/9349170914/job/25732051415
Local runs:
Details
``` ➜ jose git:(main) export RUST_BACKTRACE=full ➜ jose git:(main) gh repo clone panva/jose -- --depth=1 cd jose npm clean-install npm run build:deno deno run --allow-read --allow-net --import-map tap/import_map.json --no-npm tap/run-deno.ts Cloning into 'jose'... remote: Enumerating objects: 399, done. remote: Counting objects: 100% (399/399), done. remote: Compressing objects: 100% (324/324), done. remote: Total 399 (delta 131), reused 162 (delta 71), pack-reused 0 Receiving objects: 100% (399/399), 319.53 KiB | 1.72 MiB/s, done. Resolving deltas: 100% (131/131), done. added 477 packages in 1s > jose@5.3.0 build:deno > npm run-script runtime-deno && find dist/deno -name '*.ts' -type f -print0 | xargs -0 sed -i.bak -e "s/\.js'/.ts'/g" -e "s/\.d'/.d.ts'/g" && npm run-script sedcleanup > jose@5.3.0 runtime-deno > npm run-script runtime-browser && mkdir -p dist/deno && cp -R src/. dist/deno && rm -R dist/deno/runtime/browser dist/deno/runtime/node > jose@5.3.0 runtime-browser > run-s runtime:clear runtime:browser:* runtime:refs > jose@5.3.0 runtime:clear > run-s -s runtime:find | xargs -0 rm -f > jose@5.3.0 runtime:browser:copy > cp ./src/runtime/browser/*.ts ./src/runtime > jose@5.3.0 runtime:refs > run-s -s runtime:find | xargs -0 sed -i.bak -e "s/'\.\.\//'\.\//g" -e "s/'\.\/\.\./'../g" && npm run-script sedcleanup > jose@5.3.0 sedcleanup > find . -name '*.bak' -type f -print0 | xargs -0 rm -f > jose@5.3.0 sedcleanup > find . -name '*.bak' -type f -print0 | xargs -0 rm -f ============================================================ Deno has panicked. This is a bug in Deno. Please report this at https://github.com/denoland/deno/issues/new. If you can reliably reproduce this panic, include the reproduction steps and re-run with the RUST_BACKTRACE=1 env var set and include the backtrace in your report. Platform: macos aarch64 Version: 1.44.0 Args: ["deno", "run", "--allow-read", "--allow-net", "--import-map", "tap/import_map.json", "--no-npm", "tap/run-deno.ts"] thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.283.0/runtime/jsruntime.rs:1856:3: internal error: entered unreachable code: Expected at least one stalled top-level await stack backtrace: 0: 0x103a7a8c4 -