Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/zcs 6172 #90

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion thirdparty/aspell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pvers := $(ASPELL_VERSION)
pname := aspell
pfile := $(pname)-$(pvers).tar.gz
psrc_file := $(SRC_DIR)/$(pfile)
purl := ftp://ftp.gnu.org/gnu/aspell/$(pfile)
purl := ftp://alpha.gnu.org/gnu/aspell/$(pfile)
zname := zimbra-$(pname)
zspec := $(pname).spec

Expand Down
1 change: 1 addition & 0 deletions thirdparty/openjdk/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
openjdk-11.28.tgz filter=lfs diff=lfs merge=lfs -text
19 changes: 3 additions & 16 deletions thirdparty/openjdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,9 @@ all: clean getsrc build pkgrm1
getsrc: export HGFOREST_REDIRECT=getsource.out
getsrc:
mkdir -p $(SRC_DIR)
(echo "Obtaining source for openjdk. This may take some time." && \
(echo "Copying the already created tar to src dir." && \
cd $(SRC_DIR) && \
mkdir tmp && \
cd tmp && \
hg clone -r $(JDK_TAG) http://hg.openjdk.java.net/jdk8u/jdk$(JDK_SUB_TREE) && \
cd jdk$(JDK_SUB_TREE) && chmod a+rx get_source.sh && \
chmod a+rx configure && \
patch -p1 < $(PKG_ROOT)/patches/fix-source.patch && \
echo "Obtaining source for sub modules. This make take a very long time." && \
./get_source.sh -r $(JDK_TAG) || true && \
cd .. && \
mv jdk$(JDK_SUB_TREE) $(pname)-$(pvers) && \
( cd $(pname)-$(pvers) && find . -name ".hg*" | xargs rm -rf ) && \
tar cfz $(pfile) $(pname)-$(pvers) && \
mv $(pfile) .. && \
cd .. && \
rm -rf tmp \
cp -vf $(PKG_ROOT)/$(pfile) . \
)

pkgadd:
Expand Down Expand Up @@ -75,6 +61,7 @@ build_deb:
perl -pi -e 's/DEB_BUILD_OPTIONS=nocheck/DEB_BUILD_OPTIONS=nocheck $(UB_REPLACE)/' debian/rules && \
$(replace-pathinfo) debian/rules && \
$(CP) $(psrc_file) ../$(z_tgz) && \
$(CP) $(PKG_ROOT)/patches/*.patch debian/patches/ && \
$(TAR) xfz ../$(z_tgz) --strip-components=1 && \
$(PKG_BUILD)

Expand Down
24 changes: 24 additions & 0 deletions thirdparty/openjdk/UBUNTU.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,35 @@ openjdk.UBUNTU := libx11-dev x11proto-xext-dev libxext-dev \
x11proto-fixes-dev x11proto-record-dev libxtst-dev libxt-dev \
openjdk-7-jdk libcups2-dev libfreetype6-dev libasound2-dev \
ccache
openjdk.UBUNTU18_64 := openjdk-11-jdk at-spi2-core ca-certificates-java \
libatk-bridge2.0-0 libatk-wrapper-java libatk-wrapper-java-jni \
libatspi2.0-0 libfontenc1 libgtk-3-0 libgtk-3-bin libice-dev \
libice6 libpthread-stubs0-dev libsm-dev libsm6 libx11-dev \
libx11-doc libxau-dev libxaw7 libxcb1-dev libxdmcp-dev libxmu6 \
libxmuu1 libxpm4 libxt-dev libxt6 libxv1 libxxf86dga1 \
openjdk-11-jdk-headless openjdk-11-jre openjdk-11-jre-headless \
x11-utils x11proto-core-dev x11proto-dev xorg-sgml-doctools \
xtrans-dev libxext-dev libxrender-dev libxtst-dev libxaw7-dev \
libxinerama-dev libgtk-3-dev libfontconfig1-dev xvfb xauth \
xfonts-base twm x11-xkb-utils graphviz libcups2-dev \
libfreetype6-dev libasound2-dev ccache jtreg ant ant-optional
openjdk.UBUNTU16_64 := $(openjdk.UBUNTU)
openjdk.UBUNTU14_64 := $(openjdk.UBUNTU)
openjdk.UBUNTU12_64 := $(openjdk.UBUNTU)
openjdk-purge.UBUNTU := libxt-dev libxtst-dev libxrender-dev libxext-dev libx11-dev \
libcups2-dev libfreetype6-dev libasound2-dev openjdk-7-jdk ccache
openjdk-purge.UBUNTU18_64 := openjdk-11-jdk at-spi2-core ca-certificates-java \
libatk-bridge2.0-0 libatk-wrapper-java libatk-wrapper-java-jni \
libatspi2.0-0 libfontenc1 libgtk-3-0 libgtk-3-bin libice-dev \
libice6 libpthread-stubs0-dev libsm-dev libsm6 libx11-dev \
libx11-doc libxau-dev libxaw7 libxcb1-dev libxdmcp-dev libxmu6 \
libxmuu1 libxpm4 libxt-dev libxt6 libxv1 libxxf86dga1 \
openjdk-11-jdk-headless openjdk-11-jre openjdk-11-jre-headless \
x11-utils x11proto-core-dev x11proto-dev xorg-sgml-doctools \
xtrans-dev libxext-dev libxrender-dev libxtst-dev libxaw7-dev \
libxinerama-dev libgtk-3-dev libfontconfig1-dev xvfb xauth \
xfonts-base twm x11-xkb-utils graphviz libcups2-dev \
libfreetype6-dev libasound2-dev ccache jtreg ant ant-optional
openjdk-purge.UBUNTU16_64 := $(openjdk-purge.UBUNTU) libsctp1 openjdk-7-jre-headless \
x11proto-fixes-dev x11proto-record-dev x11proto-render-dev x11proto-xext-dev \
x11proto-core-dev x11proto-input-dev xorg-sgml-doctools at-spi2-core \
Expand Down
11 changes: 11 additions & 0 deletions thirdparty/openjdk/patches/fix-JDK-8144695.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/hotspot/make/linux/makefiles/gcc.make
+++ b/src/hotspot/make/linux/makefiles/gcc.make
@@ -203,7 +203,7 @@ else
endif

# Compiler warnings are treated as errors
-WARNINGS_ARE_ERRORS ?= -Werror -Wno-error=format
+WARNINGS_ARE_ERRORS ?=

ifeq ($(USE_CLANG), true)
# However we need to clean the code up before we can unrestrictedly enable this option with Clang
228 changes: 228 additions & 0 deletions thirdparty/openjdk/patches/fix-JDK-8212041.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
--- a/src/hotspot/os/linux/os_linux.cpp Tue Jul 17 12:03:10 2018 -0700
+++ b/src/hotspot/os/linux/os_linux.cpp Tue Jul 17 15:59:47 2018 -0400
@@ -5375,8 +5375,7 @@

// Scan the directory
bool result = true;
- char buf[sizeof(struct dirent) + MAX_PATH];
- while (result && (ptr = ::readdir(dir)) != NULL) {
+ while (result && (ptr = readdir(dir)) != NULL) {
if (strcmp(ptr->d_name, ".") != 0 && strcmp(ptr->d_name, "..") != 0) {
result = false;
}
--- a/src/hotspot/os/linux/os_linux.inline.hpp Tue Jul 17 12:03:10 2018 -0700
+++ b/src/hotspot/os/linux/os_linux.inline.hpp Tue Jul 17 15:59:47 2018 -0400
@@ -69,17 +69,6 @@

inline const int os::default_file_open_flags() { return 0;}

-inline DIR* os::opendir(const char* dirname)
-{
- assert(dirname != NULL, "just checking");
- return ::opendir(dirname);
-}
-
-inline int os::readdir_buf_size(const char *path)
-{
- return NAME_MAX + sizeof(dirent) + 1;
-}
-
inline jlong os::lseek(int fd, jlong offset, int whence) {
return (jlong) ::lseek64(fd, offset, whence);
}
@@ -92,17 +81,6 @@
return ::ftruncate64(fd, length);
}

-inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
-{
- assert(dirp != NULL, "just checking");
- return ::readdir(dirp);
-}
-
-inline int os::closedir(DIR *dirp) {
- assert(dirp != NULL, "argument is NULL");
- return ::closedir(dirp);
-}
-
// macros for restartable system calls

#define RESTARTABLE(_cmd, _result) do { \
--- a/src/hotspot/os/linux/os_perf_linux.cpp Tue Jul 17 12:03:10 2018 -0700
+++ b/src/hotspot/os/linux/os_perf_linux.cpp Tue Jul 17 15:59:47 2018 -0400
@@ -895,21 +895,14 @@
}

int SystemProcessInterface::SystemProcesses::ProcessIterator::next_process() {
- struct dirent* entry;
-
if (!is_valid()) {
return OS_ERR;
}

do {
- entry = os::readdir(_dir, _entry);
- if (entry == NULL) {
- // error
- _valid = false;
- return OS_ERR;
- }
+ _entry = os::readdir(_dir);
if (_entry == NULL) {
- // reached end
+ // Error or reached end. Could use errno to distinguish those cases.
_valid = false;
return OS_ERR;
}
@@ -926,11 +919,8 @@
}

bool SystemProcessInterface::SystemProcesses::ProcessIterator::initialize() {
- _dir = opendir("/proc");
- _entry = (struct dirent*)NEW_C_HEAP_ARRAY(char, sizeof(struct dirent) + NAME_MAX + 1, mtInternal);
- if (NULL == _entry) {
- return false;
- }
+ _dir = os::opendir("/proc");
+ _entry = NULL;
_valid = true;
next_process();

@@ -938,11 +928,8 @@
}

SystemProcessInterface::SystemProcesses::ProcessIterator::~ProcessIterator() {
- if (_entry != NULL) {
- FREE_C_HEAP_ARRAY(char, _entry);
- }
if (_dir != NULL) {
- closedir(_dir);
+ os::closedir(_dir);
}
}

--- a/src/hotspot/os/linux/perfMemory_linux.cpp Tue Jul 17 12:03:10 2018 -0700
+++ b/src/hotspot/os/linux/perfMemory_linux.cpp Tue Jul 17 15:59:47 2018 -0400
@@ -561,9 +561,8 @@
// to determine the user name for the process id.
//
struct dirent* dentry;
- char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
errno = 0;
- while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
+ while ((dentry = os::readdir(tmpdirp)) != NULL) {

// check if the directory entry is a hsperfdata file
if (strncmp(dentry->d_name, PERFDATA_NAME, strlen(PERFDATA_NAME)) != 0) {
@@ -597,9 +596,8 @@
}

struct dirent* udentry;
- char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
errno = 0;
- while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
+ while ((udentry = os::readdir(subdirp)) != NULL) {

if (filename_to_pid(udentry->d_name) == searchpid) {
struct stat statbuf;
@@ -643,11 +641,9 @@
}
}
os::closedir(subdirp);
- FREE_C_HEAP_ARRAY(char, udbuf);
FREE_C_HEAP_ARRAY(char, usrdir_name);
}
os::closedir(tmpdirp);
- FREE_C_HEAP_ARRAY(char, tdbuf);

return(oldest_user);
}
@@ -769,10 +765,8 @@
// opendir/readdir.
//
struct dirent* entry;
- char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
-
errno = 0;
- while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
+ while ((entry = os::readdir(dirp)) != NULL) {

pid_t pid = filename_to_pid(entry->d_name);

@@ -809,8 +803,6 @@

// close the directory and reset the current working directory
close_directory_secure_cwd(dirp, saved_cwd_fd);
-
- FREE_C_HEAP_ARRAY(char, dbuf);
}

// make the user specific temporary directory. Returns true if

--- a/src/hotspot/os/posix/os_posix.cpp Tue Jul 17 12:03:10 2018 -0700
+++ b/src/hotspot/os/posix/os_posix.cpp Tue Jul 17 15:59:47 2018 -0400
@@ -35,6 +35,7 @@
#include "utilities/macros.hpp"
#include "utilities/vmError.hpp"

+#include <dirent.h>
#include <dlfcn.h>
#include <pthread.h>
#include <signal.h>
@@ -527,6 +528,21 @@
::funlockfile(fp);
}

+DIR* os::opendir(const char* dirname) {
+ assert(dirname != NULL, "just checking");
+ return ::opendir(dirname);
+}
+
+struct dirent* os::readdir(DIR* dirp) {
+ assert(dirp != NULL, "just checking");
+ return ::readdir(dirp);
+}
+
+int os::closedir(DIR *dirp) {
+ assert(dirp != NULL, "just checking");
+ return ::closedir(dirp);
+}
+
// Builds a platform dependent Agent_OnLoad_<lib_name> function name
// which is used to find statically linked in agents.
// Parameters:

--- a/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp Tue Jul 17 12:03:10 2018 -0700
+++ b/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp Tue Jul 17 15:59:47 2018 -0400
@@ -241,11 +241,7 @@
return;
}
struct dirent* dentry;
- char* dir_buffer = NEW_RESOURCE_ARRAY_RETURN_NULL(char, os::readdir_buf_size(_repo));
- if (dir_buffer == NULL) {
- return;
- }
- while ((dentry = os::readdir(dirp, (struct dirent*)dir_buffer)) != NULL) {
+ while ((dentry = os::readdir(dirp)) != NULL) {
const char* const entry_path = filter(dentry->d_name);
if (NULL != entry_path) {
_files->append(entry_path);
--- a/src/hotspot/share/runtime/os.hpp Tue Jul 17 12:03:10 2018 -0700
+++ b/src/hotspot/share/runtime/os.hpp Tue Jul 17 15:59:47 2018 -0400
@@ -580,8 +580,7 @@

// Reading directories.
static DIR* opendir(const char* dirname);
- static int readdir_buf_size(const char *path);
- static struct dirent* readdir(DIR* dirp, dirent* dbuf);
+ static struct dirent* readdir(DIR* dirp);
static int closedir(DIR* dirp);

// Dynamic library extension
--- a/test/jdk/ProblemList.txt Tue Jul 17 12:03:10 2018 -0700
+++ b/test/jdk/ProblemList.txt Tue Jul 17 15:59:47 2018 -0400
@@ -873,4 +873,3 @@

jdk/jfr/event/io/TestInstrumentation.java 8202142 generic-all
jdk/jfr/event/sampling/TestNative.java 8202142 generic-all
-jdk/jfr/event/os/TestSystemProcess.java 8202835 linux-all
2 changes: 2 additions & 0 deletions thirdparty/openjdk/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix-JDK-8144695.patch
fix-JDK-8212041.patch
12 changes: 9 additions & 3 deletions thirdparty/openjdk/zimbra-openjdk/debian/control
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Source: zimbra-openjdk
Build-Depends: debhelper (>= 9), m4, dpkg-dev (>= 1.15.7), libx11-dev,
libxext-dev, libxrender-dev, libxtst-dev, libxt-dev, openjdk-7-jdk,
libcups2-dev, libfreetype6-dev, libasound2-dev, ccache, zip
Build-Depends: debhelper (>= 9.20141010), dpkg-dev (>= 1.17.14), m4, lsb-release, zip,
unzip, sharutils, gawk, cpio, pkg-config, procps, wdiff, fastjar (>=2:0.96-0ubuntu2),
autoconf, automake, autotools-dev, ant, ant-optional, g++-8,
libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, libcups2-dev,
libasound2-dev, liblcms2-dev, libfreetype6-dev (>= 2.2.1), libxinerama-dev,
libkrb5-dev, xsltproc, libpcsclite-dev, libgtk-3-dev, libelf-dev, libfontconfig1-dev,
libffi-dev, zlib1g-dev, libattr1-dev, libpng-dev, libjpeg-dev, libgif-dev, libnss3-dev,
jtreg (>=4.2-b10-1~), xvfb, xauth, xfonts-base, libgl1-mesa-dri, twm, x11-xkb-utils,
testng, time, openjdk-11-jdk-headless, graphviz, pandoc
Section: utils
Priority: optional
Maintainer: Zimbra Packaging Services <[email protected]>
Expand Down
2 changes: 2 additions & 0 deletions thirdparty/openjdk/zimbra-openjdk/debian/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix-JDK-8144695.patch
fix-JDK-8212041.patch
9 changes: 2 additions & 7 deletions thirdparty/openjdk/zimbra-openjdk/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ override_dh_auto_clean:
override_dh_auto_configure:
./configure --prefix=OZC \
--enable-unlimited-crypto \
--with-update-version=JDK_UPDATE \
--with-build-number=JDK_BUILD \
--with-milestone=zimbra
--disable-warnings-as-errors \
--enable-debug

override_dh_strip:
dh_strip -pzimbra-openjdk --dbg-package=zimbra-openjdk-dbg
Expand All @@ -26,14 +25,10 @@ override_dh_auto_install:
cd $(CURDIR)/debian/tmpOZCL/jvm && ln -s openjdk* java
rm -rf $(CURDIR)/debian/tmp/OZCL/jvm/java/demo
rm -rf $(CURDIR)/debian/tmp/OZCL/jvm/java/sample
rm -f $(CURDIR)/debian/tmp/OZCL/jvm/java/jre/lib/security/cacerts
cd $(CURDIR)/debian/tmp/OZCL/jvm/java/jre/lib/security && \
ln -s OZCE/java/cacerts cacerts
cd $(CURDIR)/debian/tmpOZCB && ln -s ../lib/jvm/java/bin/jar
cd $(CURDIR)/debian/tmpOZCB && ln -s ../lib/jvm/java/bin/java
cd $(CURDIR)/debian/tmpOZCB && ln -s ../lib/jvm/java/bin/javac
cd $(CURDIR)/debian/tmpOZCB && ln -s ../lib/jvm/java/bin/javap
cd $(CURDIR)/debian/tmpOZCB && ln -s ../lib/jvm/java/bin/jhat
cd $(CURDIR)/debian/tmpOZCB && ln -s ../lib/jvm/java/bin/jmap
cd $(CURDIR)/debian/tmpOZCB && ln -s ../lib/jvm/java/bin/jps
cd $(CURDIR)/debian/tmpOZCB && ln -s ../lib/jvm/java/bin/jstack
Expand Down
12 changes: 6 additions & 6 deletions versions.def
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ APR_VERSION := 1.5.2

APR_UTIL_VERSION := 1.5.4

ASPELL_VERSION := 0.60.6.1
ASPELL_VERSION := 0.60.7-rc1
ASPELL-AR_VERSION := 1.2-0
ASPELL-AR_NORM := 1.2.0
ASPELL-DA_VERSION := 1.4.42-1
Expand Down Expand Up @@ -69,11 +69,11 @@ HTTPD_VERSION := 2.4.20

IMGK_VERSION := 6.7.7-2

JDK_SUB_TREE := 8u
JDK_UPDATE := 172
JDK_BUILD := b01
JDK_TAG := jdk8u$(JDK_UPDATE)-$(JDK_BUILD)
JDK_VERSION := 1.8.0u$(JDK_UPDATE)$(JDK_BUILD)
JDK_SUB_TREE := 11
JDK_UPDATE := 11
JDK_BUILD := 28
JDK_TAG := jdk-$(JDK_SUB_TREE)+$(JDK_BUILD)
JDK_VERSION := $(JDK_UPDATE).$(JDK_BUILD)

JETTY_DISTRIBUTION_VERSION := 9.3.5.v20151012

Expand Down