-
Notifications
You must be signed in to change notification settings - Fork 38
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
[Issue #29] - Improve diagnostics of Process reading in the native code #39
[Issue #29] - Improve diagnostics of Process reading in the native code #39
Conversation
…he stopped process and 32-to-64 calls
So yes, I should not have removed the intelligent import code, which has been proposed for https://msdn.microsoft.com/en-us/library/ms684139.aspx . AppVeyor is not running builds as a desktop App, hence it captured the API misusage. |
Self-:bug: |
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
@reviewbybees @kohsuke Ready for review. I would especially appreciate feedback regarding CRT inclusion feasibility. Effectively it is required for fine-grain logging only, which I could disable for the release build (and maybe make it configurable via system property). OTOH, 40KB should not be a problem in 2017 since it needs to be loaded only once. |
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.
👍 from what little I understand of it. Probably @kohsuke is the only one able to do a deep review.
@@ -40,6 +40,10 @@ | |||
<plugin> | |||
<artifactId>maven-surefire-plugin</artifactId> | |||
<version>2.19.1</version> | |||
<configuration> | |||
<argLine>-XX:+CreateMinidumpOnCrash</argLine> | |||
<trimStackTrace>false</trimStackTrace> |
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.
Sigh.
BOOL WINAPI KillProcessEx(IN DWORD dwProcessId, IN BOOL bTree); | ||
|
||
// Sets bit 29 in order to keep the codes in the user space | ||
#define reportErrorWithCode(env,code,msg) SetLastError(code + 0x10000000); error(env,__FILE__,__LINE__,msg); |
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.
Not using toSystemErrorCode
?
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.
Nope, because it is a native stuff. Ideally I should create enum there as well, but I firstly need to think about fatal/not-fatal errors (E.g. Process memory block unavailability is not fatal, and it is one of potential JENKINS-30782 root causes)
containsString("Failed to read " + getExpectedPEBName(false)), | ||
containsString("error=299 at envvar-cmdline"))); | ||
assertThat(ex.getMessage(), containsString("Process with pid=" + pid + " has already stopped. Exit code is -1")); | ||
assertThat(ex.getWin32ErrorCode(), equalTo(UserErrorType.PROCESS_IS_NOT_RUNNING.getSystemErrorCode())); |
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.
Nice.
@reviewbybees done |
@kohsuke said he is fine with CRT inclusion. @reviewbybees done => Merging |
This change should significantly improve the diagnostics info for #29 in some corner cases. All the issues below may lead to #29 or to "Failed to read PEB" (e.g. JENKINS-8614 in Jenkins tests)
Native:
Java:
Work is in progress, because AppVeyor JVM was crashing, need to investigate. likely it is due to the
isWow64()
method, where I oversimplified the pattern once the simple approach worked.@reviewbybees