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

Feature Request: Add Exception message to Xdump's "stack" agent output #8435

Closed
paulcheeseman opened this issue Jan 28, 2020 · 0 comments · Fixed by #15854
Closed

Feature Request: Add Exception message to Xdump's "stack" agent output #8435

paulcheeseman opened this issue Jan 28, 2020 · 0 comments · Fixed by #15854

Comments

@paulcheeseman
Copy link

paulcheeseman commented Jan 28, 2020

I regularly use the Xdump stack option for debugging. This agent makes it very easy to see all the Exceptions that are being thrown, regardless of whether they are caught. The ability to expose swallowed Exceptions can be extremely useful.

However, the usefulness is severely limited by the fact that the Exception message is not printed. So for example, you can't tell which class the JVM was looking for when a ClassNotFoundException is thrown.

Javacores contain the Exception message, so a workaround is to trigger a javacore (using Xdump's java agent) instead of a stack trace. This is fine when targeting a specific Exception, but it's not great when browsing through lots of them - going through 50 javacores is much slower than scrolling through 50 stack traces...

Example stack trace from Xdump as it is now:

JVMDUMP039I Processing dump event "throw", detail "java/lang/ClassNotFoundException" at 2020/01/28 10:21:43 - please wait.
Thread=main (00000000012E6FB0) Status=Running
	at java/io/ObjectInputStream.resolveClass(Ljava/io/ObjectStreamClass;)Ljava/lang/Class; (ObjectInputStream.java:841)
	at java/io/ObjectInputStream.readNonProxyDesc(Z)Ljava/io/ObjectStreamClass; (ObjectInputStream.java:2017) (Compiled Code)
	at java/io/ObjectInputStream.readClassDesc(Z)Ljava/io/ObjectStreamClass; (ObjectInputStream.java:1900)
	...

Example output from an equivalent javacore:

1TISIGINFO     Dump Event "throw" (00000010) Detail "java/lang/ClassNotFoundException" "com.example.MissingClass" received

For the stack agent something closer to the javacore's 1TISIGINFO output would be better:

JVMDUMP039I Processing dump event "throw", detail "java/lang/ClassNotFoundException" "com.example.MissingClass" at 2020/01/28 10:21:43 - please wait.
Thread=main (00000000012E6FB0) Status=Running
	at java/io/ObjectInputStream.resolveClass(Ljava/io/ObjectStreamClass;)Ljava/lang/Class; (ObjectInputStream.java:841)
	at java/io/ObjectInputStream.readNonProxyDesc(Z)Ljava/io/ObjectStreamClass; (ObjectInputStream.java:2017) (Compiled Code)
	at java/io/ObjectInputStream.readClassDesc(Z)Ljava/io/ObjectStreamClass; (ObjectInputStream.java:1900)
	...
@pshipton pshipton added this to the Backlog milestone Jan 29, 2020
imkabir added a commit to imkabir/openj9 that referenced this issue Sep 8, 2022
When Xdump:stack is used to dump stack trace filtered on an exception,
this change along with the primary exception message, displays
additional detail about the exception if any. This is similar to how
javacore displays additional detail about an exception in 1TISIGINFO
tag.

Fixes: eclipse-openj9#8435
Signed-off-by: Kabir Islam <kaislam1@in.ibm.com>
imkabir added a commit to imkabir/openj9 that referenced this issue Oct 12, 2022
When Xdump:stack is used to dump stack trace filtered on an exception,
this change along with the primary exception message, displays
additional detail about the exception if any. This is similar to how
javacore displays additional detail about an exception in 1TISIGINFO
tag.

Fixes: eclipse-openj9#8435
Signed-off-by: Kabir Islam <kaislam1@in.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants