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

Using fast calls for WASI causes V8 coredump #46777

Open
TerrorJack opened this issue Feb 22, 2023 · 3 comments
Open

Using fast calls for WASI causes V8 coredump #46777

TerrorJack opened this issue Feb 22, 2023 · 3 comments

Comments

@TerrorJack
Copy link
Contributor

Version

v19.7.0

Platform

Linux build01 6.0.3 #1-NixOS SMP PREEMPT_DYNAMIC Fri Oct 21 10:39:29 UTC 2022 x86_64 GNU/Linux

Subsystem

wasi

What steps will reproduce the bug?

See https://bugs.chromium.org/p/v8/issues/detail?id=13753 for the minimal repro. V8 upstream has indicated that #43697 is the culprit.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

See above.

Additional information

No response

@cjihrig
Copy link
Contributor

cjihrig commented Feb 22, 2023

cc: @devsnek

@devsnek
Copy link
Member

devsnek commented Feb 22, 2023

It seems that calling AdjustAmountOfExternalAllocatedMemory triggers a GC :/

I am gonna kick this back to V8 lol

@bnoordhuis
Copy link
Member

V8 says they don't consider it a bug so I guess that means node needs to defer the AdjustAmountOfExternalAllocatedMemory() call until a GC-safe point in time, i.e., until after the fast call.

Alternatively / workaround-ishly, src/node_wasi.cc could move away from NgLibMemoryManager to a memory manager that doesn't call AdjustAmountOfExternalAllocatedMemory().

I don't think that AdjustAmountOfExternalAllocatedMemory() makes sense for WASI anyway because its allocations aren't tied to JS objects so best case, it's a no-op, worst case, it makes the GC vacuum more frequently but pointlessly.

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

No branches or pull requests

4 participants