Accesing fields of struct make the programm crash / random value returned by fields Frida ScriptHandler

Hello there.

is there a way a struct element could not point to the good value even though it is not declared as a & ?

Let me explain : I am using frida and frida require a stuct implementing ScriptHandler to handle message that the script could send. I have a struct with a mpsc::Sender so send message with the actual message but as soon as i try to acces it my program crash. here is a small exemple:


#[derive(Clone)]
struct MyHandler {
    event_sender: Arc<Mutex<mpsc::Sender<String>>>,
    test: String, // I added this string just to try
}

impl MyHandler {
    pub fn new(event_sender: mpsc::Sender<String>) -> Self {
	// I checked event_sender here and it is correct
	Self {
            event_sender: Arc::new(Mutex::new(event_sender)),
            test: "random thing".to_string(),
        };
    }
}

impl ScriptHandler for MyHandler {
    fn on_message(&mut self, message: &Message) {
        println!("In on_message");
        println!("{}", self.test); :: // here the code sometime show me Nothing , sometimes a smiley most of the time nothing
        println!("trying to acces event");
        match Arc::strong_count(&self.event_sender) {
            count if count > 0 => println!("event_sender strong count: {}", count),
            _ => println!("event_sender Arc seems invalid or dropped"),
        } // 
        println!("{:?}", self.event_sender); // program stop here without any message most of the time
    }
}

ScriptHandler is used in the function handle_message here it is :

pub fn handle_message<I: ScriptHandler + 'static>(&mut self, handler: I) -> Result<()> {
        let message = CString::new("message").map_err(|_| Error::CStringFailed)?;
        let mut borrowed_callback_handler = self.callback_handler.borrow_mut();
        (*borrowed_callback_handler).add_handler(handler);
        let user_data =
            (&(*borrowed_callback_handler) as *const _ as *mut CallbackHandler) as *mut c_void;
        unsafe {
            let callback = Some(std::mem::transmute::<
                *mut std::ffi::c_void,
                unsafe extern "C" fn(),
            >(call_on_message::<I> as *mut c_void));

            frida_sys::g_signal_connect_data(
                self.script_ptr as _,
                message.as_ptr(),
                callback,
                user_data,
                None,
                0,
            )
        };

        Ok(())
    }

it is a bit more complicated to understand , i am not sure where the error could come from so i want to share most of the informationn i have.

Which is a more weird is that sometimes my program would print me things like event_sender strong count: 1624879470736 wich is to high. It wouldn't make sense and I dont see anywhere in my code a loops in wich I clone it. another time i had :
println!("{:?}", self.event_sender); => Mutex { data: <locked>, poisoned: true, .. }
So no count and a poisoned mutex. The only time it showed me this it crashed later when i have a self.event_sender.clone()
And some other time i had : event_sender Arc seems invalid or dropped

So the behaviour seems totaly random. The Reason I am pretty sure that the randomness of the number returned by strong count is not due to a problem in my code lopping a copy of the arc is because the value of the string is also random and it's not instanciated here.

It's a realy big message but i wanted to give you all the details that i had to not waste time.
Thank you verry much for reading this.

That is a very common occurrence when you are introducing Undefined Behavior. Run your code under the sanitizers to uncover the bugs.

Hello took me some time to config sanitizer and here is the output of the program:

===============================================================
==9648==ERROR: AddressSanitizer: access-violation on unknown address 0x000000000080 (pc 0x7ff7472dd932 bp 0x000f5ebfcda0 sp 0x000f5ebfcc60 T23)
==9648==The signal is caused by a READ memory access.
==9648==Hint: address points to the zero page.
    #0 0x7ff7472dd931 in core::sync::atomic::atomic_load::h7f6f027565fec644 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\sync\atomic.rs:3342
    #1 0x7ff7472e1396 in core::sync::atomic::AtomicPtr$LT$T$GT$::load::he145f6cfda9e7a18 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\sync\atomic.rs:1443
    #2 0x7ff7472f4d57 in _$LT$tokio..sync..mpsc..list..Tx$LT$T$GT$$u20$as$u20$core..fmt..Debug$GT$::fmt::h1bff782287e48063 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\sync\mpsc\list.rs:235
    #3 0x7ff748ded8e9 in core::fmt::builders::impl$3::field::closure$0 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:133   
    #4 0x7ff748ded8e9 in core::fmt::builders::impl$3::field_with::closure$0 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:162
    #5 0x7ff748ded8e9 in core::result::Result::and_then /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\result.rs:1348
    #6 0x7ff748ded8e9 in core::fmt::builders::DebugStruct::field_with /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:145    
    #7 0x7ff748ded8e9 in core::fmt::builders::DebugStruct::field::hf1af51f6db972582 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:133
    #8 0x7ff7472ef41d in _$LT$tokio..sync..mpsc..chan..Chan$LT$T$C$S$GT$$u20$as$u20$core..fmt..Debug$GT$::fmt::he178a9e98cbce97d C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\sync\mpsc\chan.rs:82
    #9 0x7ff746554431 in _$LT$alloc..sync..Arc$LT$T$C$A$GT$$u20$as$u20$core..fmt..Debug$GT$::fmt::h5a131f2c65f7061c C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\sync.rs:3430
    #10 0x7ff748ded8e9 in core::fmt::builders::impl$3::field::closure$0 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:133  
    #11 0x7ff748ded8e9 in core::fmt::builders::impl$3::field_with::closure$0 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:162
    #12 0x7ff748ded8e9 in core::result::Result::and_then /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\result.rs:1348
    #13 0x7ff748ded8e9 in core::fmt::builders::DebugStruct::field_with /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:145   
    #14 0x7ff748ded8e9 in core::fmt::builders::DebugStruct::field::hf1af51f6db972582 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:133
    #15 0x7ff7472ef275 in _$LT$tokio..sync..mpsc..chan..Tx$LT$T$C$S$GT$$u20$as$u20$core..fmt..Debug$GT$::fmt::h86c79c6139ce5b70 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\sync\mpsc\chan.rs:25
    #16 0x7ff748ded8e9 in core::fmt::builders::impl$3::field::closure$0 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:133  
    #17 0x7ff748ded8e9 in core::fmt::builders::impl$3::field_with::closure$0 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:162
    #18 0x7ff748ded8e9 in core::result::Result::and_then /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\result.rs:1348
    #19 0x7ff748ded8e9 in core::fmt::builders::DebugStruct::field_with /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:145   
    #20 0x7ff748ded8e9 in core::fmt::builders::DebugStruct::field::hf1af51f6db972582 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\builders.rs:133
    #21 0x7ff746543085 in _$LT$tokio..sync..mpsc..bounded..Sender$LT$T$GT$$u20$as$u20$core..fmt..Debug$GT$::fmt::h06ccab65a8786a86 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\sync\mpsc\bounded.rs:1601
    #22 0x7ff74655449e in _$LT$alloc..sync..Arc$LT$T$C$A$GT$$u20$as$u20$core..fmt..Debug$GT$::fmt::h7fc95d99524b03d0 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\sync.rs:3430
    #23 0x7ff748def6a9 in core::fmt::rt::Argument::fmt /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\rt.rs:177
    #24 0x7ff748def6a9 in core::fmt::write::hd09721bccbef5a36 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\mod.rs:1437
    #25 0x7ff748dc4c4a in std::io::Write::write_fmt /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\mod.rs:1887
    #26 0x7ff748dc4c4a in _$LT$$RF$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::haad2e52e4f8128a3 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:792
    #27 0x7ff748dc58f0 in std::io::stdio::impl$15::write_fmt /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:766
    #28 0x7ff748dc58f0 in std::io::stdio::print_to /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:1122
    #29 0x7ff748dc58f0 in std::io::stdio::_print::h394176707872073f /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:1233
    #30 0x7ff74654565a in _$LT$app_lib..hook..MyHandler$u20$as$u20$frida..script..ScriptHandler$GT$::on_message::h10d300c7dc05c530 C:\Programmation\Projets\src-tauri\src\hook.rs:45
    #31 0x7ff7465d7c44 in frida::script::call_on_message::h3a3c1a0eab7c75c8 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\frida-0.15.1\src\script.rs:121
    #32 0x7ff748e66ae1 in g_closure_invoke D:\a\frida\frida\deps\src\glib\gobject\gclosure.c:836
    #33 0x7ff748dfa611 in signal_emit_unlocked_R D:\a\frida\frida\deps\src\glib\gobject\gsignal.c:3800
    #34 0x7ff748df8a59 in g_signal_emit_valist D:\a\frida\frida\deps\src\glib\gobject\gsignal.c:3553
    #35 0x7ff748df8373 in g_signal_emit D:\a\frida\frida\deps\src\glib\gobject\gsignal.c:3610
    #36 0x7ff748e2ceef in frida_session_real_post_messages_co D:\a\frida\frida\build\frida.c:47029
    #37 0x7ff748e42784 in frida_agent_message_sink_post_messages D:\a\frida\frida\build\session.c:14126
    #38 0x7ff748e33d9a in _dbus_frida_agent_message_sink_post_messages D:\a\frida\frida\build\session.c:14356
    #39 0x7ff748e7b078 in call_in_idle_cb D:\a\frida\frida\deps\src\glib\gio\gdbusconnection.c:4998
    #40 0x7ff748e71b2e in g_idle_dispatch D:\a\frida\frida\deps\src\glib\glib\gmain.c:6462
    #41 0x7ff748e731a4 in g_main_dispatch D:\a\frida\frida\deps\src\glib\glib\gmain.c:3557
    #42 0x7ff748e7238f in g_main_context_dispatch D:\a\frida\frida\deps\src\glib\glib\gmain.c:4281
    #43 0x7ff748e726b6 in g_main_context_iterate D:\a\frida\frida\deps\src\glib\glib\gmain.c:4357
    #44 0x7ff748e7339e in g_main_loop_run D:\a\frida\frida\deps\src\glib\glib\gmain.c:4557
    #45 0x7ff748dff013 in run_main_loop D:\a\frida\frida\subprojects\frida-core\src\frida-glue.c:159
    #46 0x7ff748e7189c in g_thread_proxy D:\a\frida\frida\deps\src\glib\glib\gthread.c:1055
    #47 0x7ff748e5e48a in g_thread_win32_proxy D:\a\frida\frida\deps\src\glib\glib\gthread-win32.c:494
    #48 0x7ffe0c089332  (C:\Windows\System32\ucrtbase.dll+0x180029332)
    #49 0x7ffd0a9ade2d in asan_thread_start D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:170
    #50 0x7ffe0e03259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #51 0x7ffe0ed6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: access-violation C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\sync\atomic.rs:3342 in core::sync::atomic::atomic_load::h7f6f027565fec644
Thread T23 created by T0 here:
    #0 0x7ffd0a9ae237 in CreateThread D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:223
    #1 0x7ffe0c0883ad  (C:\Windows\System32\ucrtbase.dll+0x1800283ad)
    #2 0x7ff748e5e016 in g_system_thread_new D:\a\frida\frida\deps\src\glib\glib\gthread-win32.c:539
    #3 0x7ff748e716c6 in g_thread_new_internal D:\a\frida\frida\deps\src\glib\glib\gthread.c:1162
    #4 0x7ff748e71667 in g_thread_new D:\a\frida\frida\deps\src\glib\glib\gthread.c:1112
    #5 0x7ff748dfeef8 in frida_init_with_runtime D:\a\frida\frida\subprojects\frida-core\src\frida-glue.c:47
    #6 0x7ff747b61b18 in frida::Frida::obtain::h1c8de11d8b6a5b03 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\frida-0.15.1\src\lib.rs:51
    #7 0x7ff746547068 in app_lib::hook::hook::new::h56853ddd2bba7a67 C:\Programmation\Projets\src-tauri\src\hook.rs:136
    #8 0x7ff746304d45 in app_lib::bot::Bot::new::h1454caf71fd5fbb8 C:\Programmation\Projets\src-tauri\src\bot.rs:21
    #9 0x7ff746301d91 in app_lib::run::hb45281bcd6215cd9 C:\Programmation\Projets\src-tauri\src\lib.rs:15
    #10 0x7ff746301048 in app_lib::main C:\Programmation\Projets\src-tauri\src\main.rs:5
    #11 0x7ff74630129a in core::ops::function::FnOnce::call_once::hdf3489fdcfff43ad C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #12 0x7ff74630100d in std::sys::backtrace::__rust_begin_short_backtrace::hccf684203473f78a C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:152
    #13 0x7ff746301563 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h519e6d06634b26f5 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:195
    #14 0x7ff748dbfadb in core::ops::function::impls::impl$2::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\ops\function.rs:284  
    #15 0x7ff748dbfadb in std::panicking::try::do_call /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:573
    #16 0x7ff748dbfadb in std::panicking::try /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:536
    #17 0x7ff748dbfadb in std::panic::catch_unwind /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panic.rs:358
    #18 0x7ff748dbfadb in std::rt::lang_start_internal::closure$1 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\rt.rs:174
    #19 0x7ff748dbfadb in std::panicking::try::do_call /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:573
    #20 0x7ff748dbfadb in std::panicking::try /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:536
    #21 0x7ff748dbfadb in std::panic::catch_unwind /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panic.rs:358
    #22 0x7ff748dbfadb in std::rt::lang_start_internal::h9709fc44ae8f04d9 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\rt.rs:174
    #23 0x7ff7463013e9 in std::rt::lang_start::h1f1d1d8c1fd35049 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:194
    #24 0x7ff746301068 in main (C:\Programmation\Projets\src-tauri\target\x86_64-pc-windows-msvc\debug\app.exe+0x140001068)
    #25 0x7ff7493d33bf in invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
    #26 0x7ff7493d33bf in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    #27 0x7ffe0e03259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #28 0x7ffe0ed6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

==9648==ABORTING

So if i understand correctly there is an issue with where my pointer is aiming or something similar but have no clue of why it happens

Don't forget that you need to build the native libraries (like glib) with asan, too. Otherwise, anything they do out of the ordinary will not be detected.

Hello.

It took me some times but i managed to build glib with asan with meson setup build --buildtype=debug --prefix=C:\glib-install -Db_sanitize=address

Unfortunately I dont know how to make my program use it.

Firstly i did remove my target = "x86_64-pc-windows-msvc" from config.toml but my program took one hour to compile and it didn't show anything more.

Then i changed add the path to my compiled glib on the top of all paths but it didn't change anything either.

One more strange thing is the path of glib in the stacktrace D:\a\frida\frida\deps\src\glib I dont have D:

I changed my code from

 self.connection= Some(
            ConnectionBuilder {
                session: session,
                script_builder: |session| {
                    let mut script = session
                        .create_script(&self.script, &mut ScriptOption::new())
                        .unwrap();
                    let script_handler = self.script_handler.clone();
                    let _ = script.handle_message(script_handler);
                    script
                },
            }
            .build(),
        );
        
               let result = self
                   .connection
                   .as_mut()
                   .unwrap()
                   .with_mut(|connection| {
                       let result = connection.script.load();
                       match result {
                           Ok(_) => Ok::<bool, Box<dyn Error>>(true),
                           Err(e) => {
                               log::error!("Error loading script: {}", e);
                               Ok(false)
                           }
                       }
                   });
        */

To :

self.connection= Some(
            ConnectionBuilder {
                session: session,
                script_builder: |session| {
                    let mut script = session
                        .create_script(&self.script, &mut ScriptOption::new())
                        .unwrap();
                    let script_handler = self.script_handler.clone();
                    let _ = script.handle_message(script_handler);
                    let _ = script.load();
                    script
                },
            }
            .build(),
        );

and my error is now :

==33712==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x12bbeefa2a20 at pc 0x7ff68a626517 bp 0x00bac32f98e0 sp 0x00bac32f98e8
WRITE of size 8 at 0x12bbeefa2a20 thread T9
    #0 0x7ff68a626516 in core::ptr::write C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:1578
    #1 0x7ff68a626516 in core::ptr::mut_ptr::impl$0::write C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mut_ptr.rs:1480
    #2 0x7ff68a626516 in tokio::util::linked_list::Pointers$LT$T$GT$::set_prev::h4b401415f44a9ed4 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\util\linked_list.rs:445
    #3 0x7ff68a61df15 in tokio::util::linked_list::LinkedList$LT$L$C$$LT$L$u20$as$u20$tokio..util..linked_list..Link$GT$..Target$GT$::push_front::h45b5ba3cea2c028b C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\util\linked_list.rs:129
    #4 0x7ff68a5acfd4 in tokio::sync::batch_semaphore::Semaphore::poll_acquire C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\sync\batch_semaphore.rs:516
    #5 0x7ff68a5ae1bc in _$LT$tokio..sync..batch_semaphore..Acquire$u20$as$u20$core..future..future..Future$GT$::poll::hf3d5107ae50aa734 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\sync\batch_semaphore.rs:600
    #6 0x7ff68881cc39 in tokio::sync::mpsc::bounded::Sender$LT$T$GT$::reserve_inner::_$u7b$$u7b$closure$u7d$$u7d$::h9decb0ed27f3e23f C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\sync\mpsc\bounded.rs:1263
    #7 0x7ff688820a1c in tokio::sync::mpsc::bounded::Sender$LT$T$GT$::reserve::_$u7b$$u7b$closure$u7d$$u7d$::h5f2cf5447e159faa C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\sync\mpsc\bounded.rs:1108
    #8 0x7ff68881ed86 in tokio::sync::mpsc::bounded::Sender$LT$T$GT$::send::_$u7b$$u7b$closure$u7d$$u7d$::hff824513a88b855a C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\sync\mpsc\bounded.rs:818
    #9 0x7ff689748193 in _$LT$bot_lib..hook..MyHandler$u20$as$u20$frida..script..ScriptHandler$GT$::on_message::_$u7b$$u7b$closure$u7d$$u7d$::hd04e47a9666710d0 C:\Programmation\Projets\src-tauri\src\hook.rs:99
    #10 0x7ff6892972ca in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::_$u7b$$u7b$closure$u7d$$u7d$::h32ab604b62db20c6 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\core.rs:331
    #11 0x7ff68928abd8 in tokio::loom::std::unsafe_cell::UnsafeCell<enum2$<tokio::runtime::task::core::Stage<enum2$<bot_lib::hook::impl$1::on_message::async_block_env$1> > > >::with_mut C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\loom\std\unsafe_cell.rs:16
    #12 0x7ff68928abd8 in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::he0ce351261aee68f C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\core.rs:320
    #13 0x7ff6893ad852 in tokio::runtime::task::harness::poll_future::_$u7b$$u7b$closure$u7d$$u7d$::hb80b2c0fb49b525c C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:499
    #14 0x7ff6898c737d in _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h9e30194fe2c3dd00 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panic\unwind_safe.rs:272   
    #15 0x7ff68912eb4a in std::panicking::try::do_call::hc507d5a4783fb70b C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:573
    #16 0x7ff6899cf8f2 in std::panic::catch_unwind::hfffeae1afef6548a (C:\Programmation\Projets\src-tauri\target\x86_64-pc-windows-msvc\debug\app.exe+0x1413ef8f2)
    #17 0x7ff6899aa85a in std::panicking::try C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:536
    #18 0x7ff6899aa85a in std::panic::catch_unwind::hc8dc03112c39d6c9 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:358
    #19 0x7ff68934b132 in tokio::runtime::task::harness::poll_future::h4577e137fe7884fb C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:487
    #20 0x7ff6893f1c66 in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll_inner::hebbdafb78d6a7d76 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:209
    #21 0x7ff689461757 in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll::h512cccf103adf3d9 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:154
    #22 0x7ff6898e41fa in tokio::runtime::task::raw::poll::hbb85311e214939fb C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\raw.rs:271
    #23 0x7ff68a5c7194 in tokio::runtime::task::raw::RawTask::poll::ha35143424d885831 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\raw.rs:201
    #24 0x7ff68a59ea91 in tokio::runtime::task::LocalNotified$LT$S$GT$::run::hec9dc747577ca5ec C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\mod.rs:435
    #25 0x7ff68a6095e9 in tokio::runtime::scheduler::multi_thread::worker::impl$1::run_task::closure$0 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\scheduler\multi_thread\worker.rs:596
    #26 0x7ff68a608c89 in tokio::runtime::coop::with_budget C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\coop.rs:107
    #27 0x7ff68a608c89 in tokio::runtime::coop::budget C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\coop.rs:73
    #28 0x7ff68a608c89 in tokio::runtime::scheduler::multi_thread::worker::Context::run_task C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\scheduler\multi_thread\worker.rs:595
    #29 0x7ff68a607c21 in tokio::runtime::scheduler::multi_thread::worker::Context::run C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\scheduler\multi_thread\worker.rs:546
    #30 0x7ff68a6074d1 in tokio::runtime::scheduler::multi_thread::worker::run::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h9d8e811d4a648250 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\scheduler\multi_thread\worker.rs:511
    #31 0x7ff68a658d87 in tokio::runtime::context::scoped::Scoped$LT$T$GT$::set::h231c85fa35aeac14 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\context\scoped.rs:40
    #32 0x7ff68a58eb5b in tokio::runtime::context::set_scheduler::_$u7b$$u7b$closure$u7d$$u7d$::h8d75ede320cb0fe2 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\context.rs:180
    #33 0x7ff68a63283f in std::thread::local::LocalKey$LT$T$GT$::try_with::h8dd4cc824f07e657 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\local.rs:308
    #34 0x7ff68a6313cd in std::thread::local::LocalKey$LT$T$GT$::with::he0e4f21dec9bcb27 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\local.rs:272
    #35 0x7ff68a58ea1a in tokio::runtime::context::set_scheduler::h62c89ef698ace45b C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\context.rs:180
    #36 0x7ff68a607022 in tokio::runtime::scheduler::multi_thread::worker::run::_$u7b$$u7b$closure$u7d$$u7d$::h9a85b7cbc89d7d5f C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\scheduler\multi_thread\worker.rs:506
    #37 0x7ff68a658059 in tokio::runtime::context::runtime::enter_runtime::h099d88ff91e6633d C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\context\runtime.rs:65
    #38 0x7ff68a6066c1 in tokio::runtime::scheduler::multi_thread::worker::run::h00cd13aea5322caa C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\scheduler\multi_thread\worker.rs:498
    #39 0x7ff68a60611d in tokio::runtime::scheduler::multi_thread::worker::Launch::launch::_$u7b$$u7b$closure$u7d$$u7d$::hfd064d501a358673 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\scheduler\multi_thread\worker.rs:464
    #40 0x7ff68a59f37e in _$LT$tokio..runtime..blocking..task..BlockingTask$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h3a71000b9a3b6efb C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\blocking\task.rs:42
    #41 0x7ff68a64088a in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::_$u7b$$u7b$closure$u7d$$u7d$::h419603c1e464af68 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\core.rs:331
    #42 0x7ff68a6401c8 in tokio::loom::std::unsafe_cell::UnsafeCell<enum2$<tokio::runtime::task::core::Stage<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::impl$0::launch::closure_env$0> > > >::with_mut C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\loom\std\unsafe_cell.rs:16
    #43 0x7ff68a6401c8 in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::h2dbed2828a3ed229 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\core.rs:320
    #44 0x7ff68a649272 in tokio::runtime::task::harness::poll_future::_$u7b$$u7b$closure$u7d$$u7d$::h7bfb1056f829fb51 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:499
    #45 0x7ff68a5950fd in _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h0f5cc45250698405 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panic\unwind_safe.rs:272   
    #46 0x7ff68a5a1e9a in std::panicking::try::do_call::hd5113f312873483c C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:573
    #47 0x7ff68a5b5cc2 in _$LT$tokio..util..metric_atomics..MetricAtomicUsize$u20$as$u20$core..default..Default$GT$::default::hd230a38923d1c81c (C:\Programmation\Projets\src-tauri\target\x86_64-pc-windows-msvc\debug\app.exe+0x141fd5cc2)
    #48 0x7ff68a5b0dca in std::panicking::try C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:536
    #49 0x7ff68a5b0dca in std::panic::catch_unwind::h7868fc30f8877685 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:358
    #50 0x7ff68a6487d2 in tokio::runtime::task::harness::poll_future::ha3e4686b9958fcd1 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:487
    #51 0x7ff68a644db6 in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll_inner::ha75e372bc7174df9 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:209
    #52 0x7ff68a644727 in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll::hbd711ecef23c5704 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:154
    #53 0x7ff68a5c7e8a in tokio::runtime::task::raw::poll::h2779a45f24a8ed5d C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\raw.rs:271
    #54 0x7ff68a5c7194 in tokio::runtime::task::raw::RawTask::poll::ha35143424d885831 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\raw.rs:201
    #55 0x7ff68a59edd7 in tokio::runtime::task::UnownedTask$LT$S$GT$::run::h5767224e3352bd41 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\mod.rs:472
    #56 0x7ff68a65dd44 in tokio::runtime::blocking::pool::Task::run C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\blocking\pool.rs:161
    #57 0x7ff68a664e07 in tokio::runtime::blocking::pool::Inner::run C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\blocking\pool.rs:511
    #58 0x7ff68a6646a3 in tokio::runtime::blocking::pool::Spawner::spawn_thread::_$u7b$$u7b$closure$u7d$$u7d$::h37bbfe1eae513775 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\blocking\pool.rs:469
    #59 0x7ff68a64a0d8 in std::sys::backtrace::__rust_begin_short_backtrace::h7f3f023805e417a8 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:152
    #60 0x7ff68a61742f in std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h0a2cb74a4d9ffd08 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:561
    #61 0x7ff68a5954e2 in _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::hdd78ad87aaa6cd8c C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panic\unwind_safe.rs:272   
    #62 0x7ff68a5a20f6 in std::panicking::try::do_call::hfd94862dca8ccd01 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:573
    #63 0x7ff68a630992 in tokio::util::linked_list::GuardedLinkedList$LT$L$C$$LT$L$u20$as$u20$tokio..util..linked_list..Link$GT$..Target$GT$::pop_back::h2476c1c902088c87 (C:\Programmation\Projets\src-tauri\target\x86_64-pc-windows-msvc\debug\app.exe+0x142050992)
    #64 0x7ff68a616bc9 in std::panicking::try C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:536
    #65 0x7ff68a616bc9 in std::panic::catch_unwind C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:358
    #66 0x7ff68a616bc9 in std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::h30b61e1d1e8b09f6 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:559
    #67 0x7ff68a56441d in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h3ac9296825655652 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #68 0x7ff68b0b786c in alloc::boxed::impl$28::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\alloc\src\boxed.rs:1970
    #69 0x7ff68b0b786c in alloc::boxed::impl$28::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\alloc\src\boxed.rs:1970
    #70 0x7ff68b0b786c in std::sys::pal::windows::thread::impl$0::new::thread_start /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\sys\pal\windows\thread.rs:55
    #71 0x7ffd51c8de2d in asan_thread_start D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:170
    #72 0x7ffe5758259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #73 0x7ffe58c6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

0x12bbeefa2a20 is located 12 bytes after 4-byte region [0x12bbeefa2a10,0x12bbeefa2a14)
freed by thread T0 here:
    #0 0x7ffd51c7c104 in RtlFreeHeap D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_malloc_win.cpp:1778
    #1 0x7ff68b061371 in core::ptr::non_null::NonNull<u8>::as_ptr C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\alloc.rs:119
    #2 0x7ff68b061371 in alloc::alloc::impl$1::deallocate C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\alloc.rs:272
    #3 0x7ff68b05f68b in alloc::raw_vec::RawVecInner$LT$A$GT$::deallocate::h991761420b71a155 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec.rs:751
    #4 0x7ff68b061636 in _$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::h045b69af0d46ebb6 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec.rs:404
    #5 0x7ff68b05b58d in core::ptr::drop_in_place$LT$alloc..raw_vec..RawVec$LT$u8$GT$$GT$::hfd71cba1d12d8db2 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:521
    #6 0x7ff68b05b549 in core::ptr::drop_in_place$LT$alloc..vec..Vec$LT$u8$GT$$GT$::h2708c6aaa48724f0 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:521
    #7 0x7ff68b0599e1 in core::ptr::drop_in_place$LT$alloc..borrow..Cow$LT$$u5b$u8$u5d$$GT$$GT$::h3806ef2d4ff33dd1 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:521
    #8 0x7ff6887cbbed in core::ptr::drop_in_place$LT$http..response..Response$LT$alloc..borrow..Cow$LT$$u5b$u8$u5d$$GT$$GT$$GT$::hb801b1efe80e9b8b C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:521
    #9 0x7ff688770db0 in core::ptr::drop_in_place$LT$wry..webview2..InnerWebView..attach_custom_protocol_handler..$u7b$$u7b$closure$u7d$$u7d$..$u7b$$u7b$closure$u7d$$u7d$..$u7b$$u7b$closure$u7d$$u7d$$GT$::h9a662bee3e587e69 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:521
    #10 0x7ff68a2aa9ed in core::ptr::drop_in_place$LT$alloc..boxed..Box$LT$dyn$u20$core..ops..function..FnMut$LT$$LP$$RP$$GT$$u2b$Output$u20$$u3d$$u20$$LP$$RP$$GT$$GT$::h0f38e0a154165958 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:521
    #11 0x7ff68a2aad76 in core::ptr::drop_in_place$LT$alloc..boxed..Box$LT$alloc..boxed..Box$LT$dyn$u20$core..ops..function..FnMut$LT$$LP$$RP$$GT$$u2b$Output$u20$$u3d$$u20$$LP$$RP$$GT$$GT$$GT$::hf964bd2472793fb8 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:521
    #12 0x7ff68a2bc908 in wry::webview2::InnerWebView::main_thread_dispatcher_proc C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wry-0.47.2\src\webview2\mod.rs:1063
    #13 0x7ffe4a738001  (C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4541_none_2710d1c57384c085\comctl32.dll+0x171a18001)
    #14 0x7ffe4a737de6  (C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4541_none_2710d1c57384c085\comctl32.dll+0x171a17de6)
    #15 0x7ffe57ed83f0  (C:\Windows\System32\USER32.dll+0x1800183f0)
    #16 0x7ffe57ed7eb0  (C:\Windows\System32\USER32.dll+0x180017eb0)
    #17 0x7ff6896883be in windows::Win32::UI::WindowsAndMessaging::DispatchMessageW::h62115de9621d2c70 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.58.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs:772
    #18 0x7ff68957239d in tao::platform_impl::platform::event_loop::EventLoop$LT$T$GT$::run_return::hccf6abcc13875c08 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tao-0.30.8\src\platform_impl\windows\event_loop.rs:259
    #19 0x7ff6895739ca in tao::platform_impl::platform::event_loop::EventLoop$LT$T$GT$::run::ha97bf41d96fb5bc1 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tao-0.30.8\src\platform_impl\windows\event_loop.rs:221
    #20 0x7ff68930bc05 in tao::event_loop::EventLoop$LT$T$GT$::run::hcfd7a4f6b24db1b7 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tao-0.30.8\src\event_loop.rs:215
    #21 0x7ff68895c122 in _$LT$tauri_runtime_wry..Wry$LT$T$GT$$u20$as$u20$tauri_runtime..Runtime$LT$T$GT$$GT$::run::h4f5cf7ec4e4a9714 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-runtime-wry-2.2.0\src\lib.rs:2812
    #22 0x7ff688686d04 in tauri::app::App$LT$R$GT$::run::h17dc33007c786352 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src\app.rs:1146
    #23 0x7ff6886888f5 in tauri::app::Builder$LT$R$GT$::run::h5157b615ceffabe8 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src\app.rs:2069
    #24 0x7ff6885e2749 in bot_lib::run::hb45281bcd6215cd9 C:\Programmation\Projets\src-tauri\src\lib.rs:17
    #25 0x7ff6885e1048 in app::main C:\Programmation\Projets\src-tauri\src\main.rs:5
    #26 0x7ff6885e129a in core::ops::function::FnOnce::call_once::hdf3489fdcfff43ad C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #27 0x7ff6885e100d in std::sys::backtrace::__rust_begin_short_backtrace::hccf684203473f78a C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:152
    #28 0x7ff6885e1563 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h519e6d06634b26f5 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:195

previously allocated by thread T9 here:
    #0 0x7ffd51c7b888 in RtlAllocateHeap D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_malloc_win.cpp:1616
    #1 0x7ff68af45949 in alloc::alloc::alloc C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\alloc.rs:99
    #2 0x7ff68af45c30 in alloc::alloc::Global::alloc_impl C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\alloc.rs:195
    #3 0x7ff68af478bc in _$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::h1b83641320bb425c C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\alloc.rs:257
    #4 0x7ff68af55e70 in alloc::raw_vec::RawVecInner$LT$A$GT$::try_allocate_in::hb8a03cd46fd57cf2 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec.rs:474
    #5 0x7ff68af56a62 in alloc::raw_vec::RawVecInner$LT$A$GT$::with_capacity_in::h49936f2bd63ea331 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec.rs:420
    #6 0x7ff68af4c530 in alloc::raw_vec::RawVec<u8,alloc::alloc::Global>::with_capacity_in C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec.rs:192
    #7 0x7ff68af4c530 in alloc::vec::Vec<u8,alloc::alloc::Global>::with_capacity_in C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\vec\mod.rs:803
    #8 0x7ff68af4c530 in _$LT$T$u20$as$u20$alloc..slice..hack..ConvertVec$GT$::to_vec::ha20bc976cb106044 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\slice.rs:159
    #9 0x7ff68af46c2a in alloc::slice::hack::to_vec C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\slice.rs:108
    #10 0x7ff68af46c2a in alloc::slice::impl$0::to_vec_in C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\slice.rs:502
    #11 0x7ff68af46c2a in alloc::slice::_$LT$impl$u20$$u5b$T$u5d$$GT$::to_vec::h47b1c91d9c41fac8 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\slice.rs:477
    #12 0x7ff688a8f308 in tauri::ipc::protocol::get::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hbbe9d1d61344849a C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src\ipc\protocol.rs:116
    #13 0x7ff6886f0cd9 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::he723a69c1d422d91 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #14 0x7ff68889bae3 in _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h066e0d686ae63d69 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\boxed.rs:1970
    #15 0x7ff688f78dc3 in tauri::webview::Webview$LT$R$GT$::on_message::_$u7b$$u7b$closure$u7d$$u7d$::hac00441e07a67069 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src\webview\mod.rs:1316
    #16 0x7ff6886ec399 in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h0899b857ebcb6d15 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #17 0x7ff68889bae3 in _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h066e0d686ae63d69 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\boxed.rs:1970
    #18 0x7ff688ab1513 in tauri::ipc::InvokeResolver$LT$R$GT$::return_result::h31d5ce57e49a5203 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src\ipc\mod.rs:452
    #19 0x7ff688b0b85a in tauri::ipc::InvokeResolver$LT$R$GT$::respond_async_serialized::_$u7b$$u7b$closure$u7d$$u7d$::h85fe7ee9f43e1242 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src\ipc\mod.rs:347
    #20 0x7ff68991c3fe in _$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h7b59f7fd95b9eed0 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\future\future.rs:124
    #21 0x7ff6892a246a in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::_$u7b$$u7b$closure$u7d$$u7d$::h602efc26fe3613fb C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\core.rs:331
    #22 0x7ff6892778b8 in tokio::loom::std::unsafe_cell::UnsafeCell<enum2$<tokio::runtime::task::core::Stage<core::pin::Pin<alloc::boxed::Box<enum2$<tauri::ipc::impl$20::respond_async_serialized::async_block_env$0<tauri_runtime_wry::Wry<enum2$<tauri::EventLoopMessage> >,enum2$<bot_lib::run::closure$0::async_block_env$1> > >,alloc::alloc::Global> > > > >::with_mut C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\loom\std\unsafe_cell.rs:16
    #23 0x7ff6892778b8 in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::h52e3930cbb003eee C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\core.rs:320
    #24 0x7ff68939c062 in tokio::runtime::task::harness::poll_future::_$u7b$$u7b$closure$u7d$$u7d$::h69a51191e39a0d53 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:499
    #25 0x7ff6898c277d in _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h80fdc522c9324dcb C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panic\unwind_safe.rs:272   
    #26 0x7ff68912c4ca in std::panicking::try::do_call::hbf2c9313053c6f6e C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:573
    #27 0x7ff6899cf8f2 in std::panic::catch_unwind::hfffeae1afef6548a (C:\Programmation\Projets\src-tauri\target\x86_64-pc-windows-msvc\debug\app.exe+0x1413ef8f2)
    #28 0x7ff68996002a in std::panicking::try C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:536
    #29 0x7ff68996002a in std::panic::catch_unwind::h50298afc85bd5c0b C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:358
    #30 0x7ff68937e4d2 in tokio::runtime::task::harness::poll_future::hf9e0668ac0864886 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:487
    #31 0x7ff6893d8da6 in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll_inner::h8463b8e42d87d0c4 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:209
    #32 0x7ff68945ac77 in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll::h0cb34d7453e1e125 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\harness.rs:154
    #33 0x7ff6898e2a8a in tokio::runtime::task::raw::poll::h2d73a975a706c2df C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\task\raw.rs:271
Thread T9 created by T0 here:
    #0 0x7ffd51c8e237 in CreateThread D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:223
    #1 0x7ff68b0b7700 in std::sys::pal::windows::thread::Thread::new::h017280e5c552294c /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\sys\pal\windows\thread.rs:30
    #2 0x7ff68a61598b in std::thread::Builder::spawn_unchecked_::heeec9bef18565698 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:600
    #3 0x7ff68a614b5b in std::thread::Builder::spawn_unchecked::hc1a96fdd8222efc7 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:467
    #4 0x7ff68a617bf0 in std::thread::Builder::spawn::h86514c6ec028c930 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:400
    #5 0x7ff68a66411f in tokio::runtime::blocking::pool::Spawner::spawn_thread C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\blocking\pool.rs:466
    #6 0x7ff68a662e7f in tokio::runtime::blocking::pool::Spawner::spawn_task::ha80a793f4ea4520b C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\blocking\pool.rs:416
    #7 0x7ff68a66207c in tokio::runtime::blocking::pool::Spawner::spawn_blocking_inner::hbd32b95fe6379fbd C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\blocking\pool.rs:384
    #8 0x7ff68a660366 in tokio::runtime::blocking::pool::Spawner::spawn_blocking::h835ad3828404a3e9 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\blocking\pool.rs:312
    #9 0x7ff68a5aa9e4 in tokio::runtime::handle::Handle::spawn_blocking::ha4e614d95ed91b93 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\handle.rs:226
    #10 0x7ff68a65def6 in tokio::runtime::blocking::pool::spawn_blocking::h6014220d2f1719b5 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\blocking\pool.rs:185
    #11 0x7ff68a605ef4 in tokio::runtime::scheduler::multi_thread::worker::Launch::launch::hd35d8c3c787e4ecd C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\scheduler\multi_thread\worker.rs:464
    #12 0x7ff68a63d798 in tokio::runtime::builder::Builder::build_threaded_runtime C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\builder.rs:1556
    #13 0x7ff68a63a42c in tokio::runtime::builder::Builder::build::h116d7da32b05f369 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\builder.rs:814
    #14 0x7ff68a5f61b0 in tokio::runtime::runtime::Runtime::new::h776a69a9f593f1cc C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.42.0\src\runtime\runtime.rs:185
    #15 0x7ff68a05ef22 in tauri::async_runtime::default_runtime::h652a78dc0853e361 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src\async_runtime.rs:214
    #16 0x7ff689f6bb20 in core::ops::function::FnOnce::call_once::hc510d127ae0e1241 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #17 0x7ff68a063a19 in std::sync::once_lock::OnceLock$LT$T$GT$::get_or_init::_$u7b$$u7b$closure$u7d$$u7d$::ha28d26c9184efbd0 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sync\once_lock.rs:304
    #18 0x7ff68a0637b8 in std::sync::once_lock::OnceLock$LT$T$GT$::initialize::_$u7b$$u7b$closure$u7d$$u7d$::he0226f587a4aca44 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sync\once_lock.rs:512
    #19 0x7ff68a0e539c in std::sync::once::Once::call_once_force::_$u7b$$u7b$closure$u7d$$u7d$::hd8c7ce1efede7afe C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sync\once.rs:217
    #20 0x7ff68b6b1e4e in std::sys::sync::once::futex::Once::call::ha129f5d96117fd0c /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\sys\sync\once\futex.rs:176
    #21 0x7ff68a0e5070 in std::sync::once::Once::call_once_force::h4d91e976c4d0610c C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sync\once.rs:217
    #22 0x7ff68a063631 in std::sync::once_lock::OnceLock$LT$T$GT$::initialize::h7a947509adf57d81 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sync\once_lock.rs:511
    #23 0x7ff68a063b52 in std::sync::once_lock::OnceLock$LT$T$GT$::get_or_try_init::hc4d55c2afe298f18 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sync\once_lock.rs:390
    #24 0x7ff68a0638fd in std::sync::once_lock::OnceLock$LT$T$GT$::get_or_init::h5f396a1ae361c669 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sync\once_lock.rs:304
    #25 0x7ff68885f246 in tauri::async_runtime::spawn::h870df44b8c9b8009 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src\async_runtime.rs:273
    #26 0x7ff6888244ae in bot_lib::proxy::Proxy::start::h5369cd15aa0eb82b C:\Programmation\Projets\src-tauri\src\proxy.rs:47
    #27 0x7ff688823fcd in bot_lib::proxy::Proxy::new::hd446c8def9967070 C:\Programmation\Projets\src-tauri\src\proxy.rs:42
    #28 0x7ff6885e4cde in bot_lib::bot::Bot::new::h1454caf71fd5fbb8 C:\Programmation\Projets\src-tauri\src\bot.rs:18
    #29 0x7ff6885e1daf in bot_lib::run::hb45281bcd6215cd9 C:\Programmation\Projets\src-tauri\src\lib.rs:16
    #30 0x7ff6885e1048 in app::main C:\Programmation\Projets\src-tauri\src\main.rs:5
    #31 0x7ff6885e129a in core::ops::function::FnOnce::call_once::hdf3489fdcfff43ad C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #32 0x7ff6885e100d in std::sys::backtrace::__rust_begin_short_backtrace::hccf684203473f78a C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:152
    #33 0x7ff6885e1563 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h519e6d06634b26f5 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:195
    #34 0x7ff68b09cadb in core::ops::function::impls::impl$2::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\ops\function.rs:284
    #35 0x7ff68b09cadb in std::panicking::try::do_call /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:573
    #36 0x7ff68b09cadb in std::panicking::try /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:536
    #37 0x7ff68b09cadb in std::panic::catch_unwind /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panic.rs:358
    #38 0x7ff68b09cadb in std::rt::lang_start_internal::closure$1 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\rt.rs:174
    #39 0x7ff68b09cadb in std::panicking::try::do_call /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:573
    #40 0x7ff68b09cadb in std::panicking::try /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:536
    #41 0x7ff68b09cadb in std::panic::catch_unwind /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panic.rs:358
    #42 0x7ff68b09cadb in std::rt::lang_start_internal::h9709fc44ae8f04d9 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\rt.rs:174    
    #43 0x7ff6885e13e9 in std::rt::lang_start::h1f1d1d8c1fd35049 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:194
    #44 0x7ff6885e1068 in main (C:\Programmation\Projets\src-tauri\target\x86_64-pc-windows-msvc\debug\app.exe+0x140001068)
    #45 0x7ff68b6b03bf in invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
    #46 0x7ff68b6b03bf in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    #47 0x7ffe5758259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #48 0x7ffe58c6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

SUMMARY: AddressSanitizer: heap-buffer-overflow C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:1578 in core::ptr::write
Shadow bytes around the buggy address:
  0x12bbeefa2780: fa fa 00 fa fa fa 00 00 fa fa 00 00 fa fa fd fa
  0x12bbeefa2800: fa fa 00 00 fa fa 00 00 fa fa 00 fa fa fa 00 00
  0x12bbeefa2880: fa fa 00 00 fa fa fd fa fa fa fd fd fa fa fd fa
  0x12bbeefa2900: fa fa fd fa fa fa fd fd fa fa fd fd fa fa fd fd
  0x12bbeefa2980: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fd
=>0x12bbeefa2a00: fa fa fd fa[fa]fa fd fa fa fa fd fd fa fa fd fd
  0x12bbeefa2a80: fa fa fd fd fa fa fa fa fa fa fa fa fa fa fa fa
  0x12bbeefa2b00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x12bbeefa2b80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x12bbeefa2c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x12bbeefa2c80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Stack after return:      f5
  Stack after return:      f5
  Stack after return:      f5
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Stack after return:      f5
  Stack use after scope:   f8
  Stack after return:      f5
  Stack after return:      f5
  Stack use after scope:   f8
  Stack after return:      f5
  Stack after return:      f5
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==33712==ABORTING

Without getting hands on the code, I can only guess from the sanitizer report that it looks like a use-after-free.

If you are unable to share the code, you will have to do the analysis yourself. Step through all of the code in the stack traces and piece together how a pointer is being captured and used after free.

Or if there is some corruption event, you have bigger problems and might need time travel debugging.

Sure i can share my code without issue.
Maybe the issue is that i did not understand something about the memory but my handler is static as handle_message require :

pub fn handle_message<I: ScriptHandler + 'static>(&mut self, handler: I) -> Result<()>

I also tried to make fields of my handler static to see if it would change the issue but i have just another kind of error.

Here is my code :

use crate::frida_script::FRIDA_SCRIPT;
use frida::{
    Device, DeviceManager, Frida, Message, MessageError, MessageLog, MessageSend, Script,
    ScriptHandler, ScriptOption, Session,
};
use ouroboros::self_referencing;
use serde_json::Value;

use log::{self};
use std::borrow::Borrow;
use std::error::Error;
use std::sync::{Arc, Mutex};
use tauri::async_runtime::{spawn, Receiver, Sender};

struct MyHandler {
    event_sender: Arc<Sender<String>>,
    test: &'static String,
}

impl MyHandler {
    pub fn new(event_sender: Sender<String>) -> Self {
        let instance = Self {
            event_sender: Arc::new(event_sender),
            test: Box::leak(Box::new("working ?".to_string())),
        };
        println!("instance event");
        println!("{:?}", instance.event_sender);

        instance
    }
}

impl ScriptHandler for &MyHandler {
    fn on_message(&mut self, message: &Message) {
        println!("In on_message");
        println!("{}", self.test.clone());
        println!("trying to acces event");
        /*match Arc::strong_count(&self.event_sender) {
            count if count > 0 => println!("event_sender strong count: {}", count),
            _ => println!("event_sender Arc seems invalid or dropped"),
        }
        println!("aftter strong count");*/
        println!("{:?}", self.event_sender);
        match message {
            Message::Send(MessageSend { payload }) => {
                println!(
                    "Received Send message with payload result: {:?}",
                    payload.result
                );
            }
            Message::Log(MessageLog { level, payload }) => {
                println!(
                    "Received Log message with level: {:?}, payload: {}",
                    level, payload
                );
            }
            Message::Error(MessageError {
                description,
                stack,
                file_name,
                line_number,
                column_number,
            }) => {
                println!(
                "Received Error message with description: {}, stack: {}, file_name: {}, line_number: {}, column_number: {}",
                description, stack, file_name, line_number, column_number
            );
            }
            Message::Other(value) => match value {
                Value::Null => println!("Received Other message: null"),
                Value::Bool(b) => println!("Received Other message: bool({})", b),
                Value::Number(n) => println!("Received Other message: number({})", n),
                Value::String(s) => println!("Received Other message: string({})", s),
                Value::Array(arr) => println!("Received Other message: array({:?})", arr),
                Value::Object(obj) => {
                    if let Some(data) = obj.get("data").unwrap().as_str() {
                        match serde_json::from_str::<Value>(data) {
                            Ok(json_value) => {
                                if let Some(adress) =
                                    json_value.get("payload").and_then(|v| v.as_str())
                                {
                                    println!("Received Other message: object({})", adress);
                                    println!("before string");

                                    let address_clones = adress.to_string();
                                    /*println!("after string {}", address_clones);
                                    match Arc::strong_count(&self.event_sender) {
                                        count if count > 0 => {
                                            println!("event_sender strong count: {}", count)
                                        }
                                        _ => println!("event_sender Arc seems invalid or dropped"),
                                    }*/
                                    println!("before clone");
                                    // let event_sender = self.event_sender.lock().unwrap().clone();
                                    let even_sender = self.event_sender.clone();
                                    println!("before spawn");
                                    spawn(async move {
                                        println!("trying to send message");
                                        if let Err(e) = even_sender.send(address_clones).await {
                                            eprintln!("Failed to send message: {}", e);
                                        }
                                        println!("message sent");
                                    });
                                    println!("after spawn");
                                } else {
                                    eprintln!("Failed to get payload from JSON");
                                }
                            }
                            Err(e) => eprintln!("Failed to parse JSON: {}", e),
                        }
                    }
                }
            },
        }
    }
}
#[self_referencing]
struct Connection<'a> {
    #[borrows()]
    session: Session<'a>,
    #[borrows(session)]
    #[not_covariant]
    script: Script<'this>,
}

pub struct Hook<'a> {
    _name: String,
    script: String,
    device: &'a Device<'static>,
    script_handler: &'static MyHandler,
    _connection: Option<Connection<'a>>,
}

impl<'a> Hook<'a> {
    pub fn new(event_sender: Sender<String>) -> Result<Self, Box<dyn Error>> {
        let frida: &'static Frida = Box::leak(Box::new(unsafe { Frida::obtain() }));
        let device_manager = DeviceManager::obtain(frida);
        let device_manager_boxed = Box::leak(Box::new(device_manager));
        let device = Box::leak(Box::new(device_manager_boxed.get_local_device().unwrap()));
        Ok(Self {
            _name: "myApp.exe".to_string(),
            script: FRIDA_SCRIPT.to_string(),
            device,
            script_handler: Box::leak(Box::new(MyHandler::new(event_sender))),
            _connection: None,
        })
    }
    pub async fn attach(&mut self) -> Result<bool, Box<dyn std::error::Error>> {
        if !self.is__running().await? {
            return Ok(false);
        }
        let _pid = self.get__pid().await?;
        let session = self.device.attach(_pid).unwrap();
        self._connection = Some(
            ConnectionBuilder {
                session: session,
                script_builder: |session| {
                    let mut script = session
                        .create_script(&self.script, &mut ScriptOption::new())
                        .unwrap();
                    println!("before handle message");
                    println!("{:?}", script_handler.event_sender);
                    let _ = script.handle_message(self.script_handler);

                    let _ = script.load();
                    script
                },
            }
            .build(),
        );

        log::info!("Attached to  process with PID: {}", _pid);

        Ok(true)
    }

    /*pub async fn load_script(&mut self) -> Result<bool, Box<dyn Error>> {
        if let Some(session) = &self.session {
            let mut sript_option = ScriptOption::new();
            let script_instance = Arc::new(session.create_script(&self.script, &mut sript_option)?);
            self.script_instance = Some(script_instance.clone());
            if let Some(script) = &mut self.script_instance.clone() {
                script.handle_message(self.script_handler.clone());

                let result = script.load();

                match result {
                    Ok(_) => Ok(true),
                    Err(e) => {
                        log::error!("Error loading script: {}", e);
                        Ok(false)
                    }
                }
            } else {
                Err("Failed to create script instance".into())
            }
        } else {
            Err("No active session".into())
        }
    }*/

    pub async fn hook(&mut self) -> Result<bool, Box<dyn Error>> {
        if !self.attach().await? {
            return Ok(false);
        }

        Ok(true)
    }

    pub async fn get__pid(&self) -> Result<u32, Box<dyn Error>> {
        let processes = self.device.enumerate_processes();
        let _process = processes
            .iter()
            .find(|process| process.get_name().starts_with(&self._name))
            .ok_or(" process not found")?;
        Ok(_process.get_pid())
    }

    pub async fn is__running(&self) -> Result<bool, Box<dyn Error>> {
        let processes = self.device.enumerate_processes();

        Ok(processes
            .iter()
            .any(|process| process.get_name() == self._name))
    }
}
unsafe impl<'a> Send for Hook<'a> {}
unsafe impl<'a> Sync for Hook<'a> {}

You have three usages of unsafe in the code you provided that could potentially cause UB:

  • Frida::obtain: calls frida_sys::frida_init(), no Safety section in documentation, most likely okay
  • unsafe impl Send/Sync for Hook: Unsound.
    Hook contains frida::Device, which is !Sync.
    &Device is neither Send nor Sync because &T: Send where T: Sync and &T: Sync where T: Sync.

If you have an actual justification for why Device should be Send + Sync, please explain it with SAFETY comments in your code.

I had to impl send and syn for hook because I am using tauri and in order to be able to call the fonction from my frontend i have to be able to acces It through fonctions that share a state of my backend.

Could this be the reason of my error ?

Yes. You used unsafe to implement Send and Sync without meeting the invariants of those traits. The Frida C library is likely not thread-safe with respect to those operations, but you told Rust it is. Rust allows you to share it between threads accordingly, but this is wrong. Getting a “Type is not Send” error does not mean to unsafe impl Send, it means to restructure your code to not send that type between threads.

Remove those unsafe impls. You want to have a thread owning everything related to Frida, and use channels to communicate to that thread. This is generally known as the actor pattern, explained in the article Actors with Tokio – Alice Ryhl.

4 Likes

It could be the reason. If not, it’s definitely still problematic and should not be done.

The underlying type is not thread safe. You can interact with its owning thread through a channel pair, providing a thread-safe API.

2 Likes

I tried to use the actor patern but i still have the future cannot be sent between threads safely error.

Here is my code :

impl HookHandle {
    pub fn new(event_sender: Sender<String>) -> Self {
        let (sender, receiver) = channel(8);
        spawn(async {
            let actor = Hook::new(receiver, event_sender);
            actor.run_my_actor().await; // error here
        });
        Self { sender }
    }

    pub async fn is__running(&self) -> bool {
        let (send, recv) = oneshot::channel();
        let msg = HookMessage::IsRunning { respond_to: send };

        // Ignore send errors. If this send fails, so does the
        // recv.await below. There's no reason to check for the
        // same failure twice.
        println!("sender is {:?}", self.sender);
        let _ = self.sender.send(msg).await;
        println!("messge sent");
        match recv.await {
            Ok(result) => result,
            Err(e) => {
                eprintln!("Failed to receive message: {}", e);
                false
            }
        }
    }
    pub async fn attach(&self) -> bool {
        let (send, recv) = oneshot::channel();
        let msg = HookMessage::Attach { respond_to: send };

        let _ = self.sender.send(msg).await;
        match recv.await {
            Ok(result) => result,
            Err(e) => {
                eprintln!("Failed to receive message: {}", e);
                false
            }
        }
    }

// In Hook impl
    async fn run_my_actor(mut self) {
        println!("Running actor");
        while let Some(msg) = self.receiver.recv().await {
            println!("Received message");
            let _ = self.handle_message(msg);
        }
        println!("Actor stopped");
    }

The issue is because of the .await if i try to get rid of the function i also get the error on the await:

spawn(async {
            let actor = Hook::new(receiver, event_sender);
            while let Some(msg) = self.receiver.recv().await { // error here
                 println!("Received message");
                let _ = actor .handle_message(msg);
        });

The only way it work is :

spawn(async {
            
            while let Some(msg) = self.receiver.recv().await { // No error here but use after free later
                 let actor = Hook::new(receiver, event_sender);
                 println!("Received message");
                let _ = actor .handle_message(msg);
        });

But this cause me some use-after-free error.

In Actor with Tokio there is a similar exemple:

impl MyActor {
    async fn run(&mut self) {
        while let Some(msg) = self.receiver.recv().await {
            self.handle_message(msg);
        }
    }
}

impl MyActorHandle {
    pub fn new() -> Self {
        let (sender, receiver) = mpsc::channel(8);
        let actor = MyActor::new(receiver);
        tokio::spawn(async move { actor.run().await });

        Self { sender }
    }
}

But because of the async move the actor value will be send.

What am i doing wrong ?

Don’t use tokio::spawn to spawn the actor. Use a normal std::thread::spawn. Using tokio::spawn would give the executor the right to move your future between threads, which can’t happen. Do not have the thread running async at all. Have the thread create the hook and then receive messages:

pub struct HookHandle {
    // This should *not* be an async sender
    // Just use a synchronous one like std::sync::mpsc
    sender: Sender<HookMessage>
}

impl HookHandle {
    pub fn new(event_sender: Sender<String>) -> Self {
        let some_reasonable_capacity = 8;
        let (sender, message_receiver) = channel(some_reasonable_capacity);
        thread::spawn(move || {
            // Don’t try to do anything async in here
            let mut hook = Hook::new(event_sender);
            while let Ok(message) = message_receiver.recv() {
                hook.process(message);
            }
            // This loop exits once the sender stored inside
            // the HookHandle is dropped, so the thread ends
        });
        Self { sender }
    }
}

HookMessage can be an enum like so:

enum HookMessage {
    IsRunning {
        responder: oneshot::Sender<bool>,
    },
    RunSomething {
        input: WhateverInputTheOperationShouldTake,
        responder: oneshot::Sender<WhateverOutput>,
    },
}
1 Like

Note that you can use async channels in a sync context with block_on [1].


  1. This isn't good advice in general because futures can do all kinds of things like spawn other futures, and how that exactly works depends on which runtime you are using. But for simple channel send/recv, it will be fine. ↩︎

ok thanks you a lot , even though it didn't fix my problem at least I learned something, here is my final code :

use crate::frida_script::FRIDA_SCRIPT;
use frida::{
    Device, DeviceManager, Frida, Message, MessageError, MessageLog, MessageSend, Script,
    ScriptHandler, ScriptOption, Session,
};
use ouroboros::self_referencing;
use serde_json::Value;

use log::{self};
use std::sync::{Arc, Mutex};
use tauri::async_runtime::{channel, spawn, Receiver, Sender};
use tokio::sync::oneshot;

struct MyHandler {
    event_sender: Arc<Sender<String>>,
    test: &'static mut String,
}

impl MyHandler {
    pub fn new(event_sender: Sender<String>) -> Self {
        let instance = Self {
            event_sender: Arc::new(event_sender),
            test: Box::leak(Box::new("working?".to_string())),
        };

        instance
    }
}

impl ScriptHandler for &MyHandler {
    fn on_message(&mut self, message: &Message) {
        println!("In on_message");
        println!("{}", self.test);
        println!("trying to acces event");
        /*match Arc::strong_count(&self.event_sender) {
            count if count > 0 => println!("event_sender strong count: {}", count),
            _ => println!("event_sender Arc seems invalid or dropped"),
        }
        println!("aftter strong count");*/
        println!("{:?}", self.event_sender);
        match message {
            Message::Send(MessageSend { payload }) => {
                println!(
                    "Received Send message with payload result: {:?}",
                    payload.result
                );
            }
            Message::Log(MessageLog { level, payload }) => {
                println!(
                    "Received Log message with level: {:?}, payload: {}",
                    level, payload
                );
            }
            Message::Error(MessageError {
                description,
                stack,
                file_name,
                line_number,
                column_number,
            }) => {
                println!(
                "Received Error message with description: {}, stack: {}, file_name: {}, line_number: {}, column_number: {}",
                description, stack, file_name, line_number, column_number
            );
            }
            Message::Other(value) => match value {
                Value::Null => println!("Received Other message: null"),
                Value::Bool(b) => println!("Received Other message: bool({})", b),
                Value::Number(n) => println!("Received Other message: number({})", n),
                Value::String(s) => println!("Received Other message: string({})", s),
                Value::Array(arr) => println!("Received Other message: array({:?})", arr),
                Value::Object(obj) => {
                    if let Some(data) = obj.get("data").unwrap().as_str() {
                        match serde_json::from_str::<Value>(data) {
                            Ok(json_value) => {
                                if let Some(adress) =
                                    json_value.get("payload").and_then(|v| v.as_str())
                                {
                                    println!("Received Other message: object({})", adress);
                                    println!("before string");

                                    let address_clones = adress.to_string();
                                    /*println!("after string {}", address_clones);
                                    match Arc::strong_count(&self.event_sender) {
                                        count if count > 0 => {
                                            println!("event_sender strong count: {}", count)
                                        }
                                        _ => println!("event_sender Arc seems invalid or dropped"),
                                    }*/
                                    println!("before clone");
                                    // let event_sender = self.event_sender.lock().unwrap().clone();
                                    let even_sender = self.event_sender.clone();
                                    println!("before spawn");
                                    spawn(async move {
                                        println!("trying to send message");
                                        if let Err(e) = even_sender.send(address_clones).await {
                                            eprintln!("Failed to send message: {}", e);
                                        }
                                        println!("message sent");
                                    });
                                    println!("after spawn");
                                } else {
                                    eprintln!("Failed to get payload from JSON");
                                }
                            }
                            Err(e) => eprintln!("Failed to parse JSON: {}", e),
                        }
                    }
                }
            },
        }
    }
}
#[self_referencing]
struct Connection<'a> {
    #[borrows()]
    session: Session<'a>,
    #[borrows(session)]
    #[not_covariant]
    script: Script<'this>,
}

enum HookMessage {
    IsRunning { respond_to: oneshot::Sender<bool> },
    Attach { respond_to: oneshot::Sender<bool> },
}

pub struct Hook<'a> {
    receiver: Receiver<HookMessage>,
    _name: String,
    script: String,
    device: &'a Device<'static>,
    script_handler: &'static MyHandler,
    _connection: Option<Connection<'a>>,
}

impl<'a> Hook<'a> {
    pub fn new(
        _hook_message_receiver: Receiver<HookMessage>,
        event_sender: Sender<String>,
    ) -> Self {
        let frida: &'static Frida = Box::leak(Box::new(unsafe { Frida::obtain() }));
        let device_manager = DeviceManager::obtain(frida);
        let device_manager_boxed = Box::leak(Box::new(device_manager));
        let device = Box::leak(Box::new(device_manager_boxed.get_local_device().unwrap()));
        Self {
            receiver: _hook_message_receiver,
            _name: "myApp.exe".to_string(),
            script: FRIDA_SCRIPT.to_string(),
            device,
            script_handler: Box::leak(Box::new(MyHandler::new(event_sender))),
            _connection: None,
        }
    }

    fn handle_message(&mut self, msg: HookMessage) {
        match msg {
            HookMessage::IsRunning { respond_to } => {
                let _ = respond_to.send(self.is__running());
            }
            HookMessage::Attach { respond_to } => {
                let _ = respond_to.send(self.attach());
                println!(" Hooked");
            }
        }
    }
    pub fn run_my_actor(&mut self) {
        while let Some(message) = self.receiver.blocking_recv() {
            self.handle_message(message);
        }
    }

    pub fn attach(&mut self) -> bool {
        if !self.is__running() {
            return false;
        }
        let _pid = self.get__pid();
        let session = self.device.attach(_pid).unwrap();

        self._connection = Some(
            ConnectionBuilder {
                session: session,
                script_builder: |session| {
                    let mut script: Script = session
                        .create_script(&self.script, &mut ScriptOption::new())
                        .unwrap();
                    let _ = script.handle_message(self.script_handler);

                    let _ = script.load();
                    script
                },
            }
            .build(),
        );

        log::info!("Attached to  process with PID: {}", _pid);

        true
    }

    pub fn get__pid(&self) -> u32 {
        let processes = self.device.enumerate_processes();
        let _process = processes
            .iter()
            .find(|process| process.get_name().starts_with(&self._name))
            .ok_or(" process not found")
            .unwrap();
        _process.get_pid()
    }

    pub fn is__running(&self) -> bool {
        let processes = self.device.enumerate_processes();

        processes
            .iter()
            .any(|process| process.get_name() == self._name)
    }
}

#[derive(Clone)]
pub struct HookHandle {
    sender: Sender<HookMessage>,
}

impl HookHandle {
    pub fn new(event_sender: Sender<String>) -> Self {
        let (sender, receiver) = channel(8);

        std::thread::spawn(move || {
            let mut actor = Hook::new(receiver, event_sender);
            actor.run_my_actor()
        });
        Self { sender }
    }

    pub async fn is__running(&self) -> bool {
        let (send, recv) = oneshot::channel();
        let msg = HookMessage::IsRunning { respond_to: send };

        // Ignore send errors. If this send fails, so does the
        // recv.await below. There's no reason to check for the
        // same failure twice.
        let _ = self.sender.send(msg).await;
        match recv.await {
            Ok(result) => result,
            Err(e) => {
                eprintln!("Failed to receive message: {}", e);
                false
            }
        }
    }
    pub async fn attach(&self) -> bool {
        let (send, recv) = oneshot::channel();
        let msg = HookMessage::Attach { respond_to: send };

        let _ = self.sender.send(msg).await;
        match recv.await {
            Ok(result) => result,
            Err(e) => {
                eprintln!("Failed to receive message: {}", e);
                false
            }
        }
    }
}

Unfortunately it didn't fix my issue and i still have :

=================================================================
==6196==ERROR: AddressSanitizer: access-violation on unknown address 0x000000000009 (pc 0x7ff66c2e98c4 bp 0x00440a1fd770 sp 0x00440a1fd6c0 T24)        
==6196==The signal is caused by a READ memory access.
==6196==Hint: address points to the zero page.
    #0 0x7ff66c2e98c3 in _$LT$$RF$mut$u20$T$u20$as$u20$core..fmt..Display$GT$::fmt::h1176aadaf509fdab C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\fmt\mod.rs:2644
    #1 0x7ff66d3353a9 in core::fmt::rt::Argument::fmt /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\rt.rs:177
    #2 0x7ff66d3353a9 in core::fmt::write::hd09721bccbef5a36 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\mod.rs:1437
    #3 0x7ff66d30d82a in std::io::Write::write_fmt /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\mod.rs:1887
    #4 0x7ff66d30d82a in _$LT$$RF$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::haad2e52e4f8128a3 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:792
    #5 0x7ff66d30e4d0 in std::io::stdio::impl$15::write_fmt /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:766
    #6 0x7ff66d30e4d0 in std::io::stdio::print_to /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:1122
    #7 0x7ff66d30e4d0 in std::io::stdio::_print::h394176707872073f /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:1233    
    #8 0x7ff66ab0c0bb in _$LT$$RF$app_lib..hook..MyHandler$u20$as$u20$frida..script..ScriptHandler$GT$::on_message::hb1521dc7c35741a0 C:\Programmation\Projets\src-tauri\src\hook.rs:33
    #9 0x7ff66aba1564 in frida::script::call_on_message::h0f776aee639d7da9 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\frida-0.15.1\src\script.rs:121
    #10 0x7ff66d3ac731 in g_closure_invoke D:\a\frida\frida\deps\src\glib\gobject\gclosure.c:836
    #11 0x7ff66d340261 in signal_emit_unlocked_R D:\a\frida\frida\deps\src\glib\gobject\gsignal.c:3800
    #12 0x7ff66d33e6a9 in g_signal_emit_valist D:\a\frida\frida\deps\src\glib\gobject\gsignal.c:3553
    #13 0x7ff66d33dfc3 in g_signal_emit D:\a\frida\frida\deps\src\glib\gobject\gsignal.c:3610
    #14 0x7ff66d372b3f in frida_session_real_post_messages_co D:\a\frida\frida\build\frida.c:47029
    #15 0x7ff66d3883d4 in frida_agent_message_sink_post_messages D:\a\frida\frida\build\session.c:14126
    #16 0x7ff66d3799ea in _dbus_frida_agent_message_sink_post_messages D:\a\frida\frida\build\session.c:14356
    #17 0x7ff66d3c0cc8 in call_in_idle_cb D:\a\frida\frida\deps\src\glib\gio\gdbusconnection.c:4998
    #18 0x7ff66d3b777e in g_idle_dispatch D:\a\frida\frida\deps\src\glib\glib\gmain.c:6462
    #19 0x7ff66d3b8df4 in g_main_dispatch D:\a\frida\frida\deps\src\glib\glib\gmain.c:3557
    #20 0x7ff66d3b7fdf in g_main_context_dispatch D:\a\frida\frida\deps\src\glib\glib\gmain.c:4281
    #21 0x7ff66d3b8306 in g_main_context_iterate D:\a\frida\frida\deps\src\glib\glib\gmain.c:4357
    #22 0x7ff66d3b8fee in g_main_loop_run D:\a\frida\frida\deps\src\glib\glib\gmain.c:4557
    #23 0x7ff66d344c63 in run_main_loop D:\a\frida\frida\subprojects\frida-core\src\frida-glue.c:159
    #24 0x7ff66d3b74ec in g_thread_proxy D:\a\frida\frida\deps\src\glib\glib\gthread.c:1055
    #25 0x7ff66d3a40da in g_thread_win32_proxy D:\a\frida\frida\deps\src\glib\glib\gthread-win32.c:494
    #26 0x7ffe564d9332  (C:\Windows\System32\ucrtbase.dll+0x180029332)
    #27 0x7ffd5807de2d in asan_thread_start D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:170
    #28 0x7ffe5758259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #29 0x7ffe58c6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: access-violation C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\fmt\mod.rs:2644 in _$LT$$RF$mut$u20$T$u20$as$u20$core..fmt..Display$GT$::fmt::h1176aadaf509fdab
Thread T24 created by T23 here:
    #0 0x7ffd5807e237 in CreateThread D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:223
    #1 0x7ffe564d83ad  (C:\Windows\System32\ucrtbase.dll+0x1800283ad)
    #2 0x7ff66d3a3c66 in g_system_thread_new D:\a\frida\frida\deps\src\glib\glib\gthread-win32.c:539
    #3 0x7ff66d3b7316 in g_thread_new_internal D:\a\frida\frida\deps\src\glib\glib\gthread.c:1162
    #4 0x7ff66d3b72b7 in g_thread_new D:\a\frida\frida\deps\src\glib\glib\gthread.c:1112
    #5 0x7ff66d344b48 in frida_init_with_runtime D:\a\frida\frida\subprojects\frida-core\src\frida-glue.c:47
    #6 0x7ff66c0d94e8 in frida::Frida::obtain::h1c8de11d8b6a5b03 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\frida-0.15.1\src\lib.rs:51
    #7 0x7ff66ab0dcdd in app_lib::hook::Hook::new::h88decbf6d87bcc02 C:\Programmation\Projets\src-tauri\src\hook.rs:142
    #8 0x7ff66b9fc781 in app_lib::hook::HookHandle::new::_$u7b$$u7b$closure$u7d$$u7d$::h080a1736b4ca15a9 C:\Programmation\Projets\src-tauri\src\hook.rs:255
    #9 0x7ff66b3ecc42 in std::sys::backtrace::__rust_begin_short_backtrace::h366b478b3b1b2187 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:152
    #10 0x7ff66a9b13fd in std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h7f4e9de15281129c C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:561
    #11 0x7ff66bb5b777 in _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h447b09500d277125 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panic\unwind_safe.rs:272   
    #12 0x7ff66b41f1fc in std::panicking::try::do_call::h85f65ddc4c4d443a C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:573
    #13 0x7ff66a9b1e42 in _$LT$std..thread..Packet$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::_$u7b$$u7b$closure$u7d$$u7d$::haaa54579984ab298 (C:\Programmation\Projets\src-tauri\target\x86_64-pc-windows-msvc\debug.exe+0x1400e1e42)
    #14 0x7ff66a9af605 in std::panicking::try C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:536
    #15 0x7ff66a9af605 in std::panic::catch_unwind C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:358
    #16 0x7ff66a9af605 in std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::h6fdd3a7c2e2abd90 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:559
    #17 0x7ff66a9d814d in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h591dfcfa4c69a80e C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #18 0x7ff66d3229cc in alloc::boxed::impl$28::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\alloc\src\boxed.rs:1970
    #19 0x7ff66d3229cc in alloc::boxed::impl$28::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\alloc\src\boxed.rs:1970
    #20 0x7ff66d3229cc in std::sys::pal::windows::thread::impl$0::new::thread_start /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\sys\pal\windows\thread.rs:55
    #21 0x7ffd5807de2d in asan_thread_start D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:170
    #22 0x7ffe5758259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #23 0x7ffe58c6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

Thread T23 created by T0 here:
    #0 0x7ffd5807e237 in CreateThread D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:223
    #1 0x7ff66d322860 in std::sys::pal::windows::thread::Thread::new::h017280e5c552294c /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\sys\pal\windows\thread.rs:30
    #2 0x7ff66a9aba94 in std::thread::Builder::spawn_unchecked_::h23616de7f9648ee4 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:600
    #3 0x7ff66a9a9387 in std::thread::Builder::spawn_unchecked::hfebf73570bf90fde C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:467
    #4 0x7ff66a9a8935 in std::thread::Builder::new C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:400
    #5 0x7ff66a9a8935 in std::thread::spawn::h95479ba6bb736495 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:730
    #6 0x7ff66ab10391 in app_lib::hook::HookHandle::new::h09add5cfa9f2380c C:\Programmation\Projets\src-tauri\src\hook.rs:254     
    #7 0x7ff66a8d4cf6 in app_lib::bot::Bot::new::hd04a96350e501073 C:\Programmation\Projets\src-tauri\src\bot.rs:21
    #8 0x7ff66a8d1d39 in app_lib::run::hb45281bcd6215cd9 C:\Programmation\Projets\src-tauri\src\lib.rs:16
    #9 0x7ff66a8d1048 in::main C:\Programmation\Projets\src-tauri\src\main.rs:5
    #10 0x7ff66a8d129a in core::ops::function::FnOnce::call_once::hdf3489fdcfff43ad C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #11 0x7ff66a8d100d in std::sys::backtrace::__rust_begin_short_backtrace::hccf684203473f78a C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:152
    #12 0x7ff66a8d1563 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h519e6d06634b26f5 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:195
    #13 0x7ff66d3086bb in core::ops::function::impls::impl$2::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\ops\function.rs:284
    #14 0x7ff66d3086bb in std::panicking::try::do_call /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:573
    #15 0x7ff66d3086bb in std::panicking::try /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:536
    #16 0x7ff66d3086bb in std::panic::catch_unwind /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panic.rs:358
    #17 0x7ff66d3086bb in std::rt::lang_start_internal::closure$1 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\rt.rs:174
    #18 0x7ff66d3086bb in std::panicking::try::do_call /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:573
    #19 0x7ff66d3086bb in std::panicking::try /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:536
    #20 0x7ff66d3086bb in std::panic::catch_unwind /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panic.rs:358
    #21 0x7ff66d3086bb in std::rt::lang_start_internal::h9709fc44ae8f04d9 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\rt.rs:174    
    #22 0x7ff66a8d13e9 in std::rt::lang_start::h1f1d1d8c1fd35049 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:194
    #23 0x7ff66a8d1068 in main (C:\Programmation\Projets\src-tauri\target\x86_64-pc-windows-msvc\debug.exe+0x140001068)
    #24 0x7ff66d91900f in invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
    #25 0x7ff66d91900f in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    #26 0x7ffe5758259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #27 0x7ffe58c6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

==6196==ABORTING

From what i understand the issue is in the frida runtime created by Frida::obtain() when it execute frida::script::call_on_message and i tries to print my String. So probably my structure MyHandler is not correctly shared ? If it would be freed the function on_message could not be executed right ? The structure is static because of Box::leak(Box::new()) so it's is not that the variable doesn't exist anymore when it is used but probably that the pointers to his fields are corrupted/wrong ?

This isn’t the same stack trace as before, though. This one seems to have added 9 to a null pointer (getting unknown address 0x000000000009). Considering that it’s in <&mut T as Display>, it could be the pointer MyHandler.test.

At the top of fn on_message, try adding this:

println!("Test pointer: {:p}", self.test);

Put that same line at the end of new to check what the pointer is when it’s made, and when it’s used. In the code you’re showing that field is never even used besides printing it, so it shouldn’t be changing.

the first println! gives me Test pointer: 0x11c753dad1e0

The second one fail with :

=================================================================
==14460==ERROR: AddressSanitizer: access-violation on unknown address 0x000000000009 (pc 0x7ff7ef5f0e64 bp 0x005c4a6fd450 sp 0x005c4a6fd380 T24)
==14460==The signal is caused by a READ memory access.
==14460==Hint: address points to the zero page.
    #0 0x7ff7ef5f0e63 in _$LT$$RF$mut$u20$T$u20$as$u20$core..fmt..Pointer$GT$::fmt::h0b1776c91d3a6931 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\fmt\mod.rs:2821
    #1 0x7ff7f1ac63a9 in core::fmt::rt::Argument::fmt /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\rt.rs:177
    #2 0x7ff7f1ac63a9 in core::fmt::write::hd09721bccbef5a36 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\fmt\mod.rs:1437
    #3 0x7ff7f1a9e82a in std::io::Write::write_fmt /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\mod.rs:1887 
    #4 0x7ff7f1a9e82a in _$LT$$RF$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::haad2e52e4f8128a3 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:792
    #5 0x7ff7f1a9f4d0 in std::io::stdio::impl$15::write_fmt /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:766
    #6 0x7ff7f1a9f4d0 in std::io::stdio::print_to /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:1122
    #7 0x7ff7f1a9f4d0 in std::io::stdio::_print::h394176707872073f /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\io\stdio.rs:1233
    #8 0x7ff7ef29c3fb in _$LT$$RF$app_lib..hook..MyHandler$u20$as$u20$frida..script..ScriptHandler$GT$::on_message::hb1521dc7c35741a0 C:\Programmation\Projets\\src-tauri\src\hook.rs:33
    #9 0x7ff7ef331a04 in frida::script::call_on_message::h0f776aee639d7da9 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\frida-0.15.1\src\script.rs:121
    #10 0x7ff7f1b3d731 in g_closure_invoke D:\a\frida\frida\deps\src\glib\gobject\gclosure.c:836
    #11 0x7ff7f1ad1261 in signal_emit_unlocked_R D:\a\frida\frida\deps\src\glib\gobject\gsignal.c:3800
    #12 0x7ff7f1acf6a9 in g_signal_emit_valist D:\a\frida\frida\deps\src\glib\gobject\gsignal.c:3553
    #13 0x7ff7f1acefc3 in g_signal_emit D:\a\frida\frida\deps\src\glib\gobject\gsignal.c:3610
    #14 0x7ff7f1b03b3f in frida_session_real_post_messages_co D:\a\frida\frida\build\frida.c:47029
    #15 0x7ff7f1b193d4 in frida_agent_message_sink_post_messages D:\a\frida\frida\build\session.c:14126
    #16 0x7ff7f1b0a9ea in _dbus_frida_agent_message_sink_post_messages D:\a\frida\frida\build\session.c:14356
    #17 0x7ff7f1b51cc8 in call_in_idle_cb D:\a\frida\frida\deps\src\glib\gio\gdbusconnection.c:4998
    #18 0x7ff7f1b4877e in g_idle_dispatch D:\a\frida\frida\deps\src\glib\glib\gmain.c:6462
    #19 0x7ff7f1b49df4 in g_main_dispatch D:\a\frida\frida\deps\src\glib\glib\gmain.c:3557
    #20 0x7ff7f1b48fdf in g_main_context_dispatch D:\a\frida\frida\deps\src\glib\glib\gmain.c:4281
    #21 0x7ff7f1b49306 in g_main_context_iterate D:\a\frida\frida\deps\src\glib\glib\gmain.c:4357
    #22 0x7ff7f1b49fee in g_main_loop_run D:\a\frida\frida\deps\src\glib\glib\gmain.c:4557
    #23 0x7ff7f1ad5c63 in run_main_loop D:\a\frida\frida\subprojects\frida-core\src\frida-glue.c:159
    #24 0x7ff7f1b484ec in g_thread_proxy D:\a\frida\frida\deps\src\glib\glib\gthread.c:1055
    #25 0x7ff7f1b350da in g_thread_win32_proxy D:\a\frida\frida\deps\src\glib\glib\gthread-win32.c:494
    #26 0x7ffe564d9332  (C:\Windows\System32\ucrtbase.dll+0x180029332)
    #27 0x7ffdad77de2d in asan_thread_start D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:170
    #28 0x7ffe5758259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #29 0x7ffe58c6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: access-violation C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\fmt\mod.rs:2821 in _$LT$$RF$mut$u20$T$u20$as$u20$core..fmt..Pointer$GT$::fmt::h0b1776c91d3a6931
Thread T24 created by T23 here:
    #0 0x7ffdad77e237 in CreateThread D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:223
    #1 0x7ffe564d83ad  (C:\Windows\System32\ucrtbase.dll+0x1800283ad)
    #2 0x7ff7f1b34c66 in g_system_thread_new D:\a\frida\frida\deps\src\glib\glib\gthread-win32.c:539
    #3 0x7ff7f1b48316 in g_thread_new_internal D:\a\frida\frida\deps\src\glib\glib\gthread.c:1162
    #4 0x7ff7f1b482b7 in g_thread_new D:\a\frida\frida\deps\src\glib\glib\gthread.c:1112
    #5 0x7ff7f1ad5b48 in frida_init_with_runtime D:\a\frida\frida\subprojects\frida-core\src\frida-glue.c:47
    #6 0x7ff7f0869b08 in frida::Frida::obtain::h1c8de11d8b6a5b03 C:\Users\sauro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\frida-0.15.1\src\lib.rs:51
    #7 0x7ff7ef29e17d in app_lib::hook::Hook::new::h88decbf6d87bcc02 C:\Programmation\Projets\\src-tauri\src\hook.rs:143
    #8 0x7ff7f018cda1 in app_lib::hook::HookHandle::new::_$u7b$$u7b$closure$u7d$$u7d$::h080a1736b4ca15a9 C:\Programmation\Projets\\src-tauri\src\hook.rs:231
    #9 0x7ff7efb7d262 in std::sys::backtrace::__rust_begin_short_backtrace::h366b478b3b1b2187 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:152
    #10 0x7ff7ef1413fd in std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h7f4e9de15281129c C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:561
    #11 0x7ff7f02ebd97 in _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h447b09500d277125 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panic\unwind_safe.rs:272
    #12 0x7ff7efbaf81c in std::panicking::try::do_call::h85f65ddc4c4d443a C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:573
    #13 0x7ff7ef141e42 in _$LT$std..thread..Packet$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::_$u7b$$u7b$closure$u7d$$u7d$::haaa54579984ab298 (C:\Programmation\Projets\\src-tauri\target\x86_64-pc-windows-msvc\debug\.exe+0x1400e1e42)
    #14 0x7ff7ef13f605 in std::panicking::try C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:536
    #15 0x7ff7ef13f605 in std::panic::catch_unwind C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:358
    #16 0x7ff7ef13f605 in std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::h6fdd3a7c2e2abd90 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:559
    #17 0x7ff7ef16814d in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h591dfcfa4c69a80e C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #18 0x7ff7f1ab39cc in alloc::boxed::impl$28::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\alloc\src\boxed.rs:1970
    #19 0x7ff7f1ab39cc in alloc::boxed::impl$28::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\alloc\src\boxed.rs:1970
    #20 0x7ff7f1ab39cc in std::sys::pal::windows::thread::impl$0::new::thread_start /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\sys\pal\windows\thread.rs:55
    #21 0x7ffdad77de2d in asan_thread_start D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:170
    #22 0x7ffe5758259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #23 0x7ffe58c6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

Thread T23 created by T0 here:
    #0 0x7ffdad77e237 in CreateThread D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:223
    #1 0x7ff7f1ab3860 in std::sys::pal::windows::thread::Thread::new::h017280e5c552294c /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\sys\pal\windows\thread.rs:30
    #2 0x7ff7ef13ba94 in std::thread::Builder::spawn_unchecked_::h23616de7f9648ee4 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:600
    #3 0x7ff7ef139387 in std::thread::Builder::spawn_unchecked::hfebf73570bf90fde C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:467
    #4 0x7ff7ef138935 in std::thread::Builder::new C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:400
    #5 0x7ff7ef138935 in std::thread::spawn::h95479ba6bb736495 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:730
    #6 0x7ff7ef2a0831 in app_lib::hook::HookHandle::new::h09add5cfa9f2380c C:\Programmation\Projets\\src-tauri\src\hook.rs:230
    #7 0x7ff7ef064cf6 in app_lib::bot::Bot::new::hd04a96350e501073 C:\Programmation\Projets\\src-tauri\src\bot.rs:21
    #8 0x7ff7ef061d39 in app_lib::run::hb45281bcd6215cd9 C:\Programmation\Projets\\src-tauri\src\lib.rs:16
    #9 0x7ff7ef061048 in ::main C:\Programmation\Projets\\src-tauri\src\main.rs:5
    #10 0x7ff7ef06129a in core::ops::function::FnOnce::call_once::hdf3489fdcfff43ad C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
    #11 0x7ff7ef06100d in std::sys::backtrace::__rust_begin_short_backtrace::hccf684203473f78a C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:152
    #12 0x7ff7ef061563 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h519e6d06634b26f5 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:195
    #13 0x7ff7f1a996bb in core::ops::function::impls::impl$2::call_once /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\core\src\ops\function.rs:284
    #14 0x7ff7f1a996bb in std::panicking::try::do_call /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:573
    #15 0x7ff7f1a996bb in std::panicking::try /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:536    
    #16 0x7ff7f1a996bb in std::panic::catch_unwind /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panic.rs:358   
    #17 0x7ff7f1a996bb in std::rt::lang_start_internal::closure$1 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\rt.rs:174
    #18 0x7ff7f1a996bb in std::panicking::try::do_call /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:573
    #19 0x7ff7f1a996bb in std::panicking::try /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panicking.rs:536    
    #20 0x7ff7f1a996bb in std::panic::catch_unwind /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\panic.rs:358   
    #21 0x7ff7f1a996bb in std::rt::lang_start_internal::h9709fc44ae8f04d9 /rustc/a224f3807e58afc9353510f1d556c607d367545d/library\std\src\rt.rs:174
    #22 0x7ff7ef0613e9 in std::rt::lang_start::h1f1d1d8c1fd35049 C:\Users\sauro\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:194
    #23 0x7ff7ef061068 in main (C:\Programmation\Projets\\src-tauri\target\x86_64-pc-windows-msvc\debug\.exe+0x140001068)
    #24 0x7ff7f20aa00f in invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
    #25 0x7ff7f20aa00f in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    #26 0x7ffe5758259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
    #27 0x7ffe58c6af37  (C:\Windows\SYSTEM32\ntdll.dll+0x18005af37)

==14460==ABORTING