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

debugging trans: initialize drop-flag byte with special pattern and check for it on drop #21777

Closed
pnkfelix opened this issue Jan 30, 2015 · 3 comments
Labels
A-codegen Area: Code generation A-destructors Area: Destructors (`Drop`, …)

Comments

@pnkfelix
Copy link
Member

So, there are sometimes bugs in trans related to allocating stack slots for temporary values, but not properly ensuring that the slots are either always initialized or start off with the drop flag zeroed.

A way we could try to guard for such bugs would be: in debug builds, initialize the drop flag with a non-trivial bit pattern, and then check for that bit pattern when dropping the value.

I strongly suspect a check like this would have helped us track down the cause of #20055 faster.

@pnkfelix pnkfelix added A-codegen Area: Code generation A-instrumentation A-destructors Area: Destructors (`Drop`, …) and removed A-instrumentation labels Jan 30, 2015
@steveklabnik
Copy link
Member

Triage: I'm not aware of any changes here.

@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 9, 2016

Oh I think I actually did this.

@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 9, 2016

Yeah fixed by #23535 (the force-dropflag-checks switch).

@pnkfelix pnkfelix closed this as completed Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-destructors Area: Destructors (`Drop`, …)
Projects
None yet
Development

No branches or pull requests

2 participants