Skip to content

Commit

Permalink
Auto merge of rust-lang#46009 - kennytm:fix-38878-again, r=alexcrichton
Browse files Browse the repository at this point in the history
Fix rust-lang#38878 again — restart linker when seeing SIGBUS in additional to SIGSEGV.

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

(Additionally, modified how the crash logs are printed so that irrelevant logs are truly filtered out.)
  • Loading branch information
bors committed Nov 18, 2017
2 parents 18250b0 + 3d791d2 commit 1f491e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \;

Expand Down
6 changes: 3 additions & 3 deletions src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 1f491e0

Please sign in to comment.