-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScriptHandler : Accesing fields of struct make the programm crash / random value returned by fields #189
Comments
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 :
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello.
After some days of searching i don't find any solution so i wanted to share my issue here.
First of all this post will be a paste of : https://users.rust-lang.org/t/accesing-fields-of-struct-make-the-programm-crash-random-value-returned-by-fields-frida-scripthandler/122304/1 you could find more informations or the answer if it is found there.
I created a struct implementing ScriptHandler , this struct has a mpsc::Sender to send message but as soon as i try to acces it my program crash. here is a small exemple:
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
.I tried to compile it with adressSanitazier and here is the stacktrace:
The text was updated successfully, but these errors were encountered: