summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2019-07-14 13:12:19 -1000
committerSam Bingner <sam@bingner.com>2019-07-14 13:12:19 -1000
commit5962a5bb2931566897c3c3194f74bee012d168ba (patch)
tree284288500d94df813aa7ec15d7e4e269963d51bc
parent37b0f9ccc3bbb38de1ae98b8f8a5325f2e3b4e62 (diff)
Fix a race condition with jit for node
l---------data/nodejs/_metadata/libssl1.1.1.dep1
l---------data/nodejs/_metadata/libssl1.1.dep1
-rw-r--r--data/nodejs/jit.diff12
3 files changed, 9 insertions, 5 deletions
diff --git a/data/nodejs/_metadata/libssl1.1.1.dep b/data/nodejs/_metadata/libssl1.1.1.dep
new file mode 120000
index 000000000..254747b12
--- /dev/null
+++ b/data/nodejs/_metadata/libssl1.1.1.dep
@@ -0,0 +1 @@
+../../libssl1.1.1 \ No newline at end of file
diff --git a/data/nodejs/_metadata/libssl1.1.dep b/data/nodejs/_metadata/libssl1.1.dep
deleted file mode 120000
index 71bfa9edd..000000000
--- a/data/nodejs/_metadata/libssl1.1.dep
+++ /dev/null
@@ -1 +0,0 @@
-../../libssl1.1 \ No newline at end of file
diff --git a/data/nodejs/jit.diff b/data/nodejs/jit.diff
index c64201e39..5c3d78b97 100644
--- a/data/nodejs/jit.diff
+++ b/data/nodejs/jit.diff
@@ -14,7 +14,7 @@ diff -ur node-v12.3.1/src/node_main.cc node-v12.3.1+JIT/src/node_main.cc
#ifdef _WIN32
#include <windows.h>
-@@ -93,6 +99,46 @@
+@@ -93,6 +99,50 @@
} // namespace per_process
} // namespace node
@@ -28,8 +28,12 @@ diff -ur node-v12.3.1/src/node_main.cc node-v12.3.1+JIT/src/node_main.cc
+
+ pid_t pid = fork();
+ if (pid) {
-+ int st;
-+ waitpid(pid, &st, 0);
++ int st,rv,i=0;
++ do {
++ usleep(500);
++ rv = waitpid(pid, &st, 0);
++ } while (rv<0 && i++<10);
++ if (rv<0) fprintf(stderr, "Unable to wait for child?\n");
+ } else if (pid == 0) {
+ pid_t ppid = getppid();
+ int rv = ptrace(PT_ATTACHEXC, ppid, 0, 0);
@@ -61,7 +65,7 @@ diff -ur node-v12.3.1/src/node_main.cc node-v12.3.1+JIT/src/node_main.cc
int main(int argc, char* argv[]) {
#if defined(__POSIX__) && defined(NODE_SHARED_MODE)
// In node::PlatformInit(), we squash all signal handlers for non-shared lib
-@@ -119,6 +165,9 @@
+@@ -119,6 +168,9 @@
}
}
#endif