From owner-svn-ports-all@FreeBSD.ORG Thu Jul 25 15:32:44 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0DD15A0A; Thu, 25 Jul 2013 15:32:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E04C12F60; Thu, 25 Jul 2013 15:32:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6PFWhhS077812; Thu, 25 Jul 2013 15:32:43 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6PFWhFL077809; Thu, 25 Jul 2013 15:32:43 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201307251532.r6PFWhFL077809@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 25 Jul 2013 15:32:43 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r323651 - in head/java/openjdk6: . files/icedtea/openjdk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 15:32:44 -0000 Author: bapt Date: Thu Jul 25 15:32:43 2013 New Revision: 323651 URL: http://svnweb.freebsd.org/changeset/ports/323651 Log: Fix excessive memory consumption on head amd64, this prevent the package building cluster from dying when building java ports. This bug is referenced upstream here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6636110 Submitted by: dim With hat: portmgr Added: head/java/openjdk6/files/icedtea/openjdk/6636110-deoptimization_unaligned_stackpointer.patch (contents, props changed) Modified: head/java/openjdk6/Makefile head/java/openjdk6/Makefile.icedtea Modified: head/java/openjdk6/Makefile ============================================================================== --- head/java/openjdk6/Makefile Thu Jul 25 15:31:03 2013 (r323650) +++ head/java/openjdk6/Makefile Thu Jul 25 15:32:43 2013 (r323651) @@ -3,7 +3,7 @@ PORTNAME= openjdk6 PORTVERSION= b27 -PORTREVISION?= 5 +PORTREVISION?= 6 CATEGORIES= java devel MASTER_SITES= http://download.java.net/openjdk/jdk6/promoted/${PORTVERSION}/ \ http://download.java.net/jaxp/openjdk/jdk6/:jaxp \ Modified: head/java/openjdk6/Makefile.icedtea ============================================================================== --- head/java/openjdk6/Makefile.icedtea Thu Jul 25 15:31:03 2013 (r323650) +++ head/java/openjdk6/Makefile.icedtea Thu Jul 25 15:32:43 2013 (r323651) @@ -53,6 +53,7 @@ _PATCHES= \ security/20130416/8000724.patch \ security/20130416/8004986.patch \ openjdk/6501644-icu_sync.patch \ + openjdk/6636110-deoptimization_unaligned_stackpointer.patch \ openjdk/6886358-layout_update.patch \ security/20130416/8001031.patch \ openjdk/7017324-kerning_crash.patch \ Added: head/java/openjdk6/files/icedtea/openjdk/6636110-deoptimization_unaligned_stackpointer.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk6/files/icedtea/openjdk/6636110-deoptimization_unaligned_stackpointer.patch Thu Jul 25 15:32:43 2013 (r323651) @@ -0,0 +1,76 @@ + +# HG changeset patch +# User never +# Date 1320440131 25200 +# Node ID 1feb272af3a704c03d544ef6c606db32049e492c +# Parent 448691f285a54cd944c45c79ff0ba13ec8e3e205 +6636110: unaligned stackpointer leads to crash during deoptimization +Reviewed-by: never, kvn +Contributed-by: Andreas Schoesser + +--- hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp.orig Thu Nov 03 04:12:49 2011 -0700 ++++ hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Fri Nov 04 13:55:31 2011 -0700 +@@ -2797,17 +2797,25 @@ void SharedRuntime::generate_deopt_blob( + // void Deoptimization::unpack_frames(JavaThread* thread, int exec_mode) + + // Use rbp because the frames look interpreted now +- __ set_last_Java_frame(noreg, rbp, NULL); +- ++ // Save "the_pc" since it cannot easily be retrieved using the last_java_SP after we aligned SP. ++ // Don't need the precise return PC here, just precise enough to point into this code blob. ++ address the_pc = __ pc(); ++ __ set_last_Java_frame(noreg, rbp, the_pc); ++ ++ __ andptr(rsp, -(StackAlignmentInBytes)); // Fix stack alignment as required by ABI + __ mov(c_rarg0, r15_thread); + __ movl(c_rarg1, r14); // second arg: exec_mode + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames))); ++ // Revert SP alignment after call since we're going to do some SP relative addressing below ++ __ movptr(rsp, Address(r15_thread, JavaThread::last_Java_sp_offset())); + + // Set an oopmap for the call site +- oop_maps->add_gc_map(__ pc() - start, ++ // Use the same PC we used for the last java frame ++ oop_maps->add_gc_map(the_pc - start, + new OopMap( frame_size_in_words, 0 )); + +- __ reset_last_Java_frame(true, false); ++ // Clear fp AND pc ++ __ reset_last_Java_frame(true, true); + + // Collect return values + __ movdbl(xmm0, Address(rsp, RegisterSaver::xmm0_offset_in_bytes())); +@@ -2968,7 +2976,10 @@ void SharedRuntime::generate_uncommon_tr + // Prolog + + // Use rbp because the frames look interpreted now +- __ set_last_Java_frame(noreg, rbp, NULL); ++ // Save "the_pc" since it cannot easily be retrieved using the last_java_SP after we aligned SP. ++ // Don't need the precise return PC here, just precise enough to point into this code blob. ++ address the_pc = __ pc(); ++ __ set_last_Java_frame(noreg, rbp, the_pc); + + // Call C code. Need thread but NOT official VM entry + // crud. We cannot block on this call, no GC can happen. Call should +@@ -2977,14 +2988,17 @@ void SharedRuntime::generate_uncommon_tr + // + // BasicType unpack_frames(JavaThread* thread, int exec_mode); + ++ __ andptr(rsp, -(StackAlignmentInBytes)); // Align SP as required by ABI + __ mov(c_rarg0, r15_thread); + __ movl(c_rarg1, Deoptimization::Unpack_uncommon_trap); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames))); + + // Set an oopmap for the call site +- oop_maps->add_gc_map(__ pc() - start, new OopMap(SimpleRuntimeFrame::framesize, 0)); +- +- __ reset_last_Java_frame(true, false); ++ // Use the same PC we used for the last java frame ++ oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0)); ++ ++ // Clear fp AND pc ++ __ reset_last_Java_frame(true, true); + + // Pop self-frame. + __ leave(); // Epilog +