about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-11-18 15:00:13 +0000
committerbors <bors@rust-lang.org>2017-11-18 15:00:13 +0000
commit1f491e07c9e8932fe47268af243f299ab685036f (patch)
treebedce1ed252f2c94a30e0b80fbc072ed7e855283
parent18250b0349848fbfca53153cf121724c773dd508 (diff)
parent3d791d29b879c21cbbc31a60e35d16a877eb56dc (diff)
downloadrust-1f491e07c9e8932fe47268af243f299ab685036f.tar.gz
rust-1f491e07c9e8932fe47268af243f299ab685036f.zip
Auto merge of #46009 - kennytm:fix-38878-again, r=alexcrichton
Fix #38878 again — restart linker when seeing SIGBUS in additional to SIGSEGV.

In https://github.com/rust-lang/rust/pull/45985#issuecomment-344586645 we see a linker crashed due to Bus Error (signal 10) on macOS. The error was not caught by #40422 since the PR only handles Segmentation Fault (signal 11). The crash log indicates the problem is the same as #38878, so we just amend #40422 to include SIGBUS as well.

(Additionally, modified how the crash logs are printed so that irrelevant logs are truly filtered out.)
-rw-r--r--.travis.yml10
-rw-r--r--src/librustc_trans/back/link.rs6
2 files changed, 8 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index 62336a7ff2a..5ff3a1c13f0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -254,11 +254,11 @@ after_failure:
   # Random attempt at debugging currently. Just poking around in here to see if
   # anything shows up.
   - ls -lat $HOME/Library/Logs/DiagnosticReports/
-  - find $HOME/Library/Logs/DiagnosticReports/ ! \(
-      -name '*.stage2-*.crash'
-      -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash'
-    \)
-      -exec echo -e travis_fold":start:crashlog\n\033[31;1m" {} "\033[0m" \;
+  - find $HOME/Library/Logs/DiagnosticReports
+      -type f
+      -not -name '*.stage2-*.crash'
+      -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash'
+      -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \;
       -exec head -750 {} \;
       -exec echo travis_fold":"end:crashlog \;
 
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index a67cc339916..feeef1df435 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -661,9 +661,9 @@ fn link_natively(sess: &Session,
         let mut out = output.stderr.clone();
         out.extend(&output.stdout);
         let out = String::from_utf8_lossy(&out);
-        let msg = "clang: error: unable to execute command: \
-                   Segmentation fault: 11";
-        if !out.contains(msg) {
+        let msg_segv = "clang: error: unable to execute command: Segmentation fault: 11";
+        let msg_bus  = "clang: error: unable to execute command: Bus error: 10";
+        if !(out.contains(msg_segv) || out.contains(msg_bus)) {
             break
         }