kohlschutter / junixsocket

Unix Domain Sockets in Java 7 and newer (AF_UNIX), AF_TIPC, AF_VSOCK, and more
Apache License 2.0
438 stars 114 forks source link

Could not load native library junixsocket-native for architecture amd64-Linux #125

Closed EvenChang closed 1 year ago

EvenChang commented 1 year ago

Describe the bug Hi, I'm using docker-java with docker host ("unix:///var/run/docker.sock") to connect docker damen

I have a same issue with Issues-94

In my local MAC environment didn't happened, but development environment Linux system it will happen.

javax.ws.rs.ProcessingException: java.lang.NullPointerException
    at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:496)
    at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:278)
    at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$2(JerseyInvocation.java:787)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:316)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:298)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:229)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:414)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:785)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:438)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:329)
    at com.github.dockerjava.jaxrs.ListImagesCmdExec.execute(ListImagesCmdExec.java:43)
    at com.github.dockerjava.jaxrs.ListImagesCmdExec.execute(ListImagesCmdExec.java:19)
    at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)
    at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)[148:com.github.docker-java:3.1.5]
Caused by: java.lang.NullPointerException
    at org.newsclub.net.unix.AFSocketAddress.getNativeAddressDirectBuffer(AFSocketAddress.java:505)
    at org.newsclub.net.unix.AFUNIXSocketAddress.<init>(AFUNIXSocketAddress.java:111)
    at org.newsclub.net.unix.AFUNIXSocketAddress.<init>(AFUNIXSocketAddress.java:96)
    at com.github.dockerjava.jaxrs.UnixConnectionSocketFactory.connectSocket(UnixConnectionSocketFactory.java:74)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:394)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
    at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:450)
    ... 67 more

To Reproduce Steps to reproduce the behavior:

  1. When I use /var/run/docker.sock to connect.

Expected behavior

Output/Screenshots image

Environment (please complete the following information):

Does any one could give me a hint what should I do next ? Thanks.

EvenChang commented 1 year ago

I found cannot get class from name (org.newsclub.lib.junixsocket.common.NarMetadata) Class<?> providerClass = Class.forName(providerClassname);

But I had specific junixsocket-native-common.2.6.1.jar as dependency. What I miss ?

image

org.newsclub.lib.junixsocket.common.NarMetadata not found by com.kohlschutter.junixsocket.junixsocket-common [152]
kohlschuetter commented 1 year ago

The native library couldn't be loaded (see the error reported in line 84 of your screenshot with the line highlighted in blue). (UnsatisfiedLinkError).

The NullPointerException is a subsequent error of this one. I will add some better explanation to this exception (we were able to instantiate but not connect AFUNIXSocketAddress), but the actual problem is that the library could not be loaded in the first place.

Please post the full stack trace of the UnsatisfiedLinkError (line 85 in your screenshot), this may reveal what's going on.

I suspect that your /tmp directory is mounted as noexec, which prevents the library from being loaded (it needs to be extracted from the jar to be loaded via System.loadLibrary).

If that's the case, you could:

  1. Remount /tmp (or whatever java.io.tmpdir you have) without noexec
  2. Specify a different folder for junixsocket using the org.newsclub.net.unix.library.tmpdir System property.
  3. Extract the library from the jar yourself and specify an absolute path to the library using the org.newsclub.net.unix.library.override System property.

In any case, please share your results below.

Thanks for reporting!

EvenChang commented 1 year ago
0 = {StackTraceElement@13985} "org.newsclub.net.unix.NativeLibraryLoader.initCantLoadLibraryError(NativeLibraryLoader.java:321)"
1 = {StackTraceElement@13986} "org.newsclub.net.unix.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:303)"
2 = {StackTraceElement@13987} "org.newsclub.net.unix.NativeUnixSocket.<clinit>(NativeUnixSocket.java:81)"
3 = {StackTraceElement@13988} "org.newsclub.net.unix.AFSocket.isSupported(AFSocket.java:312)"
4 = {StackTraceElement@13989} "org.newsclub.net.unix.AFSocket.initCapabilities(AFSocket.java:375)"
5 = {StackTraceElement@13990} "org.newsclub.net.unix.AFSocket.<clinit>(AFSocket.java:50)"
6 = {StackTraceElement@13991} "com.github.dockerjava.jaxrs.ApacheUnixSocket.<init>(ApacheUnixSocket.java:51)"
7 = {StackTraceElement@13992} "com.github.dockerjava.jaxrs.UnixConnectionSocketFactory.createSocket(UnixConnectionSocketFactory.java:66)"
8 = {StackTraceElement@13993} "org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:119)"
9 = {StackTraceElement@13994} "org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)"
10 = {StackTraceElement@13995} "org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:394)"
11 = {StackTraceElement@13996} "org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)"
12 = {StackTraceElement@13997} "org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)"
13 = {StackTraceElement@13998} "org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)"
14 = {StackTraceElement@13999} "org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)"
15 = {StackTraceElement@14000} "org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)"
16 = {StackTraceElement@14001} "org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)"
17 = {StackTraceElement@14002} "org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:450)"
18 = {StackTraceElement@14003} "org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:278)"
19 = {StackTraceElement@14004} "org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$2(JerseyInvocation.java:787)"
20 = {StackTraceElement@14005} "org.glassfish.jersey.internal.Errors.process(Errors.java:316)"
21 = {StackTraceElement@14006} "org.glassfish.jersey.internal.Errors.process(Errors.java:298)"
22 = {StackTraceElement@14007} "org.glassfish.jersey.internal.Errors.process(Errors.java:229)"
23 = {StackTraceElement@14008} "org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:414)"
24 = {StackTraceElement@14009} "org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:785)"
25 = {StackTraceElement@14010} "org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:438)"
26 = {StackTraceElement@14011} "org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:329)"
27 = {StackTraceElement@14012} "com.github.dockerjava.jaxrs.ListImagesCmdExec.execute(ListImagesCmdExec.java:43)"
28 = {StackTraceElement@14013} "com.github.dockerjava.jaxrs.ListImagesCmdExec.execute(ListImagesCmdExec.java:19)"
29 = {StackTraceElement@14014} "com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)"
30 = {StackTraceElement@14015} "com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)"
31 = {StackTraceElement@14016} "com.nocsys.ovnvtep.rest.OvnVtepWebResource.getOvnTraceL3Result(OvnVtepWebResource.java:994)"
32 = {StackTraceElement@14017} "com.nocsys.ovnvtep.rest.OvnVtepWebResource.getOvnTracePath(OvnVtepWebResource.java:876)"
33 = {StackTraceElement@14018} "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"
34 = {StackTraceElement@14019} "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)"
35 = {StackTraceElement@14020} "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
36 = {StackTraceElement@14021} "java.lang.reflect.Method.invoke(Method.java:498)"
37 = {StackTraceElement@14022} "org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)"
38 = {StackTraceElement@14023} "org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)"
39 = {StackTraceElement@14024} "org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)"
40 = {StackTraceElement@14025} "org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)"
41 = {StackTraceElement@14026} "org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)"
42 = {StackTraceElement@14027} "org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)"
43 = {StackTraceElement@14028} "org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)"
44 = {StackTraceElement@14029} "org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)"
45 = {StackTraceElement@14030} "org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)"
46 = {StackTraceElement@14031} "org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)"
47 = {StackTraceElement@14032} "org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)"
48 = {StackTraceElement@14033} "org.glassfish.jersey.internal.Errors.process(Errors.java:316)"
49 = {StackTraceElement@14034} "org.glassfish.jersey.internal.Errors.process(Errors.java:298)"
50 = {StackTraceElement@14035} "org.glassfish.jersey.internal.Errors.process(Errors.java:268)"
51 = {StackTraceElement@14036} "org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)"
52 = {StackTraceElement@14037} "org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)"
53 = {StackTraceElement@14038} "org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)"
54 = {StackTraceElement@14039} "org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)"
55 = {StackTraceElement@14040} "org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)"
56 = {StackTraceElement@14041} "org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)"
57 = {StackTraceElement@14042} "org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)"
58 = {StackTraceElement@14043} "org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)"
59 = {StackTraceElement@14044} "org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)"
60 = {StackTraceElement@14045} "org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)"
61 = {StackTraceElement@14046} "org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)"
62 = {StackTraceElement@14047} "org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)"
63 = {StackTraceElement@14048} "org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)"
64 = {StackTraceElement@14049} "org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)"
65 = {StackTraceElement@14050} "org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)"
66 = {StackTraceElement@14051} "org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)"
67 = {StackTraceElement@14052} "org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:427)"
68 = {StackTraceElement@14053} "org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)"
69 = {StackTraceElement@14054} "org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)"
70 = {StackTraceElement@14055} "org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)"
71 = {StackTraceElement@14056} "org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)"
72 = {StackTraceElement@14057} "org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)"
73 = {StackTraceElement@14058} "org.eclipse.jetty.server.Server.handle(Server.java:370)"
74 = {StackTraceElement@14059} "org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)"
75 = {StackTraceElement@14060} "org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:973)"
76 = {StackTraceElement@14061} "org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1035)"
77 = {StackTraceElement@14062} "org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:641)"
78 = {StackTraceElement@14063} "org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:231)"
79 = {StackTraceElement@14064} "org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)"
80 = {StackTraceElement@14065} "org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)"
81 = {StackTraceElement@14066} "org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)"
82 = {StackTraceElement@14067} "org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)"
83 = {StackTraceElement@14068} "org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)"
84 = {StackTraceElement@14069} "java.lang.Thread.run(Thread.java:748)"

-- suppressedExceptions --

image

According these information, I have problem to load junixsocket-native library despite I had import this jar file.

Sorry I don't have enough knowledge in "noexec", do you think is tmp folder causing library cannot be loaded with below information?

Even_61 ➜  ~ findmnt -l | grep noexec                                               [22-12-09 23:40]
/sys                                                                                                   sysfs                  sysfs       rw,nosuid,nodev,noexec,relatime
/proc                                                                                                  proc                   proc        rw,nosuid,nodev,noexec,relatime
/dev/pts                                                                                               devpts                 devpts      rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
/run                                                                                                   tmpfs                  tmpfs       rw,nosuid,noexec,relatime,size=1642548k,mode=755
/sys/kernel/security                                                                                   securityfs             securityfs  rw,nosuid,nodev,noexec,relatime
/run/lock                                                                                              tmpfs                  tmpfs       rw,nosuid,nodev,noexec,relatime,size=5120k
/sys/fs/cgroup                                                                                         tmpfs                  tmpfs       ro,nosuid,nodev,noexec,mode=755
/sys/fs/cgroup/systemd                                                                                 cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
/sys/fs/pstore                                                                                         pstore                 pstore      rw,nosuid,nodev,noexec,relatime
/sys/fs/cgroup/blkio                                                                                   cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,blkio
/sys/fs/cgroup/cpu,cpuacct                                                                             cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,cpu,cpuacct
/sys/fs/cgroup/rdma                                                                                    cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,rdma
/sys/fs/cgroup/net_cls,net_prio                                                                        cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,net_cls,net_prio
/sys/fs/cgroup/perf_event                                                                              cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,perf_event
/sys/fs/cgroup/pids                                                                                    cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,pids
/sys/fs/cgroup/devices                                                                                 cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,devices
/sys/fs/cgroup/freezer                                                                                 cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,freezer
/sys/fs/cgroup/hugetlb                                                                                 cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,hugetlb
/sys/fs/cgroup/memory                                                                                  cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,memory
/sys/fs/cgroup/cpuset                                                                                  cgroup                 cgroup      rw,nosuid,nodev,noexec,relatime,cpuset
/run/snapd/ns                                                                                          tmpfs[/snapd/ns]       tmpfs       rw,nosuid,noexec,relatime,size=1642548k,mode=755
/var/lib/docker/containers/4bc5f88fdfccd2db77bbfad4a4db177f323bb5420459208335f331c089a2c96a/mounts/shm shm                    tmpfs       rw,nosuid,nodev,noexec,relatime,size=65536k
/run/netns                                                                                             tmpfs[/netns]          tmpfs       rw,nosuid,noexec,relatime,size=1642548k,mode=755
/var/lib/docker/containers/18a21077d0ffbf0be7241bfe2325503ded18a27d689b566e5ee4dcfc13856ee6/mounts/shm shm                    tmpfs       rw,nosuid,nodev,noexec,relatime,size=65536k
/var/lib/docker/containers/fc0d157bbdfa63f46be1ee8b19a0c0dac9f2de25d7d5146a2b593f073e7f5c7f/mounts/shm shm                    tmpfs       rw,nosuid,nodev,noexec,relatime,size=65536k
Even_61 ➜  ~ df -h                                                           [22-12-09 23:40]
Filesystem      Size  Used Avail Use% Mounted on
udev            7.9G     0  7.9G   0% /dev
tmpfs           1.6G  174M  1.4G  11% /run
/dev/sda1        58G   32G   24G  58% /
tmpfs           7.9G     0  7.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/loop0       19M   19M     0 100% /snap/frr/132
/dev/loop4       19M   19M     0 100% /snap/frr/144
/dev/loop1       56M   56M     0 100% /snap/core18/2620
/dev/loop6       56M   56M     0 100% /snap/core18/2632
/dev/loop3      117M  117M     0 100% /snap/core/14399
tmpfs           1.6G     0  1.6G   0% /run/user/1001

I don't know is it possible causing by my build code tool "BUCK", but I had confirmed junixsocke-native.jar had downloaded and import it already ...

kohlschuetter commented 1 year ago

Please also post the output of the selftest:

java -jar junixsocket-selftest-2.6.1-hotpatch-jar-with-dependencies.jar

EvenChang commented 1 year ago

Here is my selftest output.

Even_61 ➜  tmp java -jar junixsocket-selftest-2.6.1-hotpatch-jar-with-dependencies.jar                                                                                                          [22-12-10 22:26]
This program determines whether junixsocket is supported on the current platform.
The final line should say whether the selftest passed or failed.

If the selftest failed, please visit https://github.com/kohlschutter/junixsocket/issues
and file a new bug report with the output below.

junixsocket selftest version 2.7.0-SNAPSHOT

Git properties:

git.build.version: 2.7.0-SNAPSHOT
git.commit.id.abbrev: 521d4fb
git.commit.id.describe: junixsocket-2.6.1-4-g521d4fb-dirty
git.commit.id.full: 521d4fb496944066e07953431f66e944983503b1
git.commit.time: 2022-10-27T14:54:56+02:00
git.dirty: true

System properties:

awt.toolkit: sun.awt.X11.XToolkit
file.encoding: UTF-8
file.encoding.pkg: sun.io
file.separator: /
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
java.awt.printerjob: sun.print.PSPrinterJob
java.class.path: junixsocket-selftest-2.6.1-hotpatch-jar-with-dependencies.jar
java.class.version: 52.0
java.endorsed.dirs: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/endorsed
java.ext.dirs: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext
java.home: /usr/lib/jvm/java-8-openjdk-amd64/jre
java.io.tmpdir: /tmp
java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
java.runtime.name: OpenJDK Runtime Environment
java.runtime.version: 1.8.0_222-8u222-b10-1ubuntu1~16.04.1-b10
java.specification.name: Java Platform API Specification
java.specification.vendor: Oracle Corporation
java.specification.version: 1.8
java.vendor: Private Build
java.vendor.url: http://java.oracle.com/
java.vendor.url.bug: http://bugreport.sun.com/bugreport/
java.version: 1.8.0_222
java.vm.info: mixed mode
java.vm.name: OpenJDK 64-Bit Server VM
java.vm.specification.name: Java Virtual Machine Specification
java.vm.specification.vendor: Oracle Corporation
java.vm.specification.version: 1.8
java.vm.vendor: Private Build
java.vm.version: 25.222-b10
line.separator: \n
os.arch: amd64
os.name: Linux
os.version: 4.15.0-65-generic
path.separator: :
sun.arch.data.model: 64
sun.boot.class.path: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/classes
sun.boot.library.path: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64
sun.cpu.endian: little
sun.cpu.isalist:
sun.io.unicode.encoding: UnicodeLittle
sun.java.command: junixsocket-selftest-2.6.1-hotpatch-jar-with-dependencies.jar
sun.java.launcher: SUN_STANDARD
sun.jnu.encoding: UTF-8
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
sun.os.patch.level: unknown
user.country: US
user.dir: /home/mars/tmp
user.home: /home/mars
user.language: en
user.name: mars
user.timezone:

BEGIN contents of file: /etc/os-release
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
=END= contents of file: /etc/os-release

BEGIN contents of file: /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
=END= contents of file: /etc/lsb-release

BEGIN contents of file: /etc/debian_version
stretch/sid
=END= contents of file: /etc/debian_version

AFSocket.isSupported: true

AFUNIXSocket.isSupported: true

Testing "junixsocket-common"... PeerCredentialsTest.testDatagramSocket()...
Supported credentials:   pid uid gid additional_gids
Unsupported credentials: uuid
Testing "junixsocket-common"... SocketTest.testMain()...
org.newsclub.net.unix.AFUNIXSocket.isSupported(): true
CAPABILITY_PEER_CREDENTIALS: true
CAPABILITY_ANCILLARY_MESSAGES: true
CAPABILITY_FILE_DESCRIPTORS: true
CAPABILITY_ABSTRACT_NAMESPACE: true
CAPABILITY_UNIX_DATAGRAMS: true
CAPABILITY_NATIVE_SOCKETPAIR: true
CAPABILITY_FD_AS_REDIRECT: false
CAPABILITY_TIPC: false
CAPABILITY_UNIX_DOMAIN: true
CAPABILITY_VSOCK: true
CAPABILITY_VSOCK_DGRAM: false
CAPABILITY_ZERO_LENGTH_SEND: true
Testing "junixsocket-common"... done
.
'-- JUnit Jupiter [OK]
  +-- AFTIPCSocketAddressTest [OK]
  | +-- testParseFail() [OK]
  | +-- testSchemesAvailable() [OK]
  | +-- testGeneric() [OK]
  | +-- testSocatString() [OK]
  | +-- testSocketURI() [OK]
  | +-- testServiceRangeURI() [OK]
  | '-- testServiceURI() [OK]
  +-- AFUNIXSocketAddressTest [OK]
  | +-- testSchemesAvailable() [OK]
  | +-- testSocatString() [OK]
  | +-- testURITemplateWithPortNumber() [OK]
  | +-- testURITemplate() [OK]
  | +-- testHttpUnix() [OK]
  | +-- testUnixScheme() [OK]
  | +-- testFileScheme() [OK]
  | +-- testAbstractNamespace() [OK]
  | '-- testParseURIandBack() [OK]
  +-- AbstractNamespaceTest [OK]
  | +-- testBindTrailingZeroes() [OK]
  | +-- testBind() [OK]
  | '-- testBindLongAbstractAddress() [OK]
  +-- AcceptTimeoutTest [OK]
  | +-- testCatchTimeout() [OK]
  | +-- testTimeoutAfterDelay() [OK]
  | '-- testAcceptWithoutBindToService() [OK]
  +-- AvailableTest [OK]
  | +-- testAvailableAtClient() [OK]
  | '-- testAvailableAtServer() [OK]
  +-- BufferOverflowTest [OK]
  | +-- writeOverflow() [OK]
  | +-- readUpTo() [OK]
  | '-- readOutOfBounds() [OK]
  +-- CancelAcceptTest [OK]
  | '-- issue6test1() [OK]
  +-- DatagramSocketTest [OK]
  | +-- testBindConnect() [OK]
  | +-- testPeekTimeout() [OK]
  | '-- testReadTimeout() [OK]
  +-- EndOfFileTest [OK]
  | +-- clientWriteToSocketClosedByClient() [OK]
  | +-- clientWriteToSocketClosedByServer() [OK]
  | +-- bidirectionalSanity() [OK]
  | +-- serverWriteToSocketClosedByClient() [OK]
  | +-- serverWriteToSocketClosedByServer() [OK]
  | +-- clientReadEof() [OK]
  | '-- serverReadEof() [OK]
  +-- FileDescriptorCastTest [OK]
  | +-- testInvalidFileDescriptor() [OK]
  | +-- testPipe() [OK]
  | +-- testAvailableTypes() [OK]
  | +-- testStdout() [OK]
  | '-- testRandomAccessFile() [OK]
  +-- FileDescriptorCastTest [OK]
  | +-- testUnconnectedServerAsSocket() [OK]
  | +-- testSocketPairNative() [OK]
  | +-- testDatagramFileChannel() [OK]
  | +-- testSocketPair() [OK]
  | +-- testDatagramSocket() [OK]
  | +-- testSocketPorts() [OK]
  | +-- testDatagramPorts() [OK]
  | +-- testForkedVMRedirectStdin() [S] Missing capabilities: [CAPABILITY_FD_AS_REDIRECT]
  | '-- testServer() [OK]
  +-- FileDescriptorsTest [OK]
  | +-- testNullFileDescriptorArray() [OK]
  | +-- testNoAncillaryReceiveBuffer() [OK]
  | +-- testSendRecvFileDescriptors() [OK]
  | +-- testBadFileDescriptor() [OK]
  | +-- testDatagramSocket() [OK]
  | +-- testAncillaryReceiveBufferTooSmall() [OK]
  | +-- testFileInputStreamPartiallyConsumed() [OK]
  | +-- testEmptyFileDescriptorArray() [OK]
  | '-- testFileInputStream() [OK]
  +-- InetAddressTest [OK]
  | +-- testFromToBytes() [OK]
  | +-- testHostnameString() [OK]
  | +-- testIsLoopbackAddress() [OK]
  | '-- testHostnameStringEndsWithJunixSocket() [OK]
  +-- PeerCredentialsTest [OK]
  | +-- testSocketsSameProcess() [OK]
  | '-- testDatagramSocket() [OK]
  +-- PipeTest [OK]
  | +-- testPipe() [OK]
  | '-- testPipeRecvHang() [OK]
  +-- ReadWriteTest [OK]
  | +-- testReceiveWithByteArraySendByteForByte() [OK]
  | +-- testReceiveWithByteArraySendWithByteArray() [OK]
  | +-- testReceiveDataByteForByteSendByteForByte() [OK]
  | '-- testReceiveDataByteForByteSendWithByteArray() [OK]
  +-- SelectorTest [OK]
  | +-- testNonBlockingAccept() [OK]
  | +-- testClosedSelectorSelect() [OK]
  | +-- testClosedSelectorWakeup() [OK]
  | +-- testCancelSelect() [OK]
  | +-- testConnectionCloseImmediateClientDisconnect() [OK]
  | +-- testConnectionCloseImmediateClientDisconnectKeepLooping() [OK]
  | +-- testConnectionCloseEventualClientDisconnectKeepLooping() [OK]
  | '-- testConnectionCloseEventualClientDisconnect() [OK]
  +-- ServerSocketCloseTest [OK]
  | +-- testUnblockAcceptsWithSoTimeout() [OK]
  | '-- testUnblockAcceptsWithoutSoTimeout() [OK]
  +-- ServerSocketTest [OK]
  | +-- testUnboundServerSocket() [OK]
  | +-- testBindBadArguments() [OK]
  | +-- testCloseable() [OK]
  | '-- testSupported() [OK]
  +-- SocketAddressTest [OK]
  | +-- testInetAddress() [OK]
  | +-- testPath() [OK]
  | +-- testPort() [OK]
  | +-- testEmptyAddress() [OK]
  | +-- testLegacyConstructor() [OK]
  | +-- testByteConstructor() [OK]
  | '-- testAbstractNamespace() [OK]
  +-- SocketChannelTest [OK]
  | +-- testDoubleBindAddressReusable() [OK]
  | +-- testDoubleBindAddressNotReusable() [OK]
  | '-- testNonBlockingConnect() [OK]
  +-- SocketFactoryTest [OK]
  | +-- testURISchemeCeateSocketWithInvalidHostname() [OK]
  | +-- testURISchemeCeateSocketWithIllegalArguments() [OK]
  | +-- testURISchemeCeateSocketThenConnect() [OK]
  | +-- testURISchemeCeateSocketWithHostnameValidCases() [OK]
  | +-- testSystemProperty() [OK]
  | '-- testFactoryArg() [OK]
  +-- SocketPairTest [OK]
  | +-- testDatagramPair() [OK]
  | '-- testSocketPair() [OK]
  +-- SocketTest [OK]
  | +-- testConnectBadArguments() [OK]
  | +-- testBindBadArguments() [OK]
  | +-- testCloseable() [OK]
  | +-- testUnconnectedSocket() [OK]
  | +-- testMain() [OK]
  | +-- testLoadedLibrary() [OK]
  | +-- testSupports() [OK]
  | +-- testVersion() [OK]
  | +-- testReceivedFileDescriptorsUnconnected() [OK]
  | '-- testSupported() [OK]
  +-- SoTimeoutTest [OK]
  | +-- issue14Fail() [OK]
  | +-- issue14Pass() [OK]
  | +-- testSocketTimeoutExceptionRead() [OK]
  | '-- testSocketTimeoutExceptionWrite() [OK]
  +-- StandardSocketOptionsTest [OK]
  | +-- testUnconnectedServerSocketOptions() [S] This test requires Java 9 or later
  | '-- testSocketOptions() [S] This test requires Java 9 or later
  +-- TcpNoDelayTest [OK]
  | +-- testDefaultImpl() [OK]
  | '-- testStrictImpl() [OK]
  '-- ThroughputTest [OK]
    +-- testDatagramChannel() [OK]
    +-- testDatagramChannelDirect() [OK]
    +-- testDatagramChannelNonBlocking() [OK]
    +-- testDatagramChannelNonBlockingDirect() [OK]
    +-- testDatagramPacket() [OK]
    +-- testSocket() [OK]
    +-- testSocketChannel() [OK]
    '-- testSocketChannelDirectBuffer() [OK]

Test run finished after 6114 ms
[        29 containers found      ]
[         0 containers skipped    ]
[        29 containers started    ]
[         0 containers aborted    ]
[        29 containers successful ]
[         0 containers failed     ]
[       131 tests found           ]
[         3 tests skipped         ]
[       128 tests started         ]
[         0 tests aborted         ]
[       128 tests successful      ]
[         0 tests failed          ]

Testing "junixsocket-tipc"... done                                                                                                                                                                                    .                                                                                                                                                                                                                     '-- JUnit Jupiter [OK]
  +-- AcceptTimeoutTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- AFTIPCTopologyWatcherTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- AncillaryMessageTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- AvailableTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- BufferOverflowTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- CancelAcceptTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- DatagramSocketTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- EndOfFileTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- ReadWriteTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- SelectorTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- ServerSocketCloseTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- ServerSocketTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- SocketChannelTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- SocketOptionsTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- SocketPairTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- SocketTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- SoTimeoutTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- StandardSocketOptionsTest [S] Missing capabilities: [CAPABILITY_TIPC]
  +-- TcpNoDelayTest [S] Missing capabilities: [CAPABILITY_TIPC]
  '-- ThroughputTest [S] Missing capabilities: [CAPABILITY_TIPC]

Test run finished after 21 ms
[        21 containers found      ]
[        20 containers skipped    ]
[         1 containers started    ]
[         0 containers aborted    ]
[         1 containers successful ]
[         0 containers failed     ]
[        80 tests found           ]
[        80 tests skipped         ]
[         0 tests started         ]
[         0 tests aborted         ]
[         0 tests successful      ]
[         0 tests failed          ]

Testing "junixsocket-vsock"... AFVSOCKExtensionsTest.testGetLocalID()...                                                                                                                                              Local CID: 2                                                                                                                                                                                                          Testing "junixsocket-vsock"... AcceptTimeoutTest.testTimeoutAfterDelay()... java.net.SocketTimeoutException: Resource temporarily unavailable
    at org.newsclub.net.unix.NativeUnixSocket.accept(Native Method)
    at org.newsclub.net.unix.AFSocketImpl.accept0(AFSocketImpl.java:260)
    at org.newsclub.net.unix.AFServerSocket.accept1(AFServerSocket.java:297)
    at org.newsclub.net.unix.AFServerSocket.accept(AFServerSocket.java:291)
    at org.newsclub.net.unix.vsock.AFVSOCKServerSocket.accept(AFVSOCKServerSocket.java:119)
    at org.newsclub.net.unix.vsock.AFVSOCKServerSocket.accept(AFVSOCKServerSocket.java:36)
    at org.newsclub.net.unix.AcceptTimeoutTest.lambda$testTimeoutAfterDelay$1(AcceptTimeoutTest.java:164)
    at org.junit.jupiter.api.AssertTimeoutPreemptively.lambda$assertTimeoutPreemptively$0(AssertTimeoutPreemptively.java:48)
    at org.junit.jupiter.api.AssertTimeoutPreemptively.lambda$submitTask$3(AssertTimeoutPreemptively.java:95)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Testing "junixsocket-vsock"... SocketTest.testMain()...
org.newsclub.net.unix.vsock.AFVSOCKSocket.isSupported(): true
Testing "junixsocket-vsock"... done
.
'-- JUnit Jupiter [OK]
  +-- AFVSOCKExtensionsTest [OK]
  | '-- testGetLocalID() [OK]
  +-- AcceptTimeoutTest [OK]
  | +-- testCatchTimeout() [OK]
  | +-- testAcceptWithoutBindToService() [OK]
  | '-- testTimeoutAfterDelay() [A] Kernel may be too old or not configured for full VSOCK support
  +-- AvailableTest [OK]
  | +-- testAvailableAtClient() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | '-- testAvailableAtServer() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  +-- BufferOverflowTest [OK]
  | +-- writeOverflow() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- readUpTo() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | '-- readOutOfBounds() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  +-- CancelAcceptTest [OK]
  | '-- issue6test1() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  +-- DatagramSocketTest [S] Missing capabilities: [CAPABILITY_VSOCK_DGRAM]
  +-- EndOfFileTest [OK]
  | +-- clientWriteToSocketClosedByClient() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- clientWriteToSocketClosedByServer() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- bidirectionalSanity() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- serverWriteToSocketClosedByClient() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- serverWriteToSocketClosedByServer() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- clientReadEof() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | '-- serverReadEof() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  +-- ReadWriteTest [OK]
  | +-- testReceiveWithByteArraySendByteForByte() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- testReceiveWithByteArraySendWithByteArray() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- testReceiveDataByteForByteSendByteForByte() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | '-- testReceiveDataByteForByteSendWithByteArray() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  +-- SelectorTest [OK]
  | +-- testClosedSelectorSelect() [OK]
  | +-- testClosedSelectorWakeup() [OK]
  | +-- testCancelSelect() [OK]
  | +-- testConnectionCloseImmediateClientDisconnect() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- testConnectionCloseImmediateClientDisconnectKeepLooping() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- testConnectionCloseEventualClientDisconnectKeepLooping() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- testConnectionCloseEventualClientDisconnect() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | '-- testNonBlockingAccept() [A] Kernel may be too old or not configured for full VSOCK support
  +-- ServerSocketCloseTest [OK]
  | +-- testUnblockAcceptsWithSoTimeout() [A] Kernel may be too old or not configured for full VSOCK support
  | '-- testUnblockAcceptsWithoutSoTimeout() [A] Kernel may be too old or not configured for full VSOCK support
  +-- ServerSocketTest [OK]
  | +-- testUnboundServerSocket() [OK]
  | +-- testBindBadArguments() [OK]
  | +-- testCloseable() [OK]
  | '-- testSupported() [OK]
  +-- SocketChannelTest [OK]
  | +-- testDoubleBindAddressReusable() [OK]
  | +-- testDoubleBindAddressNotReusable() [A] Kernel may be too old or not configured for full VSOCK support: First accept call did not terminate
  | '-- testNonBlockingConnect() [OK]
  +-- SocketPairTest [OK]
  | +-- testDatagramPair() [A] Access to VSOCK resources (e.g., /dev/vsock) were denied
  | '-- testSocketPair() [A] Access to VSOCK resources (e.g., /dev/vsock) were denied
  +-- SocketTest [OK]
  | +-- testConnectBadArguments() [OK]
  | +-- testBindBadArguments() [OK]
  | +-- testCloseable() [OK]
  | +-- testUnconnectedSocket() [OK]
  | +-- testMain() [OK]
  | +-- testLoadedLibrary() [OK]
  | +-- testVersion() [OK]
  | '-- testSupported() [OK]
  +-- SoTimeoutTest [OK]
  | +-- issue14Fail() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- issue14Pass() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | +-- testSocketTimeoutExceptionRead() [A] Access to VSOCK resources (e.g., /dev/vsock) were denied
  | '-- testSocketTimeoutExceptionWrite() [A] Access to VSOCK resources (e.g., /dev/vsock) were denied
  +-- StandardSocketOptionsTest [OK]
  | +-- testUnconnectedServerSocketOptions() [S] This test requires Java 9 or later
  | '-- testSocketOptions() [S] This test requires Java 9 or later
  +-- TcpNoDelayTest [OK]
  | +-- testDefaultImpl() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  | '-- testStrictImpl() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
  '-- ThroughputTest [OK]
    +-- testDatagramChannel() [S] Missing capabilities: [CAPABILITY_VSOCK_DGRAM]
    +-- testDatagramChannelDirect() [S] Missing capabilities: [CAPABILITY_VSOCK_DGRAM]
    +-- testDatagramChannelNonBlocking() [S] Missing capabilities: [CAPABILITY_VSOCK_DGRAM]
    +-- testDatagramChannelNonBlockingDirect() [S] Missing capabilities: [CAPABILITY_VSOCK_DGRAM]
    +-- testDatagramPacket() [S] Missing capabilities: [CAPABILITY_VSOCK_DGRAM]
    +-- testSocket() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
    +-- testSocketChannel() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
    '-- testSocketChannelDirectBuffer() [A] Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2

Test run finished after 43122 ms
[        19 containers found      ]
[         1 containers skipped    ]
[        18 containers started    ]
[         0 containers aborted    ]
[        18 containers successful ]
[         0 containers failed     ]
[        67 tests found           ]
[        10 tests skipped         ]
[        57 tests started         ]
[        37 tests aborted         ]
[        20 tests successful      ]
[         0 tests failed          ]

Testing "junixsocket-rmi"... done                                                                                                                                                                                     .                                                                                                                                                                                                                     '-- JUnit Jupiter [OK]
  +-- RegistryTest [OK]
  | +-- testDoubleCreateRegistry() [OK]
  | '-- testExportAndBind() [OK]
  +-- RemoteCloseableTest [OK]
  | +-- testRemoteCloseableWithANotCloseableThing() [OK]
  | '-- testRemoteCloseableWithACloseableThing() [OK]
  +-- RemoteFileDescriptorTest [OK]
  | +-- testReadWrite() [OK]
  | +-- testFindSocketFactory() [OK]
  | +-- testRemoteStdoutNoop() [OK]
  | +-- testRemoteStdout() [OK]
  | +-- testWriteAndReadHello() [OK]
  | '-- testServiceProxy() [OK]
  +-- RMIPeerCredentialsTest [OK]
  | '-- testRemotePeerCredentials() [OK]
  '-- JunixsocketVersionTest [OK]
    '-- testVersion() [OK]

Test run finished after 5385 ms
[         6 containers found      ]
[         0 containers skipped    ]
[         6 containers started    ]
[         0 containers aborted    ]
[         6 containers successful ]
[         0 containers failed     ]
[        12 tests found           ]
[         0 tests skipped         ]
[        12 tests started         ]
[         0 tests aborted         ]
[        12 tests successful      ]
[         0 tests failed          ]

Skipping optional module: junixsocket-common.JavaInet; enable by launching with -Dselftest.enable-module.junixsocket-common.JavaInet=true

Selftest results:
PASS    junixsocket-common  128/131 (3 skipped)
PASS    junixsocket-tipc    0/80 (80 skipped)
DONE    junixsocket-vsock   55/67 (10 skipped)
PASS    junixsocket-rmi 12/12

IMPORTANT: Kernel may be too old or not configured for full VSOCK support
IMPORTANT: Kernel may be too old or not configured for full VSOCK support: Cannot connect to addresses with CID=2
IMPORTANT: Kernel may be too old or not configured for full VSOCK support: First accept call did not terminate; junixsocket-vsock: SocketChannelTest.testDoubleBindAddressNotReusable()
IMPORTANT: Access to VSOCK resources (e.g., /dev/vsock) were denied
IMPORTANT: "With issues": Please carefully check the output above; the software may not be able to do what you want.

Supported capabilities:   [CAPABILITY_PEER_CREDENTIALS, CAPABILITY_ANCILLARY_MESSAGES, CAPABILITY_FILE_DESCRIPTORS, CAPABILITY_ABSTRACT_NAMESPACE, CAPABILITY_UNIX_DATAGRAMS, CAPABILITY_NATIVE_SOCKETPAIR, CAPABILITY_UNIX_DOMAIN, CAPABILITY_VSOCK, CAPABILITY_ZERO_LENGTH_SEND]
Unsupported capabilities: [CAPABILITY_FD_AS_REDIRECT, CAPABILITY_TIPC, CAPABILITY_VSOCK_DGRAM]

Selftest PASSED WITH ISSUES
kohlschuetter commented 1 year ago

Since the selftest passed in your environment, I suspect there really is the native-common dependency missing.

What is the output of

    try {
      System.out.println(System.getProperty("java.class.path"));
      System.out.println(Class.forName("org.newsclub.lib.junixsocket.common.NarMetadata"));
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }

from within your program that triggers the bug?

What happens if you remove all junixsocket dependencies from your code and replace them with the junixsocket selftest jar?

EvenChang commented 1 year ago

Sorry for late reply

  1. Apparently I can't get this class with these exception message.

    java.lang.ClassNotFoundException: org.newsclub.lib.junixsocket.common.NarMetadata not found by org.onosproject.onos-apps-nocsys-ovnvtep-app [286]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)[:1.8.0_352]
    at java.lang.Class.forName0(Native Method)[:1.8.0_352]
    at java.lang.Class.forName(Class.java:264)[:1.8.0_352]
    at com.nocsys.ovnvtep.rest.OvnVtepWebResource.getOvnTraceL3Result(OvnVtepWebResource.java:997)[286:org.onosproject.onos-apps-nocsys-ovnvtep-app:1.13.2.rc3]
    at com.nocsys.ovnvtep.rest.OvnVtepWebResource.getOvnTracePath(OvnVtepWebResource.java:876)[286:org.onosproject.onos-apps-nocsys-ovnvtep-app:1.13.2.rc3]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_352]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_352]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_352]
    at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_352]
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:316)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:298)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:268)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)[191:org.glassfish.jersey.core.jersey-common:2.27.0]
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)[198:org.glassfish.jersey.core.jersey-server:2.27.0]
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)[205:org.glassfish.jersey.containers.jersey-container-servlet-core:2.27.0]
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)[205:org.glassfish.jersey.containers.jersey-container-servlet-core:2.27.0]
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)[205:org.glassfish.jersey.containers.jersey-container-servlet-core:2.27.0]
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)[205:org.glassfish.jersey.containers.jersey-container-servlet-core:2.27.0]
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)[205:org.glassfish.jersey.containers.jersey-container-servlet-core:2.27.0]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[66:org.ops4j.pax.web.pax-web-jetty:3.2.9]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[66:org.ops4j.pax.web.pax-web-jetty:3.2.9]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:427)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)[66:org.ops4j.pax.web.pax-web-jetty:3.2.9]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.Server.handle(Server.java:370)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:973)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1035)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:641)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:231)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[57:org.eclipse.jetty.aggregate.jetty-all-server:8.1.19.v20160209]
    at java.lang.Thread.run(Thread.java:750)[:1.8.0_352]
  2. It's worked fine when I removed all junixsocket dependencies and replace them with the junixsocket selftest jar !!

There must be something wrong with my build code tool "BUCK", it import native-common incorrectly...

kohlschuetter commented 1 year ago

Did you rebuild the junixsocket artifacts from source? Does the junixsocket-native-common jar artifact actually contain the NarMetadata class? (jar tvf junixsocket-native-common-....jar)

EvenChang commented 1 year ago
  1. no, I use it with remote download or download junixsocket jar directly, I didn't rebuild it.
  2. Yeah, junixsocket-native-common jar has contain NarMetadata class. I had check it when exception occurred.
    558 Wed Oct 26 08:00:44 CST 2022 org/newsclub/lib/junixsocket/common/NarMetadata.class
kohlschuetter commented 1 year ago

Assuming this is a bug in your build system setup. Please reopen if you have more details. Thanks again for reporting!

minfrin commented 1 year ago

I suspect that your /tmp directory is mounted as noexec, which prevents the library from being loaded (it needs to be extracted from the jar to be loaded via System.loadLibrary).

If that's the case, you could:

  1. Remount /tmp (or whatever java.io.tmpdir you have) without noexec
  2. Specify a different folder for junixsocket using the org.newsclub.net.unix.library.tmpdir System property.
  3. Extract the library from the jar yourself and specify an absolute path to the library using the org.newsclub.net.unix.library.override System property.

Just stumbled on this problem, and option 2 above fixed things for me. Highlighting it at the bottom for future me to find.