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

fix(gnovm): Make GnoVM slice allocations before go runtime allocations #2781

Merged
merged 4 commits into from
Sep 12, 2024

Conversation

deelawn
Copy link
Contributor

@deelawn deelawn commented Sep 10, 2024

This is to fix the first issue mentioned in #2738.

In short, when allocating and reallocating slices' underlying arrays, the VM was building the TypedValue slice before making the necessary VM allocations. It is important the VM allocations be done before the TypedValue allocations to ensure the values being allocated won't exceed the VM's limit. In extreme cases, unchecked allocations resulted in the VM hanging as it tried to allocate massive TypedValue slices in the go runtime.

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Sep 10, 2024
@deelawn deelawn changed the title (gnovm) fix: Make GnoVM slice allocations before go runtime allocations fix (gnovm): Make GnoVM slice allocations before go runtime allocations Sep 10, 2024
@deelawn deelawn changed the title fix (gnovm): Make GnoVM slice allocations before go runtime allocations fix: (gnovm) Make GnoVM slice allocations before go runtime allocations Sep 10, 2024
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 62.00000% with 19 lines in your changes missing coverage. Please review.

Project coverage is 60.44%. Comparing base (68b8f54) to head (43b0f1d).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
gnovm/pkg/gnolang/uverse.go 62.00% 19 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2781   +/-   ##
=======================================
  Coverage   60.44%   60.44%           
=======================================
  Files         563      563           
  Lines       75157    75154    -3     
=======================================
+ Hits        45426    45430    +4     
+ Misses      26341    26335    -6     
+ Partials     3390     3389    -1     
Flag Coverage Δ
contribs/gnodev 61.46% <ø> (ø)
contribs/gnofaucet 15.31% <ø> (ø)
gno.land 67.21% <ø> (ø)
gnovm 64.46% <62.00%> (-0.01%) ⬇️
misc/genstd 80.54% <ø> (ø)
misc/logos 20.23% <ø> (ø)
tm2 61.99% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Sep 10, 2024
@deelawn deelawn marked this pull request as ready for review September 10, 2024 21:13
Copy link
Contributor

@petar-dambovaliev petar-dambovaliev left a comment

Choose a reason for hiding this comment

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

LGTM!

@leohhhn leohhhn changed the title fix: (gnovm) Make GnoVM slice allocations before go runtime allocations fix(gnovm): Make GnoVM slice allocations before go runtime allocations Sep 11, 2024
@thehowl thehowl merged commit d7407f5 into gnolang:master Sep 12, 2024
121 checks passed
@deelawn deelawn deleted the fix/allocations branch September 12, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants