When Hotspot SA tools jmap, jstack, and jsadebugd are run against a core file, 
they fail with the following runtime exception:

     OS/CPU combination linux/ppc64 not yet supported

I will post a patch set that adds this support.  The patch set consists of the 
following patches:

PATCH 1/2: Updates to non-Java files to support linux/ppc64 Hotspot SA with 
core files

PATCH 2/2: New PPC64 class files (and updates to generic files) to support 
linux/ppc64 Hotspot SA with core files

These two patches apply cleanly to a November 13 pull of the jdk9-dev upstream 
sources.

------------
Open issues:
------------
  1) The jstack tool does not print a stack entry for the 'main()' method of 
the Java
     workload (attached) under test.  For example:

     (Note:  Addresses and method signatures elided for brevity.)

       Thread 24358: (state = IN_JAVA, current Java SP = null
       )
        - java.lang.String.getChars(...) @bci=58, line=814, pc=..., Method*=... 
(Compiled frame; ... imprecise)
        - test.run_test() @bci=80, line=33, pc=..., Method*=... (Compiled frame)
     ==> (Expect an entry for test.main() here)
     
  2) The jstack tool sometimes prints what appears to be two complete stacks 
for the Java workload. For example:

       Thread 24779: (state = IN_JAVA, current Java SP = null
       )
        - java.lang.String.getChars(...) @bci=58, line=814, pc=..., Method*=... 
(Compiled frame; ... imprecise)
        - test.run_test() @bci=80, line=33, pc=..., Method*=... (Compiled frame)
        - test.get_my_chars(...) @bci=39, line=15, pc=..., Method*=... 
(Compiled frame)
        - test.run_test() @bci=92, line=34, pc=..., Method*=... (Compiled frame)

       Again, the 'test.main' method is missing, but there's also the anomaly 
of the 
       test.run_test' method showing up twice in the stack, implying that it is 
called
       by 'test.get_my_chars' at line 15.  But that that is not accurate. In 
fact, run_test
       does call String.getChars at line 33 *and* it calls test.get_my_chars at 
line 34 --
       but these are totally distinct call graphs.  Somehow, we are seeing 
these two distinct
       stacks in the core file, which seems impossible.

---------

Any help offered on these two open issues would be greatly appreciated.

-Maynard
import java.io.*;

public  class test

{

        java.io.FileWriter fs;

	void get_my_chars(int k, int the_end, char[] the_dest, String seed,
			  int iter ) throws Exception
	{
		seed.getChars(k,the_end,the_dest,0);
		if (iter >= 100000000 && iter % 500 == 0) {
			String str = new String(the_dest,0,the_end-k);
			String msg = "my interim string is " + str + "\n";
			fs.write(msg, 0, msg.length());
		}
	}

	String run_test() throws Exception
	{

		System.out.println("hi from run_test\n");
		String seed = "For all good men";
		java.io.File junk = new File("./junk.txt");
		fs = new FileWriter(junk);
		char dest[] = new char[20];
		int j = 0;
		int end = seed.length();
		seed.getChars(0,end,dest, 0);
		for (int i = 0; i < 200000000; i++) {
			j = i % 10;
			seed.getChars(j,end,dest, 0);
			get_my_chars(j, end, dest, seed, i);
		}
		fs.flush();
		fs.close();
		return new String(dest,0,end-j);
	}

	public static void main(String argv[])
	{
		int pid = 0;
		try {
			pid = Integer.parseInt(new File("/proc/self").getCanonicalFile().getName());
		} catch (Exception e) {
			System.out.println("Caught exception getting PID: " + e);
		}
		System.err.println("My PID: " + pid + "\n");
		System.out.println("Hello, world\n");
		test tst = new test();
		String res ="";
		try {
			res = tst.run_test();
		} catch (Exception e) {
			System.out.println("Caught exception " + e);
		}
		System.out.println("Ending string is " + res + "\n");
	}
}

Reply via email to