From owner-freebsd-java@freebsd.org Sat Apr 8 07:03:45 2017 Return-Path: Delivered-To: freebsd-java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5916D34345 for ; Sat, 8 Apr 2017 07:03:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 618BB94; Sat, 8 Apr 2017 07:03:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v3873eW0059349 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 8 Apr 2017 10:03:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v3873eW0059349 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v3873el9059348; Sat, 8 Apr 2017 10:03:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 8 Apr 2017 10:03:40 +0300 From: Konstantin Belousov To: ????????? Cc: freebsd-java@freebsd.org, vangyzen@freebsd.org Subject: Re: OpenJDK8 Thread.sleep will deadlock while turn down system date time. Message-ID: <20170408070340.GD1788@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Apr 2017 07:03:46 -0000 On Fri, Apr 07, 2017 at 08:12:42PM -0700, ????????? wrote: > Hi all, > > I found a Java process deadlock issue, and can be reproduced in FreeBSD > 10.3 and 11.0 . > > My environment: > > * VirutalBox 5.1.16 r113841 on Mac OS X 10.12.4 > * FreeBSD-11.0-RELEASE-amd64.vhd.xz > > Reproduction steps: > > 1. install openjdk8 > > ```sh > pkg install openjdk8 > ``` > > 2. Java source code > > ```java > public class Main { > public static void main(String[] args) { > while (true) { > System.out.println("tick"); > Thread.sleep(3000); > } > } > } > ``` > > 3. Run java > > ```sh > $ javac Main.java > $ java Main > tick > tick > ... > ``` > > 4. Turn down system date time. > > ```sh > $ date '+%Y-%m-%d %H:%M:%S' > 20170408 11:09:11 > $ date 201001010000 > Fri Jan 1 00:00:00 CST 2010 > ``` > > Then, the java process will hung. Hang != deadlock, why do you claim that the process deadlocked. > > The issue will reproduce while turn "DOWN" the date time. It's OK while > turn up the date time. If JVM sets timeouts using absolute times than it might be fixed in latest HEAD and stable/11.