[java-1.7.0-openjdk/f19] Fixed icons, openoffice, pstack and fonts bounds - added patch 401 657854-openjdk7.patch (see 947731)

jiri vanek jvanek at fedoraproject.org
Tue May 7 15:43:14 UTC 2013


commit abf98ebd85f0a5bdf945ddf6e087dc8f364d5879
Author: Jiri Vanek <jvanek at jvanek.redhat>
Date:   Tue May 7 17:42:21 2013 +0200

    Fixed icons, openoffice,pstack and fonts bounds
    - added patch 401 657854-openjdk7.patch (see 947731)
    - fixed icons (see https://bugzilla.redhat.com/show_bug.cgi?id=820619)
    - added patch 402 gstackbounds.patch - see (RH902004)
    - added patch 403 PStack-808293.patch - to work more about jstack

 657854-openjdk7.patch   |   29 ++++++++++
 PStack-808293.patch     |   40 ++++++++++++++
 README.src              |    4 +-
 gstackbounds.patch      |  139 +++++++++++++++++++++++++++++++++++++++++++++++
 java-1.7.0-openjdk.spec |   20 +++++++-
 sources                 |    2 +-
 6 files changed, 230 insertions(+), 4 deletions(-)
---
diff --git a/657854-openjdk7.patch b/657854-openjdk7.patch
new file mode 100644
index 0000000..2f6b2f8
--- /dev/null
+++ b/657854-openjdk7.patch
@@ -0,0 +1,29 @@
+--- openjdk/jdk/src/share/native/sun/font/freetypeScaler.c
++++ openjdk/jdk/src/share/native/sun/font/freetypeScaler.c
+@@ -488,14 +488,15 @@
+ 
+     /**** Note: only some metrics are affected by styling ***/
+ 
++#define FT_MulFixFloatShift6(a, b) (((float) (a)) * ((float) (b)) / 65536.0 / 64.0)
+     /* ascent */
+     ax = 0;
+-    ay = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
++    ay = -(jfloat) (FT_MulFixFloatShift6(
+                        ((jlong) scalerInfo->face->ascender + bmodifier/2),
+                        (jlong) scalerInfo->face->size->metrics.y_scale));
+     /* descent */
+     dx = 0;
+-    dy = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
++    dy = -(jfloat) (FT_MulFixFloatShift6(
+                        ((jlong) scalerInfo->face->descender + bmodifier/2),
+                        (jlong) scalerInfo->face->size->metrics.y_scale));
+     /* baseline */
+@@ -503,7 +504,7 @@
+ 
+     /* leading */
+     lx = 0;
+-    ly = (jfloat) FT26Dot6ToFloat(FT_MulFix(
++    ly = (jfloat) (FT_MulFixFloatShift6(
+                       (jlong) scalerInfo->face->height + bmodifier,
+                       (jlong) scalerInfo->face->size->metrics.y_scale))
+                   + ay - dy;
diff --git a/PStack-808293.patch b/PStack-808293.patch
new file mode 100644
index 0000000..4637403
--- /dev/null
+++ b/PStack-808293.patch
@@ -0,0 +1,40 @@
+--- openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java	2012-04-06 02:26:33.322164601 +0200
++++ openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java	2012-04-06 02:26:57.958514071 +0200
+@@ -1,5 +1,6 @@
+ /*
+  * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2012, Red Hat Inc.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -84,7 +85,8 @@
+                out.print("----------------- ");
+                out.print(th);
+                out.println(" -----------------");
+-               while (f != null) {
++               int maxStack = 256;
++               while (f != null && maxStack-- > 0) {
+                   ClosestSymbol sym = f.closestSymbolToPC();
+                   Address pc = f.pc();
+                   out.print(pc + "\t");
+@@ -158,10 +160,19 @@
+                         printUnknown(out);
+                      }
+                   }
++                  Address oldPC = f.pc();
++                  Address oldFP = f.localVariableBase();
+                   f = f.sender(th);
++                  if (f != null
++                      && oldPC.equals(f.pc())
++                      && oldFP.equals(f.localVariableBase())) {
++                      // We didn't make any progress
++                      f = null;
++                  }
+                }
+             } catch (Exception exp) {
+-               exp.printStackTrace();
++               // exp.printStackTrace();
++               out.println("bad stack: " + exp);
+                // continue, may be we can do a better job for other threads
+             }
+             if (isJava && concurrentLocks) {
diff --git a/README.src b/README.src
index eef0423..7a54b1b 100644
--- a/README.src
+++ b/README.src
@@ -1,2 +1,2 @@
-The java-1.6.0-openjdk-src subpackage contains the complete IcedTea
-class library source code for use by IDE indexers and debuggers.
+The java-1.7.0-openjdk-src subpackage contains the complete class library
+source code for use by IDE indexers and debuggers.
diff --git a/gstackbounds.patch b/gstackbounds.patch
new file mode 100644
index 0000000..a579dcd
--- /dev/null
+++ b/gstackbounds.patch
@@ -0,0 +1,139 @@
+diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+@@ -2763,39 +2763,47 @@
+ // writing thread stacks don't use growable mappings (i.e. those
+ // creeated with MAP_GROWSDOWN), and aren't marked "[stack]", so this
+ // only applies to the main thread.
+-
+-static
+-bool get_stack_bounds(uintptr_t *bottom, uintptr_t *top) {
+-
+-  char buf[128];
+-  int fd, sz;
+-
+-  if ((fd = ::open("/proc/self/maps", O_RDONLY)) < 0) {
++static bool
++get_stack_bounds(uintptr_t *bottom, uintptr_t *top)
++{
++  FILE *f = fopen("/proc/self/maps", "r");
++  if (f == NULL)
+     return false;
+-  }
+-
+-  const char kw[] = "[stack]";
+-  const int kwlen = sizeof(kw)-1;
+-
+-  // Address part of /proc/self/maps couldn't be more than 128 bytes
+-  while ((sz = os::get_line_chars(fd, buf, sizeof(buf))) > 0) {
+-     if (sz > kwlen && ::memcmp(buf+sz-kwlen, kw, kwlen) == 0) {
+-        // Extract addresses
+-        if (sscanf(buf, "%" SCNxPTR "-%" SCNxPTR, bottom, top) == 2) {
+-           uintptr_t sp = (uintptr_t) __builtin_frame_address(0);
+-           if (sp >= *bottom && sp <= *top) {
+-              ::close(fd);
+-              return true;
+-           }
++
++  while (!feof(f)) {
++    size_t dummy;
++    char *str = NULL;
++    ssize_t len = getline(&str, &dummy, f);
++    if (len == -1) {
++      fclose(f);
++      if (str != NULL)
++	free(str);
++      return false;
++    }
++
++    if (len > 0 && str[len-1] == '\n') {
++      str[len-1] = 0;
++      len--;
++    }
++
++    static const char *stack_str = "[stack]";
++    if (len > (ssize_t)strlen(stack_str)
++       && (strcmp(str + len - strlen(stack_str), stack_str) == 0)) {
++      if (sscanf(str, "%" SCNxPTR "-%" SCNxPTR, bottom, top) == 2) {
++        uintptr_t sp = (uintptr_t)__builtin_frame_address(0);
++        if (sp >= *bottom && sp <= *top) {
++          free(str);
++          fclose(f);
++          return true;
+         }
+-     }
+-  }
+-
+- ::close(fd);
++      }
++    }
++    free(str);
++  }
++  fclose(f);
+   return false;
+ }
+ 
+-
+ // If the (growable) stack mapping already extends beyond the point
+ // where we're going to put our guard pages, truncate the mapping at
+ // that point by munmap()ping it.  This ensures that when we later
+diff --git a/src/share/vm/runtime/os.cpp b/src/share/vm/runtime/os.cpp
+--- openjdk/hotspot/src/share/vm/runtime/os.cpp
++++ openjdk/hotspot/src/share/vm/runtime/os.cpp
+@@ -1331,41 +1331,3 @@
+   }
+   return result;
+ }
+-
+-// Read file line by line, if line is longer than bsize,
+-// skip rest of line.
+-int os::get_line_chars(int fd, char* buf, const size_t bsize){
+-  size_t sz, i = 0;
+-
+-  // read until EOF, EOL or buf is full
+-  while ((sz = (int) read(fd, &buf[i], 1)) == 1 && i < (bsize-2) && buf[i] != '\n') {
+-     ++i;
+-  }
+-
+-  if (buf[i] == '\n') {
+-    // EOL reached so ignore EOL character and return
+-
+-    buf[i] = 0;
+-    return (int) i;
+-  }
+-
+-  buf[i+1] = 0;
+-
+-  if (sz != 1) {
+-    // EOF reached. if we read chars before EOF return them and
+-    // return EOF on next call otherwise return EOF
+-
+-    return (i == 0) ? -1 : (int) i;
+-  }
+-
+-  // line is longer than size of buf, skip to EOL
+-  char ch;
+-  while (read(fd, &ch, 1) == 1 && ch != '\n') {
+-    // Do nothing
+-  }
+-
+-  // return initial part of line that fits in buf.
+-  // If we reached EOF, it will be returned on next call.
+-
+-  return (int) i;
+-}
+diff --git a/src/share/vm/runtime/os.hpp b/src/share/vm/runtime/os.hpp
+--- openjdk/hotspot/src/share/vm/runtime/os.hpp
++++ openjdk/hotspot/src/share/vm/runtime/os.hpp
+@@ -672,10 +672,6 @@
+   // Hook for os specific jvm options that we don't want to abort on seeing
+   static bool obsolete_option(const JavaVMOption *option);
+ 
+-  // Read file line by line. If line is longer than bsize,
+-  // rest of line is skipped. Returns number of bytes read or -1 on EOF
+-  static int get_line_chars(int fd, char *buf, const size_t bsize);
+-
+   // Extensions
+ #include "runtime/os_ext.hpp"
+ 
+
diff --git a/java-1.7.0-openjdk.spec b/java-1.7.0-openjdk.spec
index 2c7be21..a91e1e6 100644
--- a/java-1.7.0-openjdk.spec
+++ b/java-1.7.0-openjdk.spec
@@ -138,7 +138,7 @@
 
 Name:    java-%{javaver}-%{origin}
 Version: %{javaver}.%{buildver}
-Release: %{icedtea_version}.6%{?dist}
+Release: %{icedtea_version}.8%{?dist}
 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons,
 # and this change was brought into RHEL-4.  java-1.5.0-ibm packages
 # also included the epoch in their virtual provides.  This created a
@@ -262,6 +262,13 @@ Patch302: systemtap.patch
 # Rhino support
 Patch400: rhino-icedtea-2.1.1.patch
 
+#Workaround RH947731
+Patch401: 657854-openjdk7.patch
+#Workaround RH902004
+Patch402: gstackbounds.patch
+Patch403: PStack-808293.patch
+# End of tmp patches
+
 BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: gcc-c++
@@ -541,6 +548,10 @@ patch -l -p0 < %{PATCH104}
 patch -l -p0 < %{PATCH105}
 %endif
 
+patch -l -p0 < %{PATCH401}
+patch -l -p0 < %{PATCH402}
+patch -l -p0 < %{PATCH403}
+
 # Build the re-written rhino jar
 mkdir -p rhino/{old,new}
 
@@ -767,6 +778,7 @@ done
 # Install desktop files.
 install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/{applications,pixmaps}
 for e in jconsole policytool ; do
+    sed -i "s/#ARCH#/%{_arch}/g" $e.desktop
     desktop-file-install --vendor=%{name} --mode=644 \
         --dir=$RPM_BUILD_ROOT%{_datadir}/applications $e.desktop
 done
@@ -1143,6 +1155,12 @@ exit 0
 %{_jvmdir}/%{jredir}/lib/accessibility.properties
 
 %changelog
+* Tue May 07 2013 Jiri Vanek <jvanek at redhat.com> - 1.7.0.19-2.3.9.7.fc19
+- added patch 401 657854-openjdk7.patch (see 947731)
+- fixed icons (see https://bugzilla.redhat.com/show_bug.cgi?id=820619)
+- added patch 402 gstackbounds.patch - see (RH902004)
+- added patch 403 PStack-808293.patch - to work more about jstack
+
 * Mon Apr 22 2013 Jiri Vanek <jvanek at redhat.com> - 1.7.0.19-2.3.9.6.fc19
 - cosmetic changes to  accessibility subpackage
  - removed all provides
diff --git a/sources b/sources
index 501b0cc..1faa231 100644
--- a/sources
+++ b/sources
@@ -1,5 +1,5 @@
 ea344cc5b53b73f375558ba41760ff64  class-rewriter.tar.gz
-7df0a19525f26643d4cea3228fbbc6cc  desktop-files.tar.gz
+200676ae97998b6f5bc18ff77e35d222  desktop-files.tar.gz
 1cb61996cf5dbe80827abbe7d009bf28  pulseaudio.tar.gz
 8eb5ad93dbf2f4fe86e52631969cfb09  systemtap-tapset.tar.gz
 a6099b53d46caac65faa14342d1c0772  openjdk-icedtea-2.1.8.tar.gz


More information about the scm-commits mailing list