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

New framework for detecting OOM issues #586

Merged
merged 14 commits into from
Jan 7, 2025
Merged

New framework for detecting OOM issues #586

merged 14 commits into from
Jan 7, 2025

Conversation

Acaccia
Copy link
Collaborator

@Acaccia Acaccia commented Dec 16, 2024

This PR adds a new testing folder called oom-checker.

This one contains a new function crosscheck_oom which takes a snippet and modifies it so that the memory that should normally be available would be filled.

It could show that a few functions currently suffer from OOM issue (#585, #592).

I am not very pleased by the handling of functions which take lists as arguments. Currently, lists are always computed at runtime, even those that are lists of literals. For such functions, I decided to give the possibility to add the type of arguments to the new crosscheck function, so that the length needed to compute it would be accounted in the filling of the memory. This is not very pretty, but I would prefer to have a temporary solution like this one and that we fix #587 instead of having a very beautiful solution that will be removed in a near future.

I tried to check all functions that returns in-memory values, I might have forgotten a few.

We will also need another solution for checking functions calls (after all kind of define-x for functions, and with contract-call?).

@Acaccia Acaccia self-assigned this Dec 16, 2024
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.48%. Comparing base (ba0b06b) to head (5b1a8fb).
Report is 40 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #586      +/-   ##
==========================================
- Coverage   85.50%   85.48%   -0.02%     
==========================================
  Files          46       46              
  Lines       24227    24266      +39     
  Branches    24227    24266      +39     
==========================================
+ Hits        20716    20745      +29     
- Misses       1669     1672       +3     
- Partials     1842     1849       +7     

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

@Acaccia Acaccia marked this pull request as ready for review December 31, 2024 11:16
Copy link
Collaborator

@krl krl left a comment

Choose a reason for hiding this comment

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

Some clarification and DRYisms requested

clar2wasm/tests/oom-checker/main.rs Show resolved Hide resolved
clar2wasm/tests/oom-checker/main.rs Outdated Show resolved Hide resolved
clar2wasm/tests/oom-checker/main.rs Outdated Show resolved Hide resolved
@moodmosaic
Copy link
Member

Is it possible to run this as a binary, similar to crosscheck?

@Acaccia
Copy link
Collaborator Author

Acaccia commented Jan 6, 2025

@moodmosaic It could be possible. Once this is merged, we can create a binary for it :)

@Acaccia Acaccia requested a review from krl January 7, 2025 12:42
Copy link
Collaborator

@krl krl left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Collaborator

@csgui csgui left a comment

Choose a reason for hiding this comment

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

Thanks for that safety net @Acaccia. The OOM issues are really a pain.

LGTM.

@moodmosaic
Copy link
Member

moodmosaic commented Jan 7, 2025

@moodmosaic It could be possible. Once this is merged, we can create a binary for it :)

@Acaccia Let's do this :)

@Acaccia Acaccia added this pull request to the merge queue Jan 7, 2025
Merged via the queue into main with commit 6a14610 Jan 7, 2025
16 checks passed
@Acaccia Acaccia deleted the test/detect-ooms branch January 7, 2025 15:47
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.

Create lists of literals at compile time
4 participants