-
-
Notifications
You must be signed in to change notification settings - Fork 667
Automatically print the segtrace for segfaulting tests #8132
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
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf 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#8132" |
| output_file.remove(); | ||
|
|
||
| // automatically rerun a segfaulting test and print its stack trace | ||
| version(linux) |
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.
Why only Linux?
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 I didn't know whether it would work on other platforms and I thought it's good to start with something that I can test. Also most of our CIs are Linux ones, so it would already have a measurable impact.
IIRC OSX uses lldb and Windows has who knows what debugger available?
(+I didn't feel like fighting the auto-tester for something that hasn't received feedback yet.)
|
There's |
DMD is built in release mode on e.g. the auto-tester, so AFAICT unfortunately this won't work. |
test/tools/d_do_test.d
Outdated
| { | ||
| string test_app_dmd = test_app_dmd_base ~ to!string(permuteIndex) ~ envData.exe; | ||
|
|
||
| string lastCommand; |
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 suggest adding a simple comment here describing what this is for, so the next person to modify this code doesn't have to do so much investigation.
|
I like it. |
|
BTW here's how this will look like: Luckily there are enough ICEs available, this one was "tested" with https://issues.dlang.org/show_bug.cgi?id=18718 |
|
So no longer an RFC? |
|
Ah, I'm confusing a program segfault with a compiler segfault. |
test/tools/d_do_test.d
Outdated
| { | ||
| string test_app_dmd = test_app_dmd_base ~ to!string(permuteIndex) ~ envData.exe; | ||
|
|
||
| string command; // copy of the last executed command, s.t. it can be re-invoked on failures |
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 would prefer if we didn't start using informal chatting abbreviations. Please spell out "so that".
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.
FWIW wiktionary lists it as:
(mathematics) Abbreviation of "such that".
https://en.wiktionary.org/wiki/s.t.
but I don't mind changing it.
|
How can I make use of this idea during local development of my dub projects in Linux? |
|
Not sure what you are referring to? |
|
I want dub run to print the stacktrace of my app when it segfaults. |
Useful because
An alternative would be to use
coredumpctl gdb -1, but that's systemd-only and I don't know whether all CIs support this.So what do you think about this?