Repository navigation
Reliably print errno from gencore() when DUMP_DBG is defined - #6433
Conversation
|
@babsingh : please review |
babsingh
left a comment
There was a problem hiding this comment.
minor formatting changes
| struct coredumpinfo coreDumpInfo; | ||
| int rc = -1; | ||
| #if defined(DUMP_DBG) | ||
| int saved_errno; |
There was a problem hiding this comment.
camel case recommended as per coding standards; also, to be consistent with the surrounding code. https://github.com/eclipse/omr/blob/master/doc/CodingStandard.md#variables
| int saved_errno; | |
| int savedErrno; |
| int rc = -1; | ||
| #if defined(DUMP_DBG) | ||
| int saved_errno; | ||
| #endif |
There was a problem hiding this comment.
comments for #endif: https://github.com/eclipse/omr/blob/master/doc/CodingStandard.md#comment-conditional-compilation-directives-if-ifdef-ifndef-else-elif-endif
| #endif | |
| #endif /* defined(DUMP_DBG) */ |
|
@AdamBrousseau |
f6c514a to
0eef207
Compare
|
@babsingh Thanks. Now amended. |
| portLibrary->tty_printf(portLibrary, "\tomrdump_create: errno: %i %s\n", savedErrno, portLibrary->error_last_error_message(portLibrary)); | ||
| } | ||
| fflush(stdout); | ||
| #endif |
There was a problem hiding this comment.
Some of this code is old, and predates the coding standards. Can I also request you to update the #endif comments for all defined(DUMP_DBG)? There are only 5 locations in this file. As we modify old code, we want to enforce as much of the coding standards as possible. Also, it will be more consistent.
If DUMP_DBG is defined, the errno from gencore() might be overridden by the tty_printf function before it is printed. Save the errno value from gencore() so it can be reliably printed. Signed-off-by: David McCann mccannd@uk.ibm.com
0eef207 to
05ccf36
Compare
|
Jenkins build all |
There was a problem hiding this comment.
The PR builds will only confirm that the pre-processor statements are correctly defined. The modified code won't be tested by the PR builds since DUMP_DBG is not defined by default. Visually, the modified code looks good to me. @davidjmccann Can you confirm if you have locally tested the code on an AIX machine and noticed no issues?
|
@babsingh Apart from the endif changes, I've built the code on AIX and it functions as I intended, with no other issues seen. e.g. |
Not at the moment, but it could probably be added. Not sure when we would have time to do it. Is this an env variable or a make option? |
Both should work. Compiler should accept these options via an env variable or cmake. Supplying as a cmake option will be better than the env variable. Because changes will be isolated (only applied) to the compile job. Env variable can unknowingly influence other things; there is less control over what is impacted. |
|
@0xdaryl Happy to merge? |
|
Jenkins build zos |
If DUMP_DBG is defined, the errno from gencore() might be overridden by the tty_printf function before it is printed. Save the errno value from gencore() so it can be reliably printed.
Signed-off-by: David McCann mccannd@uk.ibm.com