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 all 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
29 changes: 8 additions & 21 deletions thirdparty/openjdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include $(PKG_ROOT)/../../package.def

pvers := $(JDK_VERSION)
pname := openjdk
pfile := $(pname)-$(pvers).tgz
pfile := $(pname)-$(pvers)_linux-x64_bin.tar.gz
psrc_file := $(SRC_DIR)/$(pfile)
zname := zimbra-$(pname)
zspec := $(pname).spec
Expand All @@ -25,25 +25,12 @@ 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 "Downloading openjdk binaries. This may take some time." && \
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 \
)

wget https://download.java.net/java/GA/jdk$(JDK_SUB_TREE)/9/GPL/$(pfile) && \
tar xvzf $(pfile) && \
mv jdk-$(pvers) openjdk-$(pvers)-zimbra && \
tar -czf ../openjdk-$(pvers)-zimbra.tgz openjdk-$(pvers)-zimbra )
pkgadd:
$(PKG_EXTRACT) $(openjdk)

Expand Down Expand Up @@ -75,8 +62,8 @@ 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) && \
$(TAR) xfz ../$(z_tgz) --strip-components=1 && \
$(PKG_BUILD)
$(TAR) xfz ../$(z_tgz) && \
($(PKG_BUILD) -b)

clean: pkgrm
$(generic-clean)
3 changes: 1 addition & 2 deletions thirdparty/openjdk/RHEL.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ openjdk.RHEL := libX11-devel libXau-devel libXext-devel \
xorg-x11-proto-devel libICE-devel libSM-devel libXt \
libXt-devel libXrender-devel keyutils-libs-devel \
krb5-devel libcom_err-devel libselinux-devel \
libsepol-devel openssl-devel cups-devel freetype-devel \
alsa-lib-devel java-1.7.0-openjdk-devel
libsepol-devel openssl-devel cups-devel freetype-devel
openjdk.RHEL7_64 := $(openjdk.RHEL)
openjdk.RHEL6_64 := $(openjdk.RHEL)
openjdk-purge.RHEL := alsa-lib-devel freetype-devel cups-devel openssl-devel \
Expand Down
27 changes: 25 additions & 2 deletions thirdparty/openjdk/UBUNTU.def
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
openjdk.UBUNTU := libx11-dev x11proto-xext-dev libxext-dev \
x11proto-render-dev libxrender-dev libxfixes-dev libxi-dev \
x11proto-fixes-dev x11proto-record-dev libxtst-dev libxt-dev \
openjdk-7-jdk libcups2-dev libfreetype6-dev libasound2-dev \
ccache
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
29 changes: 3 additions & 26 deletions thirdparty/openjdk/zimbra-openjdk/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
zimbra-openjdk (VERSION-1zimbra8.7b5ZAPPEND) unstable; urgency=medium
zimbra-openjdk (VERSION-1zimbra8.8b1ZAPPEND) unstable; urgency=medium

* Update version to 1.8 update 172 build 01
* Update version to 11 update 2 build 01

-- Zimbra Packaging Services <[email protected]> Fri, 18 May 2018 00:00:00 +0000
zimbra-openjdk (VERSION-1zimbra8.7b4ZAPPEND) unstable; urgency=medium

* Update version to 1.8 update 144 build 01

-- Zimbra Packaging Services <[email protected]> Fri, 28 Jul 2017 00:00:00 +0000

zimbra-openjdk (VERSION-1zimbra8.7b3ZAPPEND) unstable; urgency=medium

* Update version to 1.8 update 77 build 03

-- Zimbra Packaging Services <[email protected]> Mon, 28 Mar 2015 22:26:24 +0000

zimbra-openjdk (VERSION-1zimbra8.7b2ZAPPEND) unstable; urgency=medium

* Fix cacerts handling to avoid conflicts

-- Zimbra Packaging Services <[email protected]> Thu, 11 Feb 2016 22:26:24 +0000

zimbra-openjdk (VERSION-ITERATIONZAPPEND) unstable; urgency=medium

* Initial Release.

-- Zimbra Packaging Services <[email protected]> Fri, 1 May 2015 22:26:24 +0000
-- Zimbra Packaging Services <[email protected]> Tue, 19 Mar 2019 00:00:00 +0000
4 changes: 1 addition & 3 deletions thirdparty/openjdk/zimbra-openjdk/debian/control
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
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: m4, lsb-release, zip, unzip
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
Loading