-
Notifications
You must be signed in to change notification settings - Fork 78
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
RFC: Do not panic when failing to release resources in Drop impls. #32
Conversation
Can it even fail? Based on On the other hand, someone can unmap it manually, since Honestly, I think we can replace And probably we can add a comment in each Drop impl explaining why we don't check the result. |
I do suspect that this falls into the "logic error" rather than "runtime error" category. But that would also be an argument for demoting this to a
Since this would be calling an unsafe function, user code would be responsible to avoid duplicate unmapping, i.e. I agree that we do not need to handle this.
I don't think we should write to stderr in a library. This might not even be connected to something that a human reads. I would suggest just following the lead of the standard library and swallow these errors.
Will do with a link to the rust issue. |
C.f. rust-lang/lang-team#97 for a general discussion on why this is undesirable.
Agree. |
Thanks for the quick response! I will not try to land anything else today. |
Thanks again! I will publish a new release soon. |
@RazrFalcon @Amanieu I replaced the
in rust-lang/lang-team#97 makes me wonder whether we should call I am uncomfortable with unwinding due to the effects on calling code, with ignoring errors as I fear making a vulnerability exploitable by not aborting but aborting also seems somewhat "impolite" when done from a library. Do you think we should explicitly abort here? Also even if we keep ignoring this in release builds, it seems we might want to turn this into a |
Error cannot happen anyway. So there is not reason to abort. And since we're providing an access to a raw pointer, we cannot guarantee anything. So ignoring is the best solution. |
C.f. rust-lang/lang-team#97 for a general discussion on why this is undesirable.