Skip to content

panic info: Must use _os lookups with Arg::allow_invalid_utf8 when executing rust_hero data/. #4

Description

@WenyingXiongwy

env:
OS: x86_64 ubuntu 20.04.3 LTS
rustc: rustc 1.73.0

When I tried to test the ability of the executable binary tool rust_hero using data/error.rs based on the information in the readme, it failed to run and gave the following detailed error message:

/xxx/clap-3.2.25/src/parser/matches/arg_matches.rs:1843:13:
Must use `_os` lookups with `Arg::allow_invalid_utf8`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Here is the call stack information printed by the gdb tool.

(gdb) bt
#0  clap::parser::matches::arg_matches::unwrap_string (value=0x7fff9eacefe0)
    at /home/xxx/clap-3.2.25/src/parser/matches/arg_matches.rs:1840
#1  0x00005555557c6d01 in clap::parser::matches::arg_matches::unwrap_string ()
    at  /home/xxx/clap-3.2.25/clap-3.2.25/src/parser/matches/arg_matches.rs:1839
#2  0x000055555671e0a8 in core::ops::function::FnMut::call_mut<fn(&clap::parser::matches::any_value::AnyValue) -> &str, (&clap::parser::matches::any_value::AnyValue)> () at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ops/function.rs:166
#3  0x0000555556714c3c in core::ops::function::impls::{impl#4}::call_once<(&clap::parser::matches::any_value::AnyValue), fn(&clap::parser::matches::any_value::AnyValue) -> &str> (self=0x7fffffffb150, args=...)
    at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ops/function.rs:305
#4  0x0000555556711e4b in core::option::Option<&clap::parser::matches::any_value::AnyValue>::map<&clap::parser::matches::any_value::AnyValue, &str, &mut fn(&clap::parser::matches::any_value::AnyValue) -> &str> (self=..., f=0x7fffffffb150)
    at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/option.rs:1075
#5  core::iter::adapters::map::{impl#2}::next<&str, core::iter::adapters::flatten::Flatten<core::slice::iter::Iter<alloc::vec::Vec<clap::parser::matches::any_value::AnyValue, alloc::alloc::Global>>>, fn(&clap::parser::matches::any_value::AnyValue) -> &str> (self=0x7fffffffb150)
    at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/iter/adapters/map.rs:103
#6  0x0000555556733eae in clap::parser::matches::arg_matches::{impl#16}::next (self=0x7fffffffb150) at src/parser/matches/arg_matches.rs:1666
#7  0x0000555555735e36 in rust_hero::query::cli::Invocation::from_args (args=...) at src/query/cli.rs:142
#8  0x00005555557232a9 in rust_hero::try_main<&mut std::io::buffered::bufwriter::BufWriter<std::io::stdio::Stdout>> (args=...,
    out=0x7fffffffdbb0) at src/main.rs:35
#9  0x0000555555710316 in rust_hero::main () at src/main.rs:10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions