aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/libc_exec.go
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-10 07:25:31 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-10 07:25:31 +0000
commit904b3e949a93a8953db41e41b256a5b27debeed4 (patch)
treeb0522edde1d3c5356c95eb1ee2eae3e87befa1f3 /compiler_wrapper/libc_exec.go
parent4e4201457e5f51a132101c611c79ccff9f713c8b (diff)
parent882a18888febb9cb0b9d6c6069498cbc4aa30f88 (diff)
downloadtoolchain-utils-904b3e949a93a8953db41e41b256a5b27debeed4.tar.gz
Change-Id: I173027e1513f8b33f7aec083bf3757087435e515
Diffstat (limited to 'compiler_wrapper/libc_exec.go')
-rw-r--r--compiler_wrapper/libc_exec.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler_wrapper/libc_exec.go b/compiler_wrapper/libc_exec.go
index d9867733..a7a561bc 100644
--- a/compiler_wrapper/libc_exec.go
+++ b/compiler_wrapper/libc_exec.go
@@ -18,7 +18,20 @@ package main
// // Since fork() brings us to one thread, we can only use async-signal-safe funcs below.
// pid_t pid = fork();
// if (pid == 0) {
-// execve(pathname, argv, envp);
+// // crbug.com/1166017: we're (very rarely) getting ERESTARTSYS on some builders.
+// // Documentation indicates that this is a bug in the kernel. Work around it by
+// // retrying. 25 is an arbitrary retry number that Should Be Enough For Anyone(TM).
+// int i = 0;
+// for (; i < 25; i++) {
+// execve(pathname, argv, envp);
+// if (errno != 512) {
+// break;
+// }
+// // Sleep a bit. Not sure if this helps, but if the condition we're seeing is
+// // transient, it *hopefully* should. nanosleep isn't async-signal safe, so
+// // we have to live with sleep()
+// sleep(1);
+// }
// fprintf(stderr, "exec failed (errno: %d)\n", errno);
// _exit(1);
// }