Add memory error handler when requested via the#11646
Conversation
|
Thanks for your pull request, @schveiguy! 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 run digger -- build "master + dmd#11646" |
a85ee15 to
2cefcac
Compare
DMD_INSTALL_MEMERR_HANDLER=1 environment variable. Only works on DMD, and currently only on Linux.
|
Force-merging as auto-tester Windows machines have issues atm. |
| } | ||
| else | ||
| { | ||
| printf("**WARNING** Memory error handler not supported on this platform!\n"); |
There was a problem hiding this comment.
Printing this error message would require us to guess if the MEH is available for each CI machine (because it would break the TEST_OUTPUT validation).
This could be disabled via another env. variable but simply removing it should be acceptable as well.
There was a problem hiding this comment.
I'm not sure if we will be always enable this feature for all CI? I mean, I have definitely seen problems with this in some cases that made the code worse than not having it installed.
In which case, it's useful for using the CI to find issues (like the original #11574), or to use it locally when a segfault happens.
Perhaps I can change the code to configure the printout based on the value of the string? Like if the environment variable is not blank, then enable the memory handler, and if the value is not "NOPRINT", then print out the message?
There was a problem hiding this comment.
It doesn't need to be enabled for all CI's. I thought we could e.g. enable it e.g. for the -debug builds done on Circle and Azure* (unless it causes errors, etc).
Perhaps I can change the code to configure the printout based on the value of the string? Like if the environment variable is not blank, then enable the memory handler, and if the value is not "NOPRINT", then print out the message?
Something like that, allthough it could simply use 1 for the current behaviour and 2 for silent mode (I doubt that the silent mode is ever relevant outside of our CI's)
DMD_INSTALL_MEMERR_HANDLER=1 environment variable. Only works on DMD,
and currently only on Linux.
See #11574 for more details.
I did not test the NoMain version, but I assume this should work since it should be compiled with the
-mainoption.