Giter Club home page Giter Club logo

graphrox-rs's People

Contributors

ted-tanner avatar

Stargazers

 avatar  avatar

Watchers

 avatar

graphrox-rs's Issues

heap-use-after-free in test_standard_graph_compress due to pointing into hash table

https://asan.saethlin.dev/ub?crate=graphrox&version=1.2.0

test graph::standard::tests::test_standard_graph_add_vertex ... ok
test graph::standard::tests::test_standard_graph_compress ... =================================================================
==11628==ERROR: AddressSanitizer: heap-use-after-free on address 0x508000007f38 at pc 0x562a60a5e2c3 bp 0x7fd599df24f0 sp 0x7fd599df24e8
READ of size 8 at 0x508000007f38 thread T22
    #0 0x562a60a5e2c2 in _$LT$graphrox..matrix..csr_square_matrix..CsrSquareMatrixIter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h9f71527108491be8 /build/src/matrix/csr_square_matrix.rs:464:34
    #1 0x562a60abf8e4 in graphrox::graph::standard::StandardGraph::find_avg_pool_matrix::hca573cc988feb0f7 /build/src/graph/standard.rs:489:34
    #2 0x562a60ac0a8b in graphrox::graph::standard::StandardGraph::compress::h7b844a2b14d6231c /build/src/graph/standard.rs:656:31
    #3 0x562a60a2ed8c in graphrox::graph::standard::tests::test_standard_graph_compress::hb9f5aa8b60723511 /build/src/graph/standard.rs:1764:32
    #4 0x562a60a25882 in graphrox::graph::standard::tests::test_standard_graph_compress::_$u7b$$u7b$closure$u7d$$u7d$::hc82774e548676430 /build/src/graph/standard.rs:1653:38
0x508000007f38 is located 24 bytes inside of 84-byte region [0x508000007f20,0x508000007f74)
freed by thread T22 here:
    #0 0x562a6099f146 in free /rustc/llvm/src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:52:3
    #1 0x562a60f9a061 in std::sys::unix::alloc::_$LT$impl$u20$core..alloc..global..GlobalAlloc$u20$for$u20$std..alloc..System$GT$::dealloc::h8a70c9434083b1d7 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/alloc.rs:42:9
    #2 0x562a60c65e01 in _$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::deallocate::h01227f2bc0e71513 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:254:22
    #3 0x562a60bc1624 in hashbrown::raw::RawTableInner$LT$A$GT$::free_buckets::he1bda5bb027a5590 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:2355:9
    #4 0x562a60bc2157 in hashbrown::raw::RawTableInner$LT$A$GT$::prepare_resize::_$u7b$$u7b$closure$u7d$$u7d$::h13422c6a7e6444d6 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:2173:17
    #5 0x562a60a008e6 in hashbrown::raw::RawTable$LT$T$C$A$GT$::reserve::he9b0fa826149d4da /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:1086:16
    #6 0x562a609ecebb in hashbrown::raw::RawTable$LT$T$C$A$GT$::find_or_find_insert_slot::h46424c3128bb2172 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:1262:9
    #7 0x562a60a724fa in hashbrown::map::HashMap$LT$K$C$V$C$S$C$A$GT$::insert::h58f4fa059165b006 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/map.rs:1750:15
    #8 0x562a60aa9bc5 in std::collections::hash::map::HashMap$LT$K$C$V$C$S$GT$::insert::hfdece9de714874b1 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:1105:9
    #9 0x562a60abfa9e in graphrox::graph::standard::StandardGraph::find_avg_pool_matrix::hca573cc988feb0f7 /build/src/graph/standard.rs:494:22
    #10 0x562a60ac0a8b in graphrox::graph::standard::StandardGraph::compress::h7b844a2b14d6231c /build/src/graph/standard.rs:656:31
    #11 0x562a60a2ed8c in graphrox::graph::standard::tests::test_standard_graph_compress::hb9f5aa8b60723511 /build/src/graph/standard.rs:1764:32
    #12 0x562a60a25882 in graphrox::graph::standard::tests::test_standard_graph_compress::_$u7b$$u7b$closure$u7d$$u7d$::hc82774e548676430 /build/src/graph/standard.rs:1653:38
previously allocated by thread T22 here:
    #0 0x562a6099f3ee in malloc /rustc/llvm/src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3
    #1 0x562a60f99d5e in std::sys::unix::alloc::_$LT$impl$u20$core..alloc..global..GlobalAlloc$u20$for$u20$std..alloc..System$GT$::alloc::hbfc48fea06eea223 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/alloc.rs:14:13
    #2 0x562a60f1d93a in __rdl_alloc /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/alloc.rs:394:13
    #3 0x562a60c65022 in alloc::alloc::Global::alloc_impl::h6326bb1181b4b68f /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:181:73
    #4 0x562a60c65e67 in _$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::hbe989e58e74c71f1 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:241:9
    #5 0x562a60bc4f65 in hashbrown::raw::RawTableInner$LT$A$GT$::new_uninitialized::h9f2f22560d3ee53b /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:1578:38
    #6 0x562a60bc5ce3 in hashbrown::raw::RawTableInner$LT$A$GT$::fallible_with_capacity::ha1ba2e5fb24a08f9 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:1614:30
    #7 0x562a60bc1a52 in hashbrown::raw::RawTableInner$LT$A$GT$::prepare_resize::h43aa8d19a7ffb149 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:2156:29
    #8 0x562a609e32ef in hashbrown::raw::RawTableInner$LT$A$GT$::resize_inner::hf5bd2317fe47e326 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:2229:29
    #9 0x562a609e32ef in hashbrown::raw::RawTableInner$LT$A$GT$::reserve_rehash_inner::h118be889a6bb4f4b /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:2206:13
    #10 0x562a609e32ef in hashbrown::raw::RawTable$LT$T$C$A$GT$::reserve_rehash::h4a054eb067aec8d8 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:1120:13
    #11 0x562a60a008e6 in hashbrown::raw::RawTable$LT$T$C$A$GT$::reserve::he9b0fa826149d4da /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/raw/mod.rs:1086:16
    #12 0x562a60a74a98 in hashbrown::map::HashMap$LT$K$C$V$C$S$C$A$GT$::reserve::h14e7ccdd98aaf138 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.14.0/src/map.rs:1102:9
    #13 0x562a60aa99c2 in std::collections::hash::map::HashMap$LT$K$C$V$C$S$GT$::entry::he18765aeaf09cb59 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:856:19
    #14 0x562a60a4be38 in graphrox::matrix::csr_square_matrix::CsrSquareMatrix$LT$T$GT$::increment_entry::h38bdce28ade53634 /build/src/matrix/csr_square_matrix.rs:90:21
    #15 0x562a60abfb5e in graphrox::graph::standard::StandardGraph::find_avg_pool_matrix::hca573cc988feb0f7 /build/src/graph/standard.rs:479:13
    #16 0x562a60ac0a8b in graphrox::graph::standard::StandardGraph::compress::h7b844a2b14d6231c /build/src/graph/standard.rs:656:31
    #17 0x562a60a2ed8c in graphrox::graph::standard::tests::test_standard_graph_compress::hb9f5aa8b60723511 /build/src/graph/standard.rs:1764:32
    #18 0x562a60a25882 in graphrox::graph::standard::tests::test_standard_graph_compress::_$u7b$$u7b$closure$u7d$$u7d$::hc82774e548676430 /build/src/graph/standard.rs:1653:38

In general, you cannot rely on address stability of Rust objects. Try storing a Pin<Box<Thing>> as the value of your hashmap.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.