Merged update from upstream sources
This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/eclipse.git#b4c147d96ef29ffc330e7c5fbe9e9f8e84a24ce9
This commit is contained in:
parent
1d2701ce88
commit
ca1c7600c0
115
ebz569853-1.patch
Normal file
115
ebz569853-1.patch
Normal file
@ -0,0 +1,115 @@
|
||||
From 2684843e3d22bb177a6c6b21c3ee75f3bb3d250e Mon Sep 17 00:00:00 2001
|
||||
From: Simeon Andreev
|
||||
Date: Mon, 21 Dec 2020 12:52:01 +0100
|
||||
Subject: Bug 569853 - jstack crashes Eclipse when running on Java 11
|
||||
|
||||
1) Always call DetachCurrentThread if AttachCurrentThreadAsDaemon was
|
||||
called before, see
|
||||
https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/invocation.html#detaching_from_the_vm.
|
||||
|
||||
2) Specify JNI 1.4 version in JNI_OnLoad, see
|
||||
https://docs.oracle.com/en/java/javase/11/docs/specs/jni/invocation.html#jni_onload
|
||||
|
||||
3) Added printf around attach/detach for easier debugging.
|
||||
|
||||
4) Fixed build.sh to allow c99 standard for the for loop defined in
|
||||
DEBUG_CALL_PRINTS and resolve compilation error below if
|
||||
DEBUG_CALL_PRINTS is enabled:
|
||||
|
||||
callback.c:1252:3: error: 'for' loop initial declarations are only
|
||||
allowed in C99 mode
|
||||
|
||||
Main change is 1), it is a workaround for jstack / JVM bug described in
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1897150
|
||||
|
||||
Change-Id: I3ba32d9bef217e5ffc76b8802e7e59de503a2161
|
||||
---
|
||||
.../Eclipse SWT/common/library/callback.c | 28 +++++++++-------------
|
||||
.../Eclipse SWT/common/library/swt.c | 6 +----
|
||||
.../Eclipse SWT/common/library/swt.h | 1 -
|
||||
4 files changed, 13 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c
|
||||
index 1e37e28810..0bd7b87a77 100644
|
||||
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c
|
||||
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c
|
||||
@@ -1298,24 +1298,15 @@ jlong callback(int index, ...)
|
||||
}
|
||||
#endif
|
||||
|
||||
-#ifdef JNI_VERSION_1_2
|
||||
- if (IS_JNI_1_2) {
|
||||
- (*JVM)->GetEnv(JVM, (void **)&env, JNI_VERSION_1_2);
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
-#ifdef JNI_VERSION_1_4
|
||||
- if (env == NULL) {
|
||||
- if (JNI_VERSION >= JNI_VERSION_1_4) {
|
||||
- (*JVM)->AttachCurrentThreadAsDaemon(JVM, (void **)&env, NULL);
|
||||
- }
|
||||
- }
|
||||
+(*JVM)->GetEnv(JVM, (void **)&env, JNI_VERSION_1_4);
|
||||
+
|
||||
+if (env == NULL) {
|
||||
+ (*JVM)->AttachCurrentThreadAsDaemon(JVM, (void **)&env, NULL);
|
||||
+#ifdef DEBUG_CALL_PRINTS
|
||||
+ fprintf(stderr, "SWT-JNI: AttachCurrentThreadAsDaemon\n");
|
||||
#endif
|
||||
-
|
||||
- if (env == NULL) {
|
||||
- (*JVM)->AttachCurrentThread(JVM, (void **)&env, NULL);
|
||||
- if (IS_JNI_1_2) detach = 1;
|
||||
- }
|
||||
+ detach = 1;
|
||||
+}
|
||||
|
||||
/* If the current thread is not attached to the VM, it is not possible to call into the VM */
|
||||
if (env == NULL) {
|
||||
@@ -1391,6 +1382,9 @@ done:
|
||||
|
||||
if (detach) {
|
||||
(*JVM)->DetachCurrentThread(JVM);
|
||||
+#ifdef DEBUG_CALL_PRINTS
|
||||
+ fprintf(stderr, "SWT-JNI: DetachCurrentThread\n");
|
||||
+#endif
|
||||
env = NULL;
|
||||
}
|
||||
|
||||
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.c b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.c
|
||||
index e78a2e4811..483aae2d47 100644
|
||||
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.c
|
||||
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.c
|
||||
@@ -14,16 +14,12 @@
|
||||
|
||||
#include "swt.h"
|
||||
|
||||
-int IS_JNI_1_2 = 0;
|
||||
JavaVM *JVM = NULL;
|
||||
|
||||
-#ifdef JNI_VERSION_1_2
|
||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
- IS_JNI_1_2 = 1;
|
||||
JVM = vm;
|
||||
- return JNI_VERSION_1_2;
|
||||
+ return JNI_VERSION_1_4;
|
||||
}
|
||||
-#endif
|
||||
|
||||
void throwOutOfMemory(JNIEnv *env) {
|
||||
jclass clazz = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
|
||||
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h
|
||||
index fa228e9971..32f39f01bd 100644
|
||||
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h
|
||||
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h
|
||||
@@ -29,7 +29,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
-extern int IS_JNI_1_2;
|
||||
extern JavaVM *JVM;
|
||||
|
||||
/* #define DEBUG */
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
49
ebz569853-2.patch
Normal file
49
ebz569853-2.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From de8045341dd4eda05a98db2157ead188ab21a899 Mon Sep 17 00:00:00 2001
|
||||
From: Andrey Loskutov
|
||||
Date: Tue, 22 Dec 2020 12:40:46 +0100
|
||||
Subject: Bug 569853 - reverted build file change causing crash on native
|
||||
dialog
|
||||
|
||||
Change on the build script was required to compile callback.c with
|
||||
#define DEBUG_CALL_PRINTS for debug output.
|
||||
|
||||
Turned out, this change compiles something that GTK code can't
|
||||
understand & so it crashes with SIGSEGV on opening native file dialog.
|
||||
|
||||
# Problematic frame:
|
||||
# C [libglib-2.0.so.0+0x39757] g_path_is_absolute+0x7
|
||||
|
||||
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
|
||||
j org.eclipse.swt.internal.gtk.GTK.gtk_file_chooser_set_current_folder(JJ)V+0
|
||||
j org.eclipse.swt.widgets.FileDialog.presetChooserDialog()V+599
|
||||
j org.eclipse.swt.widgets.FileDialog.openNativeChooserDialog()Ljava/lang/String;+104
|
||||
j org.eclipse.swt.widgets.FileDialog.open()Ljava/lang/String;+1
|
||||
j org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run()V+35
|
||||
j org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(Lorg/eclipse/jface/action/IAction;)V+1
|
||||
|
||||
Change-Id: I225525d41c41ae90e9f8e30eb53baae18f527634
|
||||
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
|
||||
---
|
||||
|
||||
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c
|
||||
index 0bd7b87a77..df33e672e2 100644
|
||||
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c
|
||||
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c
|
||||
@@ -1244,12 +1244,13 @@
|
||||
|
||||
#ifdef DEBUG_CALL_PRINTS
|
||||
{
|
||||
+ int i;
|
||||
va_list vaCopy;
|
||||
va_copy(vaCopy, vl);
|
||||
|
||||
counter++;
|
||||
fprintf(stderr, "SWT-JNI:%*scallback[%d](", counter, "", index);
|
||||
- for (int i=0; i<argCount; i++) {
|
||||
+ for (i=0; i<argCount; i++) {
|
||||
void* arg = va_arg(vaCopy, void*);
|
||||
int isPrinted = 0;
|
||||
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
21
eclipse.spec
21
eclipse.spec
@ -54,7 +54,7 @@ Epoch: 1
|
||||
Summary: An open, extensible IDE
|
||||
Name: eclipse
|
||||
Version: 4.18
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
License: EPL-2.0
|
||||
URL: https://www.eclipse.org/
|
||||
|
||||
@ -84,7 +84,7 @@ Patch4: eclipse-secondary-arches.patch
|
||||
Patch5: eclipse-debug-symbols.patch
|
||||
|
||||
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=408138
|
||||
Patch12: eclipse-fix-dropins.patch
|
||||
Patch6: eclipse-fix-dropins.patch
|
||||
|
||||
# Feature plugin definitions lock onto version of plugin at build-time.
|
||||
# If plugin is external, updating it breaks the feature. (version changes)
|
||||
@ -124,6 +124,10 @@ Patch25: eclipse-patch-out-fileupload-dep.patch
|
||||
# Force a clean on the restart after p2 operations
|
||||
Patch26: force-clean-after-p2-operations.patch
|
||||
|
||||
# Upstream fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=569853
|
||||
Patch27: ebz569853-1.patch
|
||||
Patch28: ebz569853-2.patch
|
||||
|
||||
# Upstream no longer supports non-64bit arches
|
||||
ExcludeArch: s390 %{arm} %{ix86}
|
||||
|
||||
@ -180,7 +184,7 @@ BuildRequires: lucene-analysis >= %{_lucene_version}
|
||||
BuildRequires: lucene-queryparser >= %{_lucene_version}
|
||||
BuildRequires: lucene-analyzers-smartcn >= %{_lucene_version}
|
||||
BuildRequires: junit >= 4.12
|
||||
BuildRequires: junit5 >= 5.4.0
|
||||
BuildRequires: junit5 >= 5.6.2
|
||||
BuildRequires: apiguardian
|
||||
BuildRequires: hamcrest
|
||||
BuildRequires: sat4j
|
||||
@ -300,7 +304,7 @@ BuildArch: noarch
|
||||
Provides: %{name} = %{epoch}:%{version}-%{release}
|
||||
Requires: %{name}-platform = %{epoch}:%{version}-%{release}
|
||||
Requires: junit >= 4.12
|
||||
Requires: junit5 >= 5.4.0
|
||||
Requires: junit5 >= 5.6.2
|
||||
Requires: osgi(org.hamcrest.core)
|
||||
|
||||
# Obsoletes added in F30
|
||||
@ -359,7 +363,7 @@ rm -rf rt.equinox.binaries/org.eclipse.equinox.executable/{bin,contributed}/
|
||||
%patch3
|
||||
%patch4 -p1
|
||||
%patch5
|
||||
%patch12
|
||||
%patch6
|
||||
%patch13 -p1
|
||||
%patch14
|
||||
%patch15
|
||||
@ -376,6 +380,8 @@ rm -rf rt.equinox.binaries/org.eclipse.equinox.executable/{bin,contributed}/
|
||||
%patch24 -p1
|
||||
%patch25
|
||||
%patch26 -p1
|
||||
%patch27 -p1
|
||||
%patch28 -p1
|
||||
|
||||
# Optional (unused) multipart support (see patch 25)
|
||||
rm rt.equinox.bundles/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/multipart/MultipartSupport{Impl,FactoryImpl,Part}.java
|
||||
@ -383,6 +389,7 @@ rm rt.equinox.bundles/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/e
|
||||
# ASM still on 8
|
||||
sed -i -e 's/V16/V15/' -e 's/ASM9/ASM8/' eclipse.jdt.debug/org.eclipse.jdt.launching.javaagent/src/main/java/org/eclipse/jdt/launching/internal/weaving/ClassfileTransformer.java eclipse.pde.ui/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/util/Util.java
|
||||
sed -i -e '/org.objectweb.asm/s/9\.0\.0/8.0.0/' eclipse.pde.ui/apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF
|
||||
sed -i -e 's/9\.0/8.0.1/' eclipse.jdt.debug/org.eclipse.jdt.launching.javaagent/pom.xml
|
||||
|
||||
# Remove jgit deps because building from source tarball, not a git repo
|
||||
%pom_remove_dep :tycho-buildtimestamp-jgit eclipse-platform-parent
|
||||
@ -631,6 +638,7 @@ ln -s $(build-classpath osgi-annotation) rt.equinox.bundles/bundles/org.eclipse.
|
||||
%mvn_package ":org.eclipse.equinox.executable" sdk
|
||||
%mvn_package "org.eclipse.jdt{,.feature}:" jdt
|
||||
%mvn_package ":org.eclipse.ant.{launching,ui}" jdt
|
||||
%mvn_package "org.eclipse.debug:org.eclipse.unittest.ui" jdt
|
||||
%mvn_package ":org.eclipse.equinox.p2.discovery.{feature,compatibility}" p2-discovery
|
||||
%mvn_package ":org.eclipse.equinox.p2{,.ui}.discovery" p2-discovery
|
||||
%mvn_package "org.eclipse.cvs{,.feature}:" cvs
|
||||
@ -1040,6 +1048,9 @@ echo "%{version}-%{release}" > %{buildroot}%{_eclipsedir}/.pkgs/Distro%{?dist}
|
||||
%{_eclipsedir}/plugins/org.eclipse.osgi.util_*
|
||||
|
||||
%changelog
|
||||
* Wed Feb 3 2021 Mat Booth <mat.booth@redhat.com> - 1:4.18-3
|
||||
- Backport patch for jstack crash from ebz#569853
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.18-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user