File tree Expand file tree Collapse file tree 6 files changed +28
-5
lines changed Expand file tree Collapse file tree 6 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -192,3 +192,14 @@ jobs:
192192 - name : Install Rust
193193 run : rustup update 1.40.0 && rustup default 1.40.0
194194 - run : cargo build
195+
196+ miri :
197+ name : Miri
198+ runs-on : ubuntu-latest
199+ steps :
200+ - uses : actions/checkout@v1
201+ with :
202+ submodules : true
203+ - name : Install Rust
204+ run : ./ci/miri-rustup.sh
205+ - run : MIRIFLAGS="-Zmiri-disable-isolation" cargo miri test
Original file line number Diff line number Diff line change 1+ set -ex
2+
3+ MIRI_NIGHTLY=nightly-$( curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
4+ echo " Installing latest nightly with Miri: $MIRI_NIGHTLY "
5+ rustup set profile minimal
6+ rustup default " $MIRI_NIGHTLY "
7+ rustup component add miri
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ pub struct MiriFrame {
1313 pub filename : Box < [ u8 ] > ,
1414 pub lineno : u32 ,
1515 pub colno : u32 ,
16+ pub fn_ptr : * mut c_void ,
1617}
1718
1819#[ derive( Debug , Clone ) ]
@@ -36,7 +37,7 @@ impl Frame {
3637 }
3738
3839 pub fn symbol_address ( & self ) -> * mut c_void {
39- self . addr
40+ self . inner . fn_ptr
4041 }
4142
4243 pub fn module_base_address ( & self ) -> Option < * mut c_void > {
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ fn doit() {
2222 !cfg ! ( target_env = "musl" )
2323 // Skip MinGW on libbacktrace which doesn't have support for DLLs.
2424 && !( cfg ! ( windows) && cfg ! ( target_env = "gnu" ) && cfg ! ( feature = "libbacktrace" ) )
25+ // Skip Miri, since it doesn't support dynamic libraries.
26+ && !cfg ! ( miri)
2527 {
2628 // TODO(#238) this shouldn't have to happen first in this function, but
2729 // currently it does.
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ fn main() {
1313 // These run in docker containers on CI where they can't re-exec the test,
1414 // so just skip these for CI. No other reason this can't run on those
1515 // platforms though.
16- if cfg ! ( unix) && ( cfg ! ( target_arch = "arm" ) || cfg ! ( target_arch = "aarch64" ) ) {
16+ // Miri does not have support for re-execing a file
17+ if cfg ! ( unix) && ( cfg ! ( target_arch = "arm" ) || cfg ! ( target_arch = "aarch64" ) ) || cfg ! ( miri) {
1718 println ! ( "test result: ok" ) ;
1819 return ;
1920 }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use backtrace::Frame;
22use std:: thread;
33
44// Reflects the conditional compilation logic at end of src/symbolize/mod.rs
5- static NOOP : bool = cfg ! ( miri ) ;
5+ static NOOP : bool = false ;
66static DBGHELP : bool = !NOOP
77 && cfg ! ( all(
88 windows,
@@ -31,6 +31,7 @@ static GIMLI_SYMBOLIZE: bool = !NOOP
3131 not( target_vendor = "uwp" ) ,
3232 not( target_os = "emscripten" ) ,
3333 ) ) ;
34+ static MIRI_SYMBOLIZE : bool = cfg ! ( miri) ;
3435
3536#[ test]
3637// FIXME: shouldn't ignore this test on i686-msvc, unsure why it's failing
@@ -158,8 +159,8 @@ fn smoke_test_frames() {
158159 }
159160
160161 let mut resolved = 0 ;
161- let can_resolve = LIBBACKTRACE || GIMLI_SYMBOLIZE ;
162- let can_resolve_cols = GIMLI_SYMBOLIZE ;
162+ let can_resolve = LIBBACKTRACE || GIMLI_SYMBOLIZE || MIRI_SYMBOLIZE ;
163+ let can_resolve_cols = GIMLI_SYMBOLIZE || MIRI_SYMBOLIZE ;
163164
164165 let mut name = None ;
165166 let mut addr = None ;
You can’t perform that action at this time.
0 commit comments