Repository navigation
fix: OrderedDict.get() crashes on wasi #8896
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,7 @@ pub(crate) mod ordered_dict { | |
| last: Option<usize>, | ||
| nodes: Vec<Option<ODictNode>>, | ||
| free: Vec<usize>, | ||
| by_hash: HashMap<PyHash, Vec<usize>>, | ||
| by_hash: Box<HashMap<PyHash, Vec<usize>>>, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's happening in wasi? since both Box and HashMap are indirection, this will cause double indirection, which is not very preferred. I'd like to understand how and why this broken in wasi
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In wasi,
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, we have to adjust alignment rather than adding a Box.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opened #8905 as a follow-up to #7663 and the layout analysis here. It adds compile-time checks for native subclass payload offsets and object alignment, and aligns The original #7663 inherited-getter regression is included. The AI assistance: Codex (GPT-6).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that #8905 fixes this so imma close this one |
||
| state: usize, | ||
| } | ||
|
|
||
|
|
@@ -573,6 +573,7 @@ pub(crate) mod ordered_dict { | |
| fn __sizeof__(&self) -> usize { | ||
| self.dict.__sizeof__() | ||
| + core::mem::size_of::<ODictLinks>() | ||
| + core::mem::size_of::<HashMap<PyHash, Vec<usize>>>() | ||
| + self.links.lock().nodes.capacity() * core::mem::size_of::<Option<ODictNode>>() | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.