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

libc: initialize alloced memeory #542

Merged
merged 1 commit into from
Oct 26, 2021
Merged

libc: initialize alloced memeory #542

merged 1 commit into from
Oct 26, 2021

Conversation

kvinwang
Copy link
Collaborator

@kvinwang kvinwang commented Oct 22, 2021

There are likely some bug's inside the wasm contract or the wasmi interpretor that cause it reading uninitialized memory, which further cause accessing data by dangling pointers.

This PR makes those unexpected behaviors inside the wasm contract behave more stable and deterministic.

@h4x3rotab
Copy link
Contributor

Does is apply to Substrate itself?

@kvinwang
Copy link
Collaborator Author

Does is apply to Substrate itself?

100% apply to the memory inside contracts.
Partially apply to other rust codes outside.

Copy link
Contributor

@h4x3rotab h4x3rotab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think clear the memory doesn't hurt in any way. Let's keep an eye on the substrate side.

Base automatically changed from set-block-number to pink-mq October 26, 2021 10:11
@kvinwang kvinwang merged commit 786438f into pink-mq Oct 26, 2021
@kvinwang kvinwang deleted the init-mem branch October 26, 2021 10:12
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

Successfully merging this pull request may close these issues.

2 participants