Skip to content

Allow passing more than one pointer tag to -Zmiri-track-pointer-tag=<tag> #2073

@BennoLossin

Description

@BennoLossin

When I was debugging some UB with miri I felt the need to track more than one pointer tag (one tag was the tag accessed and the other the tag that popped the first tag).
While you can invoke miri twice using the different pointer tags to get the relevant information, it feels clunky and when inspecting intertwined tracking it becomes harder to know what the order was.

While trying to pass -Zmiri-track-pointer-tag={<tag1>, <tag2>} i noticed, that it generates a ICE, because the supplied value is not an u64 and urges you to create a bug report, maybe that error message can be improved.

Stack trace:

thread 'main' panicked at '-Zmiri-track-pointer-tag requires a valid `u64` argument: invalid digit found in string', src/tools/miri/src/bin/miri.rs:404:33
stack backtrace:
   0:     0x7f5fa5c7582d - std::backtrace_rs::backtrace::libunwind::trace::h9d7060c592fe8069
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f5fa5c7582d - std::backtrace_rs::backtrace::trace_unsynchronized::hde51808b1556e5d1
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f5fa5c7582d - std::sys_common::backtrace::_print_fmt::hd954a2d1cd9fdbd5
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f5fa5c7582d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6271b22d4e4423c8
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f5fa5cd0ecc - core::fmt::write::heb1c2a4e59b134a9
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/core/src/fmt/mod.rs:1194:17
   5:     0x7f5fa5c67011 - std::io::Write::write_fmt::h6652729f1feeae87
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/io/mod.rs:1655:15
   6:     0x7f5fa5c78545 - std::sys_common::backtrace::_print::ha9ae153024491f3f
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f5fa5c78545 - std::sys_common::backtrace::print::h110c021885084d6a
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f5fa5c78545 - std::panicking::default_hook::{{closure}}::h68d23f0b88a08886
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panicking.rs:295:22
   9:     0x7f5fa5c781b9 - std::panicking::default_hook::h2e20223d1536191d
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panicking.rs:314:9
  10:     0x7f5fa641a731 - rustc_driver[46ea51695bd673e5]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f5fa5c78d16 - std::panicking::rust_panic_with_hook::hfe1e95a000a88a64
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panicking.rs:702:17
  12:     0x7f5fa5c78b17 - std::panicking::begin_panic_handler::{{closure}}::h04cf82910c0a653e
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panicking.rs:588:13
  13:     0x7f5fa5c75ce4 - std::sys_common::backtrace::__rust_end_short_backtrace::h187f35deeb28abc2
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f5fa5c78849 - rust_begin_unwind
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panicking.rs:584:5
  15:     0x7f5fa5c3dba3 - core::panicking::panic_fmt::h70547f234f37fa30
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/core/src/panicking.rs:142:14
  16:     0x5602e78650fc - miri[e9d79feab6deb45d]::main
  17:     0x5602e7865453 - std[4fdfe6e28689bcfc]::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  18:     0x5602e78654a9 - std[4fdfe6e28689bcfc]::rt::lang_start::<()>::{closure#0}
  19:     0x7f5fa5c5837e - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h0c984104fb3cae58
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/core/src/ops/function.rs:280:13
  20:     0x7f5fa5c5837e - std::panicking::try::do_call::h39ab9d215d710b6e
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panicking.rs:492:40
  21:     0x7f5fa5c5837e - std::panicking::try::haf64e654dff6873d
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panicking.rs:456:19
  22:     0x7f5fa5c5837e - std::panic::catch_unwind::h1bd8527dcd9034a2
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panic.rs:137:14
  23:     0x7f5fa5c5837e - std::rt::lang_start_internal::{{closure}}::h28c118dbad14184e
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/rt.rs:128:48
  24:     0x7f5fa5c5837e - std::panicking::try::do_call::h28bbb2b51fe2e344
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panicking.rs:492:40
  25:     0x7f5fa5c5837e - std::panicking::try::hfef2907b0e11e143
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panicking.rs:456:19
  26:     0x7f5fa5c5837e - std::panic::catch_unwind::h63b62364314b20d6
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/panic.rs:137:14
  27:     0x7f5fa5c5837e - std::rt::lang_start_internal::h6425b2777e1aa52d
                               at /rustc/311e2683e1bad87715b1558f7900e294d24ce491/library/std/src/rt.rs:128:20
  28:     0x5602e7865312 - main
  29:     0x7f5fa58df560 - __libc_start_call_main
  30:     0x7f5fa58df60c - __libc_start_main_impl
  31:     0x5602e786192d - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.62.0-nightly (311e2683e 2022-04-18) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental -Z miri-tag-raw-pointers -Z miri-track-pointer-tag=2505a

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-aliasingArea: This affects the aliasing model (Stacked/Tree Borrows)A-uxArea: This affects the general user experienceC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-first-issueA good way to start contributing, mentoring is available

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions