Skip to content

Allow core dump on OSX to change directories - #6185

Merged
0xdaryl merged 1 commit into
eclipse-omr:masterfrom
mikezhang1234567890:osx-ddr
Sep 30, 2021
Merged

0xdaryl merged 1 commit into
eclipse-omr:masterfrom
mikezhang1234567890:osx-ddr

Conversation

@mikezhang1234567890

Copy link
Copy Markdown
Contributor

Core dump utility would previously ignore the directory portions of the path.

Signed-off-by: Mike Zhang mike.h.zhang@ibm.com

Fixes the testOpenJ9DiagnosticsMXBean test failures in eclipse-openj9/openj9#13509

fyi: @keithc-ca @pshipton

Comment thread port/osx/omrosdump.c
}
/* Move to specified folder before dumping */
if (NULL != lastSep) {
lastSep[1] = '\0';

@keithc-ca keithc-ca Sep 23, 2021 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be

    lastSep[0] = '\0';

and the separator needs to be restored to fulfill the contract of this API (providing the name of the core file actually created in filename). As this is happening in the context of the child process, modifying filename is fine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On further reflection, perhaps it is correct as is, the filename might be /core.NNN in which case we want to chdir("/"): I think a comment would help here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied the line from https://github.com/eclipse/omr/blob/9494694dc394aa5dce88fb4d101a9a7ed17ca38b/port/unix/omrosdump.c#L176
which also preserves the separator.

Added a comment explaining why we keep the separator.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core dump utility would previously ignore the directory portions of the path.

Signed-off-by: Mike Zhang <mike.h.zhang@ibm.com>
@tajila

tajila commented Sep 27, 2021

Copy link
Copy Markdown
Contributor

@0xdaryl Please review/commit these changes

@0xdaryl 0xdaryl self-assigned this Sep 30, 2021
@0xdaryl

0xdaryl commented Sep 30, 2021

Copy link
Copy Markdown
Contributor

Jenkins build osx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants