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

Fix issue 18946: assert message can throw hijacking the assert failure #8673

Closed
wants to merge 1 commit into from

Conversation

thewilsonator
Copy link
Contributor

I presume the protocol is to deprecate this first.

@dlang-bot
Copy link
Contributor

dlang-bot commented Sep 6, 2018

Thanks for your pull request and interest in making D better, @thewilsonator! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
18946 major assert message can throw hijacking the assert failure.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#8673"

@Geod24
Copy link
Member

Geod24 commented Sep 6, 2018

When submitting a PR, please provide a title which allow us to see what it's about from the notification.

@thewilsonator thewilsonator changed the title Fix issue 18946 Fix issue 18946: assert message can throw hijacking the assert failure Sep 6, 2018
@Geod24
Copy link
Member

Geod24 commented Sep 6, 2018

I am not sure the linked issue is valid. In the end, your exception happens last, and that's what gets reported. If the function was to assert, that would also be reported, wouldn't it ?

@thewilsonator
Copy link
Contributor Author

thewilsonator commented Sep 6, 2018

Instead of throwingFunc replace that with a call to format or the like, which one might reasonably expect to catch a ConvException from some higher call chain call...

@Geod24
Copy link
Member

Geod24 commented Sep 6, 2018

@thewilsonator : Exactly. But forcing people to put nothrow on their string-formatting functions is quite restrictive IMO.

@thewilsonator
Copy link
Contributor Author

Hmm, perhaps this is not the correct way to fix this. It would be better to wrap the message evaluation in a try catch.

@Geod24
Copy link
Member

Geod24 commented Sep 6, 2018

Yeah, that would be much better

@Geod24
Copy link
Member

Geod24 commented Sep 14, 2018

If you don't mind, I'm going to close this for the time being since this approach won't work.
This way it won't get scheduled into the CI queue.
Feel free to reopen when you implement the different approach.

@Geod24 Geod24 closed this Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants