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

[CP] [dart2wasm] Fix partial instantiation constants #56440

Closed
Tracked by #152953
mkustermann opened this issue Aug 12, 2024 · 5 comments
Closed
Tracked by #152953

[CP] [dart2wasm] Fix partial instantiation constants #56440

mkustermann opened this issue Aug 12, 2024 · 5 comments
Assignees
Labels
area-dart2wasm Issues for the dart2wasm compiler. cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@mkustermann
Copy link
Member

Commit(s) to merge

f7fc4d0

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/380120

Issue Description

Using partial instantiation constants of generic methods with named parameters can in certain situations lead to compiler crashes.

What is the fix

Fix the code that handles partial instantiation constants in dart2wasm.

Why cherry-pick

Users have hit this problem.

Risk

If all tests pass: low.

Issue link(s)

#56372

Extra Info

No response

@mkustermann mkustermann added the cherry-pick-review Issue that need cherry pick triage to approve label Aug 12, 2024
@mkustermann
Copy link
Member Author

/cc @kevmoo for visibility (we want this to be also included in the dot release)

@dart-github-bot
Copy link
Collaborator

Summary: The Dart2Wasm compiler crashes when using partially instantiated generic methods with named parameters. This fix addresses the issue by correcting the code that handles these constants.

@dart-github-bot dart-github-bot added area-dart2wasm Issues for the dart2wasm compiler. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Aug 12, 2024
@mkustermann
Copy link
Member Author

@athomas Could we get this approved so it gets included in the upcoming hotfix release?

@itsjustkevin
Copy link
Contributor

@mkustermann based on previous discussions, I am going to mark this cherry-pick approved.

@itsjustkevin itsjustkevin added the cherry-pick-approved Label for approved cherrypick request label Aug 13, 2024
copybara-service bot pushed a commit that referenced this issue Aug 13, 2024
Partial instantiation constants are closures. Those closures have
vtables with all entries needed for the closure representation
corresponding to the instantiated closure.

The entries of those vtables have to either call the corresponding
method of the generic closure, or are unreachable dummy entries.

Dummy entries can be required due to clustering callees/callers together
where a particular target doesn't support the name combination.

The case that was incorrect is if the particular name combination did
not get clustered with anything for the generic closure representation.

Issue #56372

TEST=web/wasm/regress_56372_test

Bug: #56372
Change-Id: I7a219237519c39d982b89ce272f33fb4d90cd173
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/380100
Cherry-pick-request: #56440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380120
Reviewed-by: Ömer Ağacan <[email protected]>
Commit-Queue: Martin Kustermann <[email protected]>
@mkustermann
Copy link
Member Author

mkustermann commented Aug 13, 2024

@mkustermann based on previous discussions, I am going to mark this cherry-pick approved.

Thanks a lot, @itsjustkevin. Merged the PR

(No more cherry-picks for dart2wasm in the SDK (still one dependent in flutter/flutter - flutter/flutter#153310) )

@lrhn lrhn removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart2wasm Issues for the dart2wasm compiler. cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants