Skip to content

Print more info on bad frees with RUSTRT_TRACK_ALLOCATIONS #7859

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

Closed
wants to merge 2 commits into from

Conversation

kmcallister
Copy link
Contributor

I added these while tracking down heap corruption in Servo.

Keegan McAllister added 2 commits July 17, 2013 14:03
…LOCATIONS

Probably the env var should be renamed from DETAILED_LEAKS but I'm leaving
aside that breaking change for now.
inline void memory_region::maybe_print_backtrace(const alloc_header *header) const {
# if RUSTRT_TRACK_ALLOCATIONS >= 3
if (_detailed_leaks) {
backtrace_symbols_fd(header->bt + 1, header->btframes - 1, 2);
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this work on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. Is the concern that the backtrace_* glibc functions won't be available? At any rate, RUSTRT_TRACK_ALLOCATIONS >= 3 already uses those elsewhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, OK, if it's already used elsewhere then I guess it's fine.

bors added a commit that referenced this pull request Jul 19, 2013
I added these while tracking down heap corruption in Servo.
@bors bors closed this Jul 19, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 4, 2021
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 4, 2021
Fix `question_mark` FP on custom error type

Closes rust-lang#7859

rust-lang#7840 aims to ignore `question_mark` when the return type is custom, which is [covered here](https://github.com/rust-lang/rust-clippy/blob/df65291edd6b89a241fed483ab165c32df468746/tests/ui/question_mark.rs#L144-L149). But this fails when there is a call in conditional predicate

changelog: [`question_mark`] Fix false positive when there is call in conditional predicate
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.

3 participants