-
-
Notifications
You must be signed in to change notification settings - Fork 657
Custom assert handler to point to bugzilla #6103
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
Conversation
|
Strange, tested this locally but asserts don't seem to trigger the custom error message? |
|
Ah, nevermind, the problem is that the backend code uses a different |
|
Will have to look into that, my C has got a bit rusty :) |
|
I was just about to ask if it works in practice (obviously can't be unittested reliably). IIRC, dmd is built with |
That shouldn't be the case, otherwise one wouldn't see the assertion message, just the immediate segfault. EDIT: ah, forgot that C code is compiled differently, yes, this needs to be taken into account |
|
I'm testing a debug build, but it seems that every ICE I can find on bugzilla either comes from the backend, or involves a segfault (so doesn't go through this code). I'm having trouble actually seeing the new error message appear. :-P |
|
@quickfur looks like with C |
|
haha, finally found an ICE that triggers this error: https://issues.dlang.org/show_bug.cgi?id=16284 It seems that you need a |
|
@Dicebot Is it because the C |
|
There's also |
|
Another idea: |
|
It would be nice to get a stack trace for the assertions in the C code. Using the platform supplied assert, at least on OS X, will print a stack trace. |
|
I was going to suggest adding a test-case, but we want to get rid of compiler bugs that trigger these. 😄 |
Current coverage is 87.41% (diff: 14.28%)
|
|
Ok, I decided initially to simply go for ensuring built-in assert is never used and adding same bugzilla reference to custom assert function. Using D assert feels tempting but I am not sure what will happen if one attempts to throw an exception/error from C code. |
Makes it more obvious that any failed assertion is a compiler bug to be reported.
|
Green apart from code coverage checks. |
| fflush(stdout); | ||
| printf("Internal error: %s %d\n",file,line); | ||
| printf("This is a compiler bug, please report it via " | ||
| "https://issues.dlang.org/enter_bug.cgi\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- How about pre-filling some selections?
e.g. https://issues.dlang.org/enter_bug.cgi?component=dmd&bug_severity=critical&keywords=ice
(we could make a short URL or short domain (e.g. https://bugs.dlang.io/ice out of this, if that's too long)
- As someone on the NG proposed: What about a link to the DWiki instead which describes further steps? (e.g. how to dustmite, what to mention in the bug report, ...)
- Just an empty bug report page can be quite intimidating for a user.
- We don't seem to have such a page as of now, but maybe we can take a bit of information from Get involved and start a new one?
- the issue writing guidelines seems to be a generic page from Bugzilla
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an empty bug report page can be quite intimidating for a user.
If they start typing out the title they might find a duplicate one listed which could show a way to work around the bug. Even if they end up submitting a duplicate report this would get attention from bugzilla lurkers and they would get feedback pretty soon.
It would really suck if bugs like this went unreported. Bugzilla seems like a good first choice, but an ICE should be rare enough that adding two links to the diagnostics isn't such an overwhelming idea. Something like:
This is an unexpected internal compiler bug, please submit a
bug report via https://issues.dlang.org/enter_bug.cgi?
component=dmd&bug_severity=critical&keywords=ice
For more info on internal compiler errors see <this wiki page>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- should be major, not critical.
- I wonder if having this link would encourage spammers to post on bugzilla by raising the visibility of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the URL will be in the source code? Perhaps obfuscate it using base64 encoding or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bugzilla URLs are already in various parts of our website (and therefore on github), so I'm not sure how adding it to the source code makes it different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we'll see! So far we haven't had any trouble with abusive bugzilla postings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But still, it should be major, not critical. Critical would be things like silently generating bad code, which is much worse than an assert.
|
FYI: I will be travelling for next 1.5 weeks and will only get back to this PR after. Feel free to take it over if you want to merge it faster. |
It isn't built with It's the case since the switch DDMD, I'll open a discussion on dmd-internals. |
Yes, this is a blocker. I'll wait for the thread to resolve before updating this. |
So is it possible to release |
Sounds to me like DIP1006 would solve this problem (compiling dmd in release mode, but with asserts enabled). |
|
Or we could use a signal handler to detect the |
|
Revived this in #8138 |
Makes it more obvious that any failed assertion is a compiler
bug to be reported. Inspired by http://forum.dlang.org/thread/[email protected]