-
Notifications
You must be signed in to change notification settings - Fork 70
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
Broken debug build #160
Comments
This was added in v8/v8@6f994a0 /cc @marjakh |
Yikes, this is unexpected. How can I repro this? |
@marjakh The following should work:
(You probably want to use |
Thanks for the repro instructions! Here are some initial findings (I haven't had the chance to look into this too much): When promise_fun is initially created (at snapshot generation time), it has fast properties as expected:
(Relevant line: map has FastProperties.) But when node is starting, and tries to use this promise_fun, it already has dictionary properties (even before adding Promise.any):
(Relevant line: map has DictionaryProperties.) Does node do something nonstandard with the snapshot? Does it do something that would cause the function to turn to dictionary mode somewhere before creating a snapshot or just after reading it in? If this is blocking you, I think it's ok to just remove the failing DCHECK. As it's already dictionary properties before adding the Function for Promise.any, it doesn't change anything. This should still be investigated of course, just that at the moment it doesn't look like it's a regression (meaning: promise_fun was dictionary props before, we just didn't have a check asserting it's not). |
/cc @joyeecheung |
Here's a stack trace for the moment where the map turns dictionary props during node_mksnapshot time:
|
My current understanding: it's debatable whether this is the expected behavior or not, but at least, given the current state of the things, the DCHECK is wrong. I'll remove it on V8 side. |
https://chromium-review.googlesource.com/c/v8/v8/+/2246577 is in the works |
The fix landed, do you need anything more from our side? |
Thanks a ton, @marjakh. No, once the commit lands on LKGR, we'd pick it up. |
My guess is this has something to do with primordials baking which is done during snapshot building (we now extend Promise with a SafePromise class and copy the methods/prototype methods over before freezing it) |
Yep, that looks like it's causing this. (In particular: using Promise as a prototype.) It's ok, just has this side effect that Promise will now have dictionary properties in your snapshot. :) |
The text was updated successfully, but these errors were encountered: