Skip to content

Commit

Permalink
materialized: fix backtraces on macOS
Browse files Browse the repository at this point in the history
Switch over to the new Gimli-based backtrace symbolicator. Gimli is a
pure-Rust reimplementation of libbacktrace that will soon be the default
backtrace implementation in the Rust standard library [0]. Switching to
it now means we can help shake out problems, like [1], before it ships
in the standard library, where fixing problems will require a full six
week release cycle.

This switch has the side effect of fixing backtraces on macOS, which
seem to be broken at the moment because the backtrace crate is picking
libbacktrace over coresymbolication. There isn't a good way of fixing
that because Cargo doesn't support per-platform features [2]; using
neither libbacktrace or coresymbolicator is a kind of stupid but
effective way of sidestepping the problem.

[0]: rust-lang/rust#73441
[1]: rust-lang/backtrace-rs#342
[2]: rust-lang/cargo#1197
  • Loading branch information
benesch committed Jun 17, 2020
1 parent 4d56e12 commit 51992ba
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
33 changes: 16 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ members = [
"test/test-util",
]

[profile.dev.package]
# Compile the backtrace crate and its dependencies with all optimizations, even
# in dev builds, since otherwise backtraces can take 20s+ to symbolize. With
# optimizations enabled, symbolizing a backtrace takes less than 1s.
addr2line = { opt-level = 3 }
backtrace = { opt-level = 3 }
gimli = { opt-level = 3 }
miniz_oxide = { opt-level = 3 }
object = { opt-level = 3 }

[profile.release]
# Emit only the line info tables, not full debug info, in release builds, to
# substantially reduce the size of the debug info. Line info tables are enough
Expand Down
2 changes: 1 addition & 1 deletion src/materialized/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "proprietary"

[dependencies]
async-trait = "0.1.35"
backtrace = { version = "0.3.48", default-features = false, features = ["coresymbolication", "libbacktrace"] }
backtrace = { version = "0.3.49" }
comm = { path = "../comm" }
compile-time-run = "0.2.8"
coord = { path = "../coord" }
Expand Down

0 comments on commit 51992ba

Please sign in to comment.