Closed jwinarske closed 1 year ago
Also
Input
pushd frb_codegen
RUST_LOG=debug RUSTFLAGS="-Z sanitizer=memory" cargo run --target x86_64-unknown-linux-gnu --verbose --package flutter_rust_bridge_codegen --bin flutter_rust_bridge_codegen --features "chrono,uuid" -- --rust-input ../frb_example/pure_dart/rust/src/api.rs --dart-output ../frb_example/pure_dart/dart/lib/bridge_generated.dart --dart-decl-output ../frb_example/pure_dart/dart/lib/bridge_definitions.dart --dart-format-line-length 120 --wasm
Output Tail
==636679==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5639015c107c in core::option::Option$LT$T$GT$::map::h38ad6799827d9dcd /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/option.rs:924:9
#1 0x5639015436fa in _$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::hbdf0d5bc577ecc93 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/iter/adapters/map.rs:103:9
#2 0x56390110ba80 in _$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter_nested..SpecFromIterNested$LT$T$C$I$GT$$GT$::from_iter::h0b89e2a67243509f /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/alloc/src/vec/spec_from_iter_nested.rs:26:32
#3 0x563901192c31 in _$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter..SpecFromIter$LT$T$C$I$GT$$GT$::from_iter::h79476d59834e12f1 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/alloc/src/vec/spec_from_iter.rs:33:9
#4 0x5639011844ef in _$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..collect..FromIterator$LT$T$GT$$GT$::from_iter::h4fc6ffd406061e5e /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/alloc/src/vec/mod.rs:2714:9
#5 0x56390155fee1 in core::iter::traits::iterator::Iterator::collect::h01e826217c355cfa /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/iter/traits/iterator.rs:1836:9
#6 0x563901453be7 in _$LT$clap_lex..RawArgs$u20$as$u20$core..convert..From$LT$I$GT$$GT$::from::h1b62d2edcb6806e7 /home/joel/.cargo/registry/src/github.com-1ecc6299db9ec823/clap_lex-0.2.4/src/lib.rs:252:20
#7 0x563901457ac0 in clap_lex::RawArgs::new::h15bd37a9b8bbc9f3 /home/joel/.cargo/registry/src/github.com-1ecc6299db9ec823/clap_lex-0.2.4/src/lib.rs:159:9
#8 0x563901376ede in clap::builder::command::App::try_get_matches_from_mut::h4be4901eee48f906 /home/joel/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.2.22/src/builder/command.rs:685:28
#9 0x5638ff0afcf0 in clap::builder::command::App::get_matches_from::h42775bf325a454cc /home/joel/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.2.22/src/builder/command.rs:600:9
#10 0x5638ff0af719 in clap::builder::command::App::get_matches::hf6df89777d6c8a6e /home/joel/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.2.22/src/builder/command.rs:512:9
#11 0x5638ff0ae6b5 in clap::derive::Parser::parse::hd047da00f7803e2c /home/joel/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.2.22/src/derive.rs:81:27
#12 0x5638ff0ac5a7 in flutter_rust_bridge_codegen::main::h5b09e3c9b76367b1 /b/flutter_rust_bridge/frb_codegen/src/main.rs:12:20
#13 0x5638ff0b034d in core::ops::function::FnOnce::call_once::h143a6cdd3819f127 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/ops/function.rs:251:5
#14 0x5638ff0ac43f in std::sys_common::backtrace::__rust_begin_short_backtrace::hb63e5da4dd063933 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sys_common/backtrace.rs:122:18
#15 0x5638ff0b1988 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h9ef0f70771746cfd /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:166:18
#16 0x5639017511ba in core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnOnce$LT$A$GT$$u20$for$u20$$RF$F$GT$::call_once::hcf0f452e35b42714 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/ops/function.rs:286:13
#17 0x5639017511ba in std::panicking::try::do_call::h9076463b86fc98c2 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:464:40
#18 0x5639017511ba in std::panicking::try::h59a38c38fab81132 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:428:19
#19 0x5639017511ba in std::panic::catch_unwind::h024c7f29e5fae637 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panic.rs:137:14
#20 0x5639017511ba in std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::h1bc9c4aefbf9b583 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:148:48
#21 0x5639017511ba in std::panicking::try::do_call::hf630db2c23823f3c /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:464:40
#22 0x5639017511ba in std::panicking::try::h5c6c892f05382366 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:428:19
#23 0x5639017511ba in std::panic::catch_unwind::h893ebad4c00d9e60 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panic.rs:137:14
#24 0x5639017511ba in std::rt::lang_start_internal::h2fa3ed5bcd048bb3 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:148:20
#25 0x5638ff0b18a5 in std::rt::lang_start::hf7344b111aea32dd /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:165:17
#26 0x5638ff0ae339 in main (/b/flutter_rust_bridge/target/x86_64-unknown-linux-gnu/debug/flutter_rust_bridge_codegen+0x157339) (BuildId: 67518c91c290ea208b4eb403cd01820de649c532)
#27 0x7f15a0bbfb74 in __libc_start_main (/lib64/libc.so.6+0x27b74) (BuildId: 08df60634339b221bb854d4e10b7278cafde70c4)
#28 0x5638ff0459ed in _start (/b/flutter_rust_bridge/target/x86_64-unknown-linux-gnu/debug/flutter_rust_bridge_codegen+0xee9ed) (BuildId: 67518c91c290ea208b4eb403cd01820de649c532)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/option.rs:924:9 in core::option::Option$LT$T$GT$::map::h38ad6799827d9dcd
Exiting
Nice catch! So we have two TODOs now:
Looking forward to PR :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
Describe the bug
RUSTFLAGS="-Z sanitizer=memory" cargo run
Codegen logs with
RUST_LOG=debug
environment variableTo Reproduce
RUSTFLAGS="-Z sanitizer=memory" cargo run
Expected behavior
free of failures
Generated binding code
No response
OS
Linux
Version of
flutter_rust_bridge_codegen
master tip of tree
Flutter info
No response
Version of
clang++
No response
Version of
ffigen
No response
Additional context
No response