-
Notifications
You must be signed in to change notification settings - Fork 737
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
Xdump msg_filter ignored for Exceptions with null messages #16531
Comments
On the surface, it seems reasonable that if |
During the time I've worked on support cases, I have not had a situation where I needed to capture dumps from exceptions with null detail message OR a message pattern, and it's difficult to imagine how that would come up. On the other hand, it has tripped me up multiple times when msg_filter did not seem to work, because a dump was taken when I thought it should be filtered out. I usually specify the range option at the same time to limit the number of dumps two one or two (to limit customer impact), and if all the dumps are 'used up' for exceptions with null message, we don't get any dump from the later exception with the matching message string. |
The intention of users using event "msg_filter" is that users only want to see the exceptions with the specified messages. It seems an exception with "null" exception message is not what users are asking for. I do not see this as a behavior change, but a correction of wrong behavior. Assuming this issue has been there since its beginning, it is indeed questionable why this issue has never been raised. Is there any way to get exceptions which only have a null message? Or those which exclude the null message ones? Suggest to clarify it in the infoCenter. |
|
If the problem described in the original report is fixed, it should be possible to exclude null message Exceptions by simply putting a I don't think there's a way to trigger only on Exceptions with a null message, and my suggested fix wouldn't change that. This would require something new, for example a special token in the |
I have just been hit by this again while working on a customer issue, and its preventing me from generating the dump I need. In this latest situation I don't know which method is throwing the Exception so I can't filter on a stack frame. I've tried filtering on the Exception message but I keep getting dumps triggered by Exceptions of the same type but with null messages. I have some ideas about how to proceed but it may take a couple more rounds of data collection to get around this issue. Has there been any progress towards a fix? |
When a message filter is specified, exceptions without a message should not match. Issue: eclipse-openj9#16531 Signed-off-by: Keith W. Campbell <[email protected]>
Thanks @keithc-ca ! |
Here's a simple testcase that throws and catches an IOException with a null Exception message:
When you run this testcase with the following Xdump option:
-Xdump:stack:events=throw+systhrow,filter=java/io/IOException,msg_filter=testmessage
the agent is triggered:
This is unexpected - i.e. I would not expect a null Exception message to match the
msg_filter
.If the testcase is modified to add an Exception message to the IOException the msg_filter, e.g.:
throw new java.io.IOException("foo");
the test works as expected - i.e. it doesn't match, and the agent is not triggered.
It seems that
msg_filter
has always behaved this way, but I have somehow never noticed. I think the problem is in trigger.c, starting here, where the return code (retCode
) is set toJ9RAS_DUMP_MATCH
if the filter matches (i.e. the Exception name matches the string in the Xdump agent'sfilter
):openj9/runtime/rasdump/trigger.c
Lines 429 to 431 in cc263cc
The code then checks the
subfilter
(i.e. themsg_filter
), and it will only setretCode
toJ9RAS_DUMP_NO_MATCH
if the Exception has a message. If it doesn't have a message, the code falls through and returnsJ9RAS_DUMP_MATCH
:openj9/runtime/rasdump/trigger.c
Lines 451 to 461 in cc263cc
I think the code needs an
else
block for theif (NULL != emessage)
conditional to setretCode
toJ9RAS_DUMP_NO_MATCH
when the Exception message is null, i.e. here:openj9/runtime/rasdump/trigger.c
Lines 461 to 462 in cc263cc
The text was updated successfully, but these errors were encountered: