Skip to content

Add support MemorySanitizer for casr-san #249

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

Merged
merged 4 commits into from
Feb 28, 2025

Conversation

PavlNekrasov
Copy link
Contributor

Follow up to #248

Reporter: Pavel Nekrasov ([email protected])

@SweetVishnya
Copy link
Collaborator

SweetVishnya commented Feb 25, 2025

@PavlNekrasov, test_casr_san is failing. You may debug it locally via cargo test test_casr_san

@PavlNekrasov
Copy link
Contributor Author

@PavlNekrasov, test_casr_san is failing. You may debug it locally via cargo test test_casr_san

The test is passing on my end. Could you please provide more details about what's failing?

Снимок экрана 2025-02-25 в 15 03 54

@SweetVishnya
Copy link
Collaborator

@PavlNekrasov, test_casr_san is failing. You may debug it locally via cargo test test_casr_san

The test is passing on my end. Could you please provide more details about what's failing?

Снимок экрана 2025-02-25 в 15 03 54

https://github.com/ispras/casr/actions/runs/13518558010/job/37773097005#step:5:1406

you may try adding debug printing and debug inside this pr

@SweetVishnya
Copy link
Collaborator

btw, the test, also, fails on my personal machine with Ubuntu 22.04. You may try to reproduce it inside a clean docker with ubuntu 22.04

@PavlNekrasov
Copy link
Contributor Author

btw, the test, also, fails on my personal machine with Ubuntu 22.04. You may try to reproduce it inside a clean docker with ubuntu 22.04

I run on ALT Linux, and the stacktrace is as follows:

==521550==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x499fd8 in main (/root/pavel_dev/casr_msan/msan+0x499fd8)
    #1 0x7fba3ccefefc in __libc_start_main (/lib64/libc.so.6+0x27efc)
    #2 0x41c359 in _start /usr/src/RPM/BUILD/glibc-2.32-alt5.p10.3/csu/../sysdeps/x86_64/start.S:120

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/root/pavel_dev/casr_msan/msan+0x499fd8) in main
Exiting

In Ubuntu 22, it is:

==624838==WARNING: MemorySanitizer: use-of-uninitialized-value
   #0 0x56019e20a588 in main (/home/msan+0xa6588) (BuildId: 8ea89468690f1a76a3f9ae71d7f6622d3c201fda)
   #1 0x7f8f01807d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 490fef8403240c91833978d494d39e537409b92e)
   #2 0x7f8f01807e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 490fef8403240c91833978d494d39e537409b92e)
   #3 0x56019e1822a4 in _start (/home/msan+0x1e2a4) (BuildId: 8ea89468690f1a76a3f9ae71d7f6622d3c201fda)

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/msan+0xa6588) (BuildId: 8ea89468690f1a76a3f9ae71d7f6622d3c201fda) in main
Exiting

I've corrected the tests to account for this

@SweetVishnya
Copy link
Collaborator

@PavlNekrasov, thanks a lot! Please, give us some time to review the patch

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 57.89474% with 16 lines in your changes missing coverage. Please review.

Project coverage is 66.35%. Comparing base (b260c9f) to head (1d20151).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
casr/src/bin/casr-cli.rs 0.00% 12 Missing ⚠️
casr/src/bin/casr-san.rs 73.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
- Coverage   66.40%   66.35%   -0.06%     
==========================================
  Files          34       34              
  Lines        8213     8241      +28     
==========================================
+ Hits         5454     5468      +14     
- Misses       2759     2773      +14     

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

@SweetVishnya
Copy link
Collaborator

@PavlNekrasov, can you, also, please, update the README and add an example of collecting report for MemorySanitizer?

@Avgor46
Copy link
Member

Avgor46 commented Feb 26, 2025

Update README.md and docs/classes.md

@PavlNekrasov
Copy link
Contributor Author

Update README.md and docs/classes.md

done

Copy link
Member

@hkctkuy hkctkuy left a comment

Choose a reason for hiding this comment

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

@PavlNekrasov, we also need to support correct work with casr-python, when MemorySanitizer is triggered in C/C++ python extensions. It must be enough to modify this code.

Copy link
Collaborator

@SweetVishnya SweetVishnya 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

@anfedotoff anfedotoff left a comment

Choose a reason for hiding this comment

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

Thanks!

@SweetVishnya SweetVishnya merged commit 5e50ee0 into ispras:master Feb 28, 2025
9 of 14 checks passed
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.

5 participants