Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
icedtea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
icedtea
Commits
d300ad95
Commit
d300ad95
authored
Jun 15, 2020
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed forking under linux in IcedTea6
parent
13bfb9db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
6 deletions
+80
-6
icedtea6-1.13.13-fixed.patch
icedtea6-1.13.13-fixed.patch
+80
-6
No files found.
icedtea6-1.13.13-fixed.patch
View file @
d300ad95
diff -uNr icedtea6-1.13.13/Makefile.am icedtea6-1.13.13-f
reetypecheck_fix
/Makefile.am
diff -uNr icedtea6-1.13.13/Makefile.am icedtea6-1.13.13-f
ixed
/Makefile.am
--- icedtea6-1.13.13/Makefile.am 2017-01-05 06:52:49.112782727 +1030
--- icedtea6-1.13.13/Makefile.am 2017-01-05 06:52:49.112782727 +1030
+++ icedtea6-1.13.13-f
reetypecheck_fix/Makefile.am 2020-01-04 13:39:56.308372789 +10
30
+++ icedtea6-1.13.13-f
ixed/Makefile.am 2020-06-15 10:11:57.746344995 +09
30
@@ -345,6 +345,7 @@
@@ -345,6 +345,7 @@
patches/nomotif-6706121.patch \
patches/nomotif-6706121.patch \
patches/nomotif.patch \
patches/nomotif.patch \
...
@@ -9,9 +9,19 @@ diff -uNr icedtea6-1.13.13/Makefile.am icedtea6-1.13.13-freetypecheck_fix/Makefi
...
@@ -9,9 +9,19 @@ diff -uNr icedtea6-1.13.13/Makefile.am icedtea6-1.13.13-freetypecheck_fix/Makefi
patches/alt-jar.patch \
patches/alt-jar.patch \
patches/jdk-use-ssize_t.patch \
patches/jdk-use-ssize_t.patch \
patches/arch.patch \
patches/arch.patch \
diff -uNr icedtea6-1.13.13/Makefile.in icedtea6-1.13.13-freetypecheck_fix/Makefile.in
@@ -621,7 +622,8 @@
patches/openjdk/6260348-pr3068.patch \
patches/openjdk/6961123-pr2975.patch \
patches/pr2800-missing_resources.patch \
- patches/pr3213-conditional_arm32jit.patch
+ patches/pr3213-conditional_arm32jit.patch \
+ patches/linux_fork_fix.patch
if WITH_RHINO
ICEDTEA_PATCHES += \
diff -uNr icedtea6-1.13.13/Makefile.in icedtea6-1.13.13-fixed/Makefile.in
--- icedtea6-1.13.13/Makefile.in 2017-01-05 06:53:00.576597287 +1030
--- icedtea6-1.13.13/Makefile.in 2017-01-05 06:53:00.576597287 +1030
+++ icedtea6-1.13.13-f
reetypecheck_fix/Makefile.in 2020-01-04 13:40:16.013407821 +10
30
+++ icedtea6-1.13.13-f
ixed/Makefile.in 2020-06-15 10:12:40.606483604 +09
30
@@ -793,6 +793,7 @@
@@ -793,6 +793,7 @@
patches/gcc-suffix.patch patches/libraries-splashscreen.patch \
patches/gcc-suffix.patch patches/libraries-splashscreen.patch \
patches/uname.patch patches/nomotif-6706121.patch \
patches/uname.patch patches/nomotif-6706121.patch \
...
@@ -20,9 +30,19 @@ diff -uNr icedtea6-1.13.13/Makefile.in icedtea6-1.13.13-freetypecheck_fix/Makefi
...
@@ -20,9 +30,19 @@ diff -uNr icedtea6-1.13.13/Makefile.in icedtea6-1.13.13-freetypecheck_fix/Makefi
patches/alt-jar.patch patches/jdk-use-ssize_t.patch \
patches/alt-jar.patch patches/jdk-use-ssize_t.patch \
patches/arch.patch patches/lc_ctype.patch patches/xjc.patch \
patches/arch.patch patches/lc_ctype.patch patches/xjc.patch \
patches/linker-libs-order.patch patches/testenv.patch \
patches/linker-libs-order.patch patches/testenv.patch \
diff -uNr icedtea6-1.13.13/patches/freetypecheck_fix.patch icedtea6-1.13.13-freetypecheck_fix/patches/freetypecheck_fix.patch
@@ -1049,7 +1050,8 @@
patches/openjdk/6260348-pr3068.patch \
patches/openjdk/6961123-pr2975.patch \
patches/pr2800-missing_resources.patch \
- patches/pr3213-conditional_arm32jit.patch $(am__append_21) \
+ patches/pr3213-conditional_arm32jit.patch \
+ patches/linux_fork_fix.patch $(am__append_21) \
$(am__append_22) $(am__append_23) $(am__append_24) \
$(am__append_25) $(am__append_26) $(am__append_27) \
$(am__append_28) $(am__append_29) $(am__append_30) \
diff -uNr icedtea6-1.13.13/patches/freetypecheck_fix.patch icedtea6-1.13.13-fixed/patches/freetypecheck_fix.patch
--- icedtea6-1.13.13/patches/freetypecheck_fix.patch 1970-01-01 09:30:00.000000000 +0930
--- icedtea6-1.13.13/patches/freetypecheck_fix.patch 1970-01-01 09:30:00.000000000 +0930
+++ icedtea6-1.13.13-f
reetypecheck_fix/patches/freetypecheck_fix.patch 2020-01-04 12:49:36.800022175 +10
30
+++ icedtea6-1.13.13-f
ixed/patches/freetypecheck_fix.patch 2020-06-15 10:09:28.347861864 +09
30
@@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
+diff -uNr openjdk/jdk/make/common/shared/Sanity.gmk openjdk.fixed/jdk/make/common/shared/Sanity.gmk
+diff -uNr openjdk/jdk/make/common/shared/Sanity.gmk openjdk.fixed/jdk/make/common/shared/Sanity.gmk
+--- openjdk/jdk/make/common/shared/Sanity.gmk 2016-12-30 15:00:21.000000000 +1030
+--- openjdk/jdk/make/common/shared/Sanity.gmk 2016-12-30 15:00:21.000000000 +1030
...
@@ -58,3 +78,57 @@ diff -uNr icedtea6-1.13.13/patches/freetypecheck_fix.patch icedtea6-1.13.13-free
...
@@ -58,3 +78,57 @@ diff -uNr icedtea6-1.13.13/patches/freetypecheck_fix.patch icedtea6-1.13.13-free
+
+
+ ######################################################
+ ######################################################
+ # CUPS_HEADERS_PATH must be valid
+ # CUPS_HEADERS_PATH must be valid
diff -uNr icedtea6-1.13.13/patches/linux_fork_fix.patch icedtea6-1.13.13-fixed/patches/linux_fork_fix.patch
--- icedtea6-1.13.13/patches/linux_fork_fix.patch 1970-01-01 09:30:00.000000000 +0930
+++ icedtea6-1.13.13-fixed/patches/linux_fork_fix.patch 2020-06-15 09:59:58.773019937 +0930
@@ -0,0 +1,50 @@
+diff -uNr openjdk/hotspot/src/os/linux/vm/os_linux.cpp openjdk-linux_fork_fix/hotspot/src/os/linux/vm/os_linux.cpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2016-12-30 15:01:06.000000000 +1030
++++ openjdk-linux_fork_fix/hotspot/src/os/linux/vm/os_linux.cpp 2020-06-15 09:58:59.674828819 +0930
+@@ -5334,14 +5334,6 @@
+
+ extern char** environ;
+
+-#ifndef __NR_fork
+-#define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57)
+-#endif
+-
+-#ifndef __NR_execve
+-#define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59)
+-#endif
+-
+ // Run the specified command in a separate process. Return its exit value,
+ // or -1 on failure (e.g. can't fork a new process).
+ // Unlike system(), this function can be called from signal handler. It
+@@ -5349,13 +5341,7 @@
+ int os::fork_and_exec(char* cmd) {
+ const char * argv[4] = {"sh", "-c", cmd, NULL};
+
+- // fork() in LinuxThreads/NPTL is not async-safe. It needs to run
+- // pthread_atfork handlers and reset pthread library. All we need is a
+- // separate process to execve. Make a direct syscall to fork process.
+- // On IA64 there's no fork syscall, we have to use fork() and hope for
+- // the best...
+- pid_t pid = NOT_IA64(syscall(__NR_fork);)
+- IA64_ONLY(fork();)
++ pid_t pid = fork();
+
+ if (pid < 0) {
+ // fork failed
+@@ -5364,15 +5350,7 @@
+ } else if (pid == 0) {
+ // child process
+
+- // execve() in LinuxThreads will call pthread_kill_other_threads_np()
+- // first to kill every thread on the thread list. Because this list is
+- // not reset by fork() (see notes above), execve() will instead kill
+- // every thread in the parent process. We know this is the only thread
+- // in the new process, so make a system call directly.
+- // IA64 should use normal execve() from glibc to match the glibc fork()
+- // above.
+- NOT_IA64(syscall(__NR_execve, "/bin/sh", argv, environ);)
+- IA64_ONLY(execve("/bin/sh", (char* const*)argv, environ);)
++ execve("/bin/sh", (char* const*)argv, environ);
+
+ // execve failed
+ _exit(-1);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment