JDK-8274453 : (sctp) com/sun/nio/sctp/SctpChannel/CloseDescriptors.java test should be resilient to lsof warnings
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-09-28
  • Updated: 2021-10-04
  • Resolved: 2021-09-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18 masterFixed
Related Reports
Relates :  
Description
I am seeing com/sun/nio/sctp/SctpChannel/CloseDescriptors.java failing like below. It reliably reproduces on my machine.

$ CONF=linux-x86_64-server-fastdebug make run-test TEST=com/sun/nio/sctp/SctpChannel/CloseDescriptors.java
...

99
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
end
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse file system /run/user/1000/doc
      Output information may be incomplete.
COMMAND     PID     USER   FD   TYPE             DEVICE SIZE/OFF      NODE NAME
java    1941570 buildbot    6u  unix 0x0000000000000000      0t0 153539367 type=STREAM
STDERR:
java.lang.RuntimeException: Failed: detected unclosed FD.
	at CloseDescriptors.main(CloseDescriptors.java:92)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:833)

Comments
Changeset: b1b66965 Author: Aleksey Shipilev <shade@openjdk.org> Date: 2021-09-29 16:57:40 +0000 URL: https://git.openjdk.java.net/jdk/commit/b1b66965f1ec6eae547cc4f70f8271bd39ded6da
29-09-2021

AFAICS, the test verifies that lsof outputs no more than LIMIT_LINES (2) lines. And on my machine, lsof prints some warnings that blow that limit. So this is a test bug. lsof -w might be used to suppress the warnings, I think. Adding line numbers to the log: line 0: lsof: WARNING: can't stat() squashfs file system ... line 1: Output information may be incomplete. line 2: lsof: WARNING: can't stat() squashfs file system ... line 3: Output information may be incomplete. line 4: lsof: WARNING: can't stat() squashfs file system ... line 5: Output information may be incomplete. line 6: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME line 7: java 970022 shade 6u unix 0x0000000000000000 0t0 160035770 type=STREAM
28-09-2021