On Sat, 9 May 2026 01:07:52 GMT, Chris Plummer <[email protected]> wrote:

>> The test sees the following output and is supposed to detect the "main[1]" 
>> prompt to indicate it is done with the "locals" command that was issued, and 
>> then issue a "cont" command:
>> 
>> [9:13:15.40] Sending command: locals
>> [9:13:15.560] reply[0]: Method arguments:
>> [9:13:15.561] reply[1]: args = instance of java.lang.String[3] (id=669)
>> [9:13:15.561] reply[2]: Local variables:
>> [9:13:15.561] reply[3]: main[1]
>> [9:13:15.561] Sending command: cont 
>> 
>> However, the output instead looks like this:
>> 
>> [21:15:18.114] Sending command: locals
>> [21:15:18.515] reply[0]: Method arguments:
>> [21:15:18.515] reply[1]: args = instance of java.lang.String[3] (id=686)
>> [21:15:18.515] reply[2]: Local variables:
>> [21:15:18.515] Sending command: cont
>> [21:15:18.716] reply[0]: main[1] > 
>> 
>> The JdbTest.findPrompt() code looks for a pattern of characters, followed by 
>> '[', then a number, then ']'. Unfortunately it matches the String[3] text 
>> you see in the output. Because of that the test thought the "locals" command 
>> had completed, and issued the "cont" command too soon, which gets the test 
>> out of sync.
>> 
>> Apparently some tests have had this same issue before and a solution was 
>> already available. You just need to set compoundPromptIdent to the prompt 
>> that the test expects (sans the square brackets part).
>> 
>> I also fixed a couple of comment typos I noticed in JdbTest while debugging 
>> this.
>> 
>> Tested by running kill003 a couple hundred times on the failing platform and 
>> with the failing JVM args.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Chris Plummer has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - minor comment fix
>  - more test fixes

Looks good modulo some nit and question.

test/hotspot/jtreg/vmTestbase/nsk/jdb/kill/kill003/kill003.java line 80:

> 78: 
> 79:         // Make sure we stop in jdb when the NPE is thrown or rethrown.
> 80:         reply = jdb.receiveReplyFor(JdbCommand._catch + "all 
> java.lang.NullPointerException");

Q: I wonder if ever there is any need to check what is in the `reply`. The 
style of this file is that the `reply` is always set but is not checked. Then 
why do we need to ever set it.

test/hotspot/jtreg/vmTestbase/nsk/jdb/kill/kill003/kill003.java line 100:

> 98:         reply = jdb.receiveReplyFor(JdbCommand.cont);
> 99: 
> 100:         // jdb got notified of the NPE for the kill command. continue 
> and jdb will get

Nit: Suggestion: s/continue/Continue/

-------------

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/31048#pullrequestreview-4280130975
PR Review Comment: https://git.openjdk.org/jdk/pull/31048#discussion_r3232969888
PR Review Comment: https://git.openjdk.org/jdk/pull/31048#discussion_r3232980789

Reply via email to