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

8318573: The nsk.share.jpda.SocketConnection should fail if socket was closed. #16280

Closed
wants to merge 2 commits into from

Conversation

lmesnik
Copy link
Member

@lmesnik lmesnik commented Oct 20, 2023

There are several failure with reason
"Cannot invoke "String.equals(Object)" because "" is null"
which really caused by reading the command from debugee via socket.
Like:

        String command = pipe.readln();

        if (!command.equals(AbstractDebuggeeTest.COMMAND_READY)) {
            setSuccess(false);
            log.complain("TEST BUG: unknown debuggee's command: " + command);

            return false;
        }

The command is null when socket fails with EOFException which usually means that debugee has been crashed/exited or killed by timeout handler.

However, it is not clear from the error log. So
https://bugs.openjdk.org/browse/JDK-8310940 has different problems with the same NPE symptom.

The fix update error handling to improve logging.

So output loos like:

_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/tmp' \
        -Dtest.compiler.opts= \
        -Dtest.java.opts= \
        -Dtest.jdk=/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/images/jdk \
        -Dcompile.jdk=/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/images/jdk \
        -Dtest.timeout.factor=4.0 \
        -Dtest.nativepath=/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/images/test/hotspot/jtreg/native \
        -Dtest.root=/home/lmesnik/ws/jdk-vmTestbase/open/test/hotspot/jtreg \
        -Dtest.name=vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002/TestDescription.java \
        -Dtest.file=/home/lmesnik/ws/jdk-vmTestbase/open/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002/TestDescription.java \
        -Dtest.src=/home/lmesnik/ws/jdk-vmTestbase/open/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002 \
        -Dtest.src.path=/home/lmesnik/ws/jdk-vmTestbase/open/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002:/home/lmesnik/ws/jdk-vmTestbase/open/test/hotspot/jtreg/vmTestbase:/home/lmesnik/ws/jdk-vmTestbase/open/test/lib \
        -Dtest.classes=/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/classes/0/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002/TestDescription.d \
        -Dtest.class.path=/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/classes/0/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002/TestDescription.d:/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/classes/0/vmTestbase:/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/classes/0/test/lib \
        -Dtest.class.path.prefix=/home/lmesnik/ws/jdk-vmTestbase/open/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002:/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/classes/0/vmTestbase:/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/classes/0/test/lib \
        -XX:MaxRAMPercentage=1.5625 \
        -Dtest.boot.jdk=/var/tmp/jib-lmesnik/install/jdk/21/35/bundles/linux-x64/jdk-21_linux-x64_bin.tar.gz/jdk-21 \
        -Djava.io.tmpdir=/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/tmp \
        -Djava.library.path=/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/images/test/hotspot/jtreg/native \
        com.sun.javatest.regtest.agent.MainWrapper /home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002/TestDescription.d/main.0.jta -verbose -arch=linux-x64 -waittime=5 -debugee.vmkind=java -transport.address=dynamic '-debugee.vmkeys="-XX:MaxRAMPercentage=1.5625 -Dtest.boot.jdk=/var/tmp/jib-lmesnik/install/jdk/21/35/bundles/linux-x64/jdk-21_linux-x64_bin.tar.gz/jdk-21 -Djava.io.tmpdir=/home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/tmp' "

TEST RESULT: Failed. Execution failed: `main' threw exception: nsk.share.Failure: Caught EOFException while reading an object from PipeIO Listener Thread connection. Check if debugee process is exited (crashed, killed) before responded.
--------------------------------------------------
Test results: failed: 1
Report written to /home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-results/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java/html/report.html
Results written to /home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java
Error: Some tests failed or other problems occurred.
Finished running test 'jtreg:open/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002/TestDescription.java'
Test report is stored in /home/lmesnik/ws/jdk-vmTestbase/build/linux-x64/test-results/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi_VirtualMachine_dispose_dispose002_TestDescription_java

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8318573: The nsk.share.jpda.SocketConnection should fail if socket was closed. (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16280/head:pull/16280
$ git checkout pull/16280

Update a local copy of the PR:
$ git checkout pull/16280
$ git pull https://git.openjdk.org/jdk.git pull/16280/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16280

View PR using the GUI difftool:
$ git pr show -t 16280

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16280.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 20, 2023

👋 Welcome back lmesnik! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 20, 2023
@openjdk
Copy link

openjdk bot commented Oct 20, 2023

@lmesnik The following label will be automatically applied to this pull request:

  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the serviceability serviceability-dev@openjdk.org label Oct 20, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 20, 2023

Webrevs

Copy link
Contributor

@sspitsyn sspitsyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks reasonable.
Thanks,
Serguei

return null;
e.printStackTrace(logger.getOutStream());
throw new Failure("Caught EOFException while reading an object from " + name + " connection."
+ " Check if debugee process is exited (crashed, killed) before responded.\n\t");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It feels like this line of error message can be improved but I do not have a suggestion at the moment.

@openjdk
Copy link

openjdk bot commented Oct 20, 2023

@lmesnik This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8318573: The nsk.share.jpda.SocketConnection should fail if socket was closed.

Reviewed-by: sspitsyn, cjplummer

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 26 new commits pushed to the master branch:

  • 5281499: 8316563: test tools/jpackage/linux/LinuxResourceTest.java fails on CentOS Linux release 8.5.2111 and Fedora 27
  • 8065233: 8318598: FFM stylistic cleanups
  • b1228de: 8314588: gc/metaspace/TestMetaspaceInitialization.java failed "assert(capacity_until_gc >= committed_bytes) failed: capacity_until_gc: 3145728 < committed_bytes: 3211264"
  • 5a97411: 8317971: RISC-V: implement copySignF/D and signumF/D intrinsics
  • 9144287: 8318601: Remove javadoc text about restricted methods
  • 4010642: 8077371: Binary files in JAXP test should be removed
  • fe52917: 8318457: Use prefix-less prepend methods directly to reduce branches in String concat expressions
  • 71c99a0: 8318448: Link PopupMenu/PopupMenuLocation.java failure to JDK-8259913
  • 2c23391: 8318101: Additional test cases for CSSAttributeEqualityBug
  • deadb9c: 8304684: Memory leak in DirectivesParser::set_option_flag
  • ... and 16 more: https://git.openjdk.org/jdk/compare/8f5f44070a7c6dbbbd1005f9d0af5ab7c35179df...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 20, 2023
…java

Co-authored-by: Chris Plummer <chris.plummer@oracle.com>
@lmesnik
Copy link
Member Author

lmesnik commented Oct 21, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Oct 21, 2023

Going to push as commit 4cf195f.
Since your change was applied there have been 36 commits pushed to the master branch:

  • af2f4bf: 8318622: ProblemList gc/cslocker/TestCSLocker.java on linux-x64 in Xcomp mode
  • a1a62d9: 8306308: (ch) Writer created by Channels::newWriter may lose data
  • 77b2394: 8318482: problemlist compiler/codecache/CheckLargePages.java on Linux-x64 until JDK-8317831 is fixed
  • d3ebb4a: 8317373: Add Telia Root CA v2
  • 66d90d5: 8318107: Un-ProblemList LocaleProvidersRun and CalendarDataRegression
  • 4dfa379: 7061097: [Doc] Inconsistenency between the spec and the implementation for DateFormat.Field
  • 158293d: 8316030: Update Libpng to 1.6.40
  • a045258: 8209595: MonitorVmStartTerminate.java timed out
  • 2121575: 8318421: AbstractPipeline.sourceStageSpliterator() chases pointers needlessly
  • 200b5a2: 8318420: AbstractPipeline invokes overridden method in constructor
  • ... and 26 more: https://git.openjdk.org/jdk/compare/8f5f44070a7c6dbbbd1005f9d0af5ab7c35179df...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 21, 2023
@openjdk openjdk bot closed this Oct 21, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 21, 2023
@openjdk
Copy link

openjdk bot commented Oct 21, 2023

@lmesnik Pushed as commit 4cf195f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants