File tree 6 files changed +28
-5
lines changed
6 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -192,3 +192,14 @@ jobs:
192
192
- name : Install Rust
193
193
run : rustup update 1.40.0 && rustup default 1.40.0
194
194
- 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 {
13
13
pub filename : Box < [ u8 ] > ,
14
14
pub lineno : u32 ,
15
15
pub colno : u32 ,
16
+ pub fn_ptr : * mut c_void ,
16
17
}
17
18
18
19
#[ derive( Debug , Clone ) ]
@@ -36,7 +37,7 @@ impl Frame {
36
37
}
37
38
38
39
pub fn symbol_address ( & self ) -> * mut c_void {
39
- self . addr
40
+ self . inner . fn_ptr
40
41
}
41
42
42
43
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() {
22
22
!cfg ! ( target_env = "musl" )
23
23
// Skip MinGW on libbacktrace which doesn't have support for DLLs.
24
24
&& !( cfg ! ( windows) && cfg ! ( target_env = "gnu" ) && cfg ! ( feature = "libbacktrace" ) )
25
+ // Skip Miri, since it doesn't support dynamic libraries.
26
+ && !cfg ! ( miri)
25
27
{
26
28
// TODO(#238) this shouldn't have to happen first in this function, but
27
29
// currently it does.
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ fn main() {
13
13
// These run in docker containers on CI where they can't re-exec the test,
14
14
// so just skip these for CI. No other reason this can't run on those
15
15
// 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) {
17
18
println ! ( "test result: ok" ) ;
18
19
return ;
19
20
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use backtrace::Frame;
2
2
use std:: thread;
3
3
4
4
// Reflects the conditional compilation logic at end of src/symbolize/mod.rs
5
- static NOOP : bool = cfg ! ( miri ) ;
5
+ static NOOP : bool = false ;
6
6
static DBGHELP : bool = !NOOP
7
7
&& cfg ! ( all(
8
8
windows,
@@ -31,6 +31,7 @@ static GIMLI_SYMBOLIZE: bool = !NOOP
31
31
not( target_vendor = "uwp" ) ,
32
32
not( target_os = "emscripten" ) ,
33
33
) ) ;
34
+ static MIRI_SYMBOLIZE : bool = cfg ! ( miri) ;
34
35
35
36
#[ test]
36
37
// FIXME: shouldn't ignore this test on i686-msvc, unsure why it's failing
@@ -158,8 +159,8 @@ fn smoke_test_frames() {
158
159
}
159
160
160
161
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 ;
163
164
164
165
let mut name = None ;
165
166
let mut addr = None ;
You can’t perform that action at this time.
0 commit comments