Skip to content
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

Missing RAS COMMANDLINE, environment variables in core from mac #16082

Open
pshipton opened this issue Oct 11, 2022 · 5 comments
Open

Missing RAS COMMANDLINE, environment variables in core from mac #16082

pshipton opened this issue Oct 11, 2022 · 5 comments

Comments

@pshipton
Copy link
Member

Looking at a core file produced on AArch64 mac, running !coreinfo shows the following information is not available:

COMMANDLINE
COMMANDLINE is not available

Environment variables are not available

#15251 (comment)

@knn-k @keithc-ca

@knn-k
Copy link
Contributor

knn-k commented Oct 12, 2022

This is not specific to AArch64. Intel macOS does not implement the feature, either.

public String getCommandLine() throws DataUnavailableException
{
throw new DataUnavailableException("No command line available on OSX");
}

@knn-k knn-k changed the title Missing RAS COMMANDLINE, environment variables in core from AArch64 mac Missing RAS COMMANDLINE, environment variables in core from mac Oct 12, 2022
@pshipton
Copy link
Member Author

We added command line capture into an environment variable so we should be able to implement it.
#14536

@knn-k
Copy link
Contributor

knn-k commented Oct 13, 2022

The macOS build seems to capture only the command instead of the full command line. See an example below:

Test program:

public class GetCommandLine {
	public static void main(String[] args) {
		System.out.println("commandLine = [" + System.getenv("OPENJ9_JAVA_COMMAND_LINE") + "]");
	}
}

Running it on macOS:

% jdk-11.0.16.1+1/Contents/Home/bin/java -cp ~/Documents/java GetCommandLine
commandLine = [jdk-11.0.16.1+1/Contents/Home/bin/java]

It does not show the arguments -cp ~/Documents/java GetCommandLine.
Do I misunderstand anything?

@knn-k
Copy link
Contributor

knn-k commented Oct 14, 2022

I opened PR #16104 to fix captureCommandLine() on macOS for the problem I found above.
The original code in #14536 was using the variable start correctly, but #14684 changed it to buffer.
FYI. @keithc-ca

@knn-k
Copy link
Contributor

knn-k commented Oct 19, 2022

The problem here is how to put the information of environment variables in the core files for macOS (Intel/AArch64) in the Mach-O format.
I have little knowledge for that.

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

No branches or pull requests

3 participants