Skip to content
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

Function futures-timer/src/native/global/raw_drop, raw_wake, raw_clone, and raw_wake_by_ref can trigger invalid memory reference #80

Open
cicilzx opened this issue Oct 6, 2024 · 0 comments

Comments

@cicilzx
Copy link

cicilzx commented Oct 6, 2024

Hi, I'm developing a fuzzer to test the safe abstraction, and I found some memory issues when calling function futures-timer/src/native/global/raw_drop, raw_wake, raw_clone, and raw_wake_by_ref.

Below are some test cases:

// case1:
#[test]
fn test_raw_drop_ikeZT() {
    let ptr: Vec<()> = vec![];
    let _ = raw_drop(ptr.as_ptr());
}

// case2:
fn test_raw_wake_JvToH() {
    let ptr: Vec<()> = vec![()];
    let _ = raw_wake(ptr.as_ptr());
}

// case3:
fn test_raw_clone_dGcoO() {
    let ptr: Vec<()> = vec![];
    let _ = raw_clone(ptr.as_ptr());
}

//case4:
fn test_raw_wake_by_ref_9Jhw9() {
    let ptr: Vec<()> = vec![];
    let _ = raw_wake_by_ref(ptr.as_ptr());
}

The outputs are:

error: test failed, to rerun pass `-p futures-timer --lib`

Caused by:
  process didn't exit successfully: `/Users/liuzixi/Documents/futures-timer/target/debug/deps/futures_timer-f3d22d0c7e0e06d3 'native::global::test_raw_drop_ikeZT' --exact --show-output` (signal: 11, SIGSEGV: invalid memory reference)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant