From owner-freebsd-java@freebsd.org Wed Mar 20 12:50:04 2019 Return-Path: Delivered-To: freebsd-java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48C461553913 for ; Wed, 20 Mar 2019 12:50:04 +0000 (UTC) (envelope-from 1983-01-06@gmx.net) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A2D89538E for ; Wed, 20 Mar 2019 12:50:02 +0000 (UTC) (envelope-from 1983-01-06@gmx.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1553086192; bh=jKXhElr1DIeMVYTWybouTfMZaDTvtahY/vmQ5aLVRcY=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=S3O+bWvnBpaULz3JyVlFEXXGBNXzq7534nDfGsq2efp54UObuFOho+P4H95rj4i0D bK80LJntia15QRBs1++tJ/7+8UEwlOBUIl8bA4CHBYICQClh/lr+/w/hTIgMU9l34O Yx1OXoq/7pQPzPaOTobwaVbkyu784lfjOgtAg7nI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.13] ([84.143.151.93]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LzblK-1gszpj2Qhm-014ojR for ; Wed, 20 Mar 2019 13:44:41 +0100 Subject: Re: First possible bug in OpenJDK 11 port To: freebsd-java@freebsd.org References: <4706926f-8eb6-c7c6-f982-5ca9c411d5f5@gmx.net> <20190316061434.GB65278@misty.eyesbeyond.com> <5a4b0586-0e60-4c82-bb6f-d33ea39eaf2c@gmx.net> <20190317172446.GA17718@misty.eyesbeyond.com> From: Michael Osipov <1983-01-06@gmx.net> Message-ID: Date: Wed, 20 Mar 2019 13:44:40 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <20190317172446.GA17718@misty.eyesbeyond.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:huKD/Ma7SqmV6JtxSql3KKckXF4Ju0A7fGhP7Tbdi0tCrVyx+fO DKbB+egc/xjPgnHaeD2dZsiZRBZwTv4IKluTSiZi2eRtxNiSNbIlsjvXXHr8Q/xewtY4V2n Fggs+jEYyLrD809peMXTTkUs44PwozgkeT25UljNPWCManeUmJpTuvxUOfoAs5gedefBCm8 6LlKlS8qFMW7oWItbTBMg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:92bjKbkEYlw=:K8FhKease4CapSjT0eCLSV W6KyCdqg0VBoWPvNzWx+EZItMmpsWsp22hQNw0VNFvbMkMzsojq8y4x1KSEyUfbyiQM1URW09 pMxoeNNLoFtIFsliqhoF8nAuZBz7M8Kz/Eiz6CBanODtl/YolA6Nb82XuYWIRue2xXp3cn6z5 2ujGgN2+qmlAQimNZkaDrjLSEacUxM3v/o2a9MhnXFEERnaVcx6Tr6wcEiSCyFiwRUVxgAdNz jCzNrTQDjtKVk/0EM9Aqzbu5zviT+h1TNDfc5GPyIHyI2tCAF1tGo6YRRPl9G+B4gtYspQbYI jfVHXVni8JFx681q+JBQis4+2QHAie70A7KMfeG8fk6s1B3bsXjBWk3AHdGdUMlTQjvEiyslr 8T2rvNy4Y2TLDpY9u98DWAuioqmkS5qnPq8UdNHlFSmPSAPiU/LMqe5u2uEE7uSD6I+3WL6IK t5iqx0Ru57vRItmS9KFpAvAbSjO8PK3oCm/PI07xbXbrIuYzc/IoVCxrOsEqeFPJbki60z97U 3hC+oatdUoMDOFQWykKtyrOtNS1CKLTiYdan0PDQ/vctjfqwCT/LSCujbpMPinkneFjjSR9u2 P5JYPEiRWfmSnjbOnsT4fcvNn1PC69o5jCrIT9FITpMvAmVkpgL3LKye3HTwIqDWfUmwpfoQ9 zYFLufeJppJ/jnADDEYUP1ShmPs1Lxm/0Nr4NqEpGvjDMNjx6rvqba+SAGrqIgUw52Tb4zOF9 iUpbUwIGIBIdld8MNQ+2YPEykb2iV71RzKjSYTWXEjegYFsY6zTrqxjVvwGyq065nn4u13niA bdQTNy2+RzZ1+P18gNrL+VEs0ReBLX+ypUImFely0wkTYEm9dDFlExK97ZEYUJdkQuAZE7Fyd tV81kkH4gzvJWuwJCAbcthOuk/j2k5vautqGNlAoqW2JyB6hDrcdOFsS64TRutW+eupgHc2zm bGDaMouNIhA== X-Rspamd-Queue-Id: 5A2D89538E X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=S3O+bWvn; spf=pass (mx1.freebsd.org: domain of 1983-01-06@gmx.net designates 212.227.15.15 as permitted sender) smtp.mailfrom=1983-01-06@gmx.net X-Spamd-Result: default: False [-5.23 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.227.15.0/25]; FREEMAIL_FROM(0.00)[gmx.net]; TO_DN_NONE(0.00)[]; MX_GOOD(-0.01)[cached: mx00.emig.gmx.net]; DKIM_TRACE(0.00)[gmx.net:+]; NEURAL_HAM_SHORT(-0.48)[-0.479,0]; RCVD_IN_DNSWL_LOW(-0.10)[15.15.227.212.list.dnswl.org : 127.0.3.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmx.net]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-java@freebsd.org]; DMARC_NA(0.00)[gmx.net]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[gmx.net.dwl.dnswl.org : 127.0.3.1]; IP_SCORE(-1.15)[ip: (-6.23), ipnet: 212.227.0.0/16(-1.18), asn: 8560(1.69), country: DE(-0.01)]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2019 12:50:04 -0000 Am 2019-03-17 um 18:24 schrieb Greg Lewis:> On Sat, Mar 16, 2019 at 07:29:20PM +0100, Michael Osipov wrote: >> Am 2019-03-16 um 07:14 schrieb Greg Lewis: >>> On Sat, Mar 16, 2019 at 12:20:27AM +0100, Michael Osipov wrote: >>>> Folks, >>>> >>>> here is a stripped down example from an issue with the new port: >>>> >>>>> $ cat ../src/exec/Test.java >>>>> package exec; >>>>> >>>>> import java.io.IOException; >>>>> >>>>> public class Test { >>>>> >>>>> public static void main(String[] args) throws IOException, InterruptedException { >>>>> ProcessBuilder builder =3D new ProcessBuilder("/bin/sh", "-c", "cd && env"); >>>>> builder.inheritIO(); >>>>> Process p =3D builder.start(); >>>>> System.out.println("exit code: " + p.waitFor()); >>>>> } >>>>> >>>>> } >>>> >>>> Fails: >>>>> osipovmi@deblndw011x:~/exec/bin >>>>> $ /usr/local/openjdk11/bin/java exec.Test >>>>> Exception in thread "main" java.io.IOException: Cannot run program "/bin/sh": error=3D13, Permission denied >>>>> at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) >>>>> at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) >>>>> at exec.Test.main(Test.java:12) >>>>> Caused by: java.io.IOException: error=3D13, Permission denied >>>>> at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) >>>>> at java.base/java.lang.ProcessImpl.(ProcessImpl.java:34= 1) >>>>> at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:272= ) >>>>> at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107) >>>>> ... 2 more >>>> >>>> >>>> as well as >>>>> osipovmi@deblndw011x:~/exec/bin >>>>> $ /usr/local/bootstrap-openjdk11/bin/java exec.Test >>>>> Exception in thread "main" java.io.IOException: Cannot run program "/bin/sh": error=3D13, Permission denied >>>>> at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) >>>>> at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) >>>>> at exec.Test.main(Test.java:12) >>>>> Caused by: java.io.IOException: error=3D13, Permission denied >>>>> at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) >>>>> at java.base/java.lang.ProcessImpl.(ProcessImpl.java:34= 1) >>>>> at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:272= ) >>>>> at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107) >>>>> ... 2 more >>>> >>>> and >>>> >>>>> osipovmi@deblndw011x:~/exec/bin >>>>> $ /usr/local/bootstrap-openjdk8/bin/java exec.Test >>>>> Exception in thread "main" java.io.IOException: Cannot run program "/bin/sh": error=3D13, Permission denied >>>>> at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) >>>>> at exec.Test.main(Test.java:12) >>>>> Caused by: java.io.IOException: error=3D13, Permission denied >>>>> at java.lang.UNIXProcess.forkAndExec(Native Method) >>>>> at java.lang.UNIXProcess.(UNIXProcess.java:251) >>>>> at java.lang.ProcessImpl.start(ProcessImpl.java:134) >>>>> at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) >>>>> ... 1 more >>>> >>>> but successfully runs with: >>>> >>>>> osipovmi@deblndw011x:~/exec/bin >>>>> $ /usr/local/openjdk8/bin/java exec.Test >>>>> SSH_CLIENT=3D147.54.65.49 55876 22 >>>>> LOGNAME=3Dosipovmi >>>>> LSCOLORS=3DExGxFxdxCxDxDxhbadExEx >>>>> HTTP_PROXY=3Dhttp://194.145.60.1:9400 >>>>> LANG=3Dde_DE.UTF-8 >>>>> JAVA_HOME=3D/usr/local/openjdk11 >>>>> NO_PROXY=3Dlocalhost .siemens.net .siemens.com .siemens.de >>>>> CLICOLOR=3DYES >>>>> MAIL=3D/var/mail/osipovmi >>>>> NCURSES_NO_UTF8_ACS=3D1 >>>>> PATH=3D/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin >>>>> EDITOR=3Dvim >>>>> OLDPWD=3D/net/home/osipovmi/exec/bin >>>>> DISPLAY=3Dlocalhost:10.0 >>>>> PWD=3D/net/home/osipovmi >>>>> _=3D/usr/local/openjdk8/bin/java >>>>> TERM=3Dxterm >>>>> SSH_TTY=3D/dev/pts/0 >>>>> USER=3Dosipovmi >>>>> HOME=3D/net/home/osipovmi >>>>> SSH_CONNECTION=3D147.54.65.49 55876 147.54.64.17 22 >>>>> PS1=3D\[\033[1;32m\]\u@\h\[\033[0m\]:\[\033[1;34m\]\w\[\033[0m\]\n$ >>>>> SHELL=3D/bin/sh >>>>> MM_CHARSET=3DUTF-8 >>>>> HTTPS_PROXY=3Dhttp://194.145.60.1:9400 >>>>> BLOCKSIZE=3DK >>>>> FTP_PROXY=3Dhttp://194.145.60.1:9400 >>>>> SHLVL=3D1 >>>>> exit code: 0 >>>> >>>> What is causing this issue? >>>> >>>> For those who'd like to reproduce the bug: Clone Maven GitHub, try to to >>>> build from master and see the Maven Surefire Plugin failing when it >>>> tried to launch the Surefire Booter. >>>> >>>> Java 8 Update 202, Java 11 newest from ports. OS is >>>>> FreeBSD deblndw011x.ad001.siemens.net 12.0-STABLE FreeBSD 12.0-STABLE r344655 DEBLNDW011X amd64 >>> >>> I can reproduce this with the current port in the FreeBSD ports tree. >>> >>> It is better behaved with the current code in Github since there has been >>> some work done on process handling. With that code the command executes, >>> but afterwards it throws an exception: >>> >>> Exception in thread "main" java.lang.RuntimeException: No such proces= s >>> at java.base/java.lang.ProcessHandleImpl.isAlive0(Native Method) >>> at java.base/java.lang.ProcessHandleImpl.getInternal(ProcessHandleImpl.java:2= 50) >>> at java.base/java.lang.ProcessImpl.(ProcessImpl.java:349) >>> at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:272) >>> at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107= ) >>> at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071= ) >>> at TestExec.main(TestExec.java:9) >>> >>> So there is still some work to do there. The relevant commit to the github >>> repo is likely this one: >>> >>> https://github.com/battleblow/openjdk-jdk11u/commit/4cfeb8650f3f90119aa1e5= 2020ac6ad6620a34ff >>> >>> This probably means there are still some problems with the >>> os_getParentPidAndTimings code given that is what isAlive0 is calling >>> (look at ProcessHandleImpl_unix.c). >> >> Hi Greg, >> >> that for the confirmation. Looks like a showstopper for a developer li= ke >> me. Even my webapps won't run because they rely on ProcessBuilder. >> >> Is there anything I can help to get this fixed? That type of C code is= , >> unfortunately, out of my knowledge. >> >> I want to verify your (and others) great work against all Maven >> subprojects as well as CodeHaus to find subtile bugsin the port. > > The github repo now has a fix. The good way to help verify would be to > run the inbuilt tests. I haven't got set up to do that yet, but the > openjdk8 port has a test target that could be ported over. Hi Greg, I cloned the repo and have built it. The tests (make test) fail to compile/run, but the code works flawlessly. I tried maven.git, maven-intergration-testing.git, maven-scm.git, maven-wagon.git and other crucial components (from Codehaus Plexus). They all compile and pass flawlessly. I will additionally try several native ones like Hawt JNI, Commons Daemon and Tomcat Native. Thank you very much for the fix! Michael