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

Integrate cargo-careful #331

Closed
elichai opened this issue Dec 23, 2022 · 4 comments · Fixed by #339
Closed

Integrate cargo-careful #331

elichai opened this issue Dec 23, 2022 · 4 comments · Fixed by #339

Comments

@elichai
Copy link

elichai commented Dec 23, 2022

cargo-careful enables debug assertions and some UB checks in libstd, I think it would be useful if we can fuzz under that configuration
https://github.com/RalfJung/cargo-careful

(@RalfJung Might be of interest to you)

@elichai
Copy link
Author

elichai commented Dec 23, 2022

I see now there's an open PR to enable -Zbuild-std #292

@fitzgen
Copy link
Member

fitzgen commented Jan 3, 2023

Does this have any advantages over adding -Zbuild-std support given that we already have sanitizer support?

@elichai
Copy link
Author

elichai commented Jan 4, 2023

@fitzgen -Zbuild-std together with -Cdebug-assertions=on -Zextra-const-ub-checks -Zstrict-init-checks --cfg "careful" will basically give cargo-careful, the upside of these over just build-std+sanitizer is:

  1. Add more UB checks in const evaluation (these never reach LLVM).
  2. Add assertions that could catch invariants failing even if they haven't manifested into UB just yet (I think), and catch rust-specific UB that aren't necessarily LLVM UB.
  3. Not sure about the strict-init-checks flag, on one hand, any invalid operation on uninitialized data should be catched by memsan, on the other hand, MIR optimization could also influence this (not sure what's the current state of MIR optimizations)

@fitzgen
Copy link
Member

fitzgen commented Jan 4, 2023

Yeah I guess I would rather use these -Z rustc flags ourselves than add another layer around cargo.

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 a pull request may close this issue.

2 participants