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

ivec self-append has illegal memory access #816

Closed
brson opened this issue Aug 12, 2011 · 1 comment
Closed

ivec self-append has illegal memory access #816

brson opened this issue Aug 12, 2011 · 1 comment

Comments

@brson
Copy link
Contributor

brson commented Aug 12, 2011

This conversion of run-pass/vec-self-append fails to valgrind:


use std;
import std::ivec;

fn main() {
    // Make sure we properly handle repeated self-appends.
    let a: [int] = ~[0];
    let i = 20;
    let expected_len = 1u;
    while i > 0 {
        log_err ivec::len(a);
        assert (ivec::len(a) == expected_len);
        a += a;
        i -= 1;
        expected_len *= 2u;
    }
}
==18327== Thread 5:
==18327== Invalid read of size 4
==18327==    at 0x8048F33: _rust_main (in /home/banderson/Dev/rust/build/test/run-pass/vec-self-append.stage1)
==18327==    by 0x80490EB: _rust_main_wrap (in /home/banderson/Dev/rust/build/test/run-pass/vec-self-append.stage1)
==18327==    by 0xDEADBEEE: ???
==18327==  Address 0x7131cec is 20 bytes inside a block of size 52 free'd
==18327==    at 0x48DD96C: realloc (vg_replace_malloc.c:525)
==18327==    by 0x4904B53: rust_srv::realloc(void*, unsigned int) (rust_srv.cpp:23)
==18327==    by 0x490B756: memory_region::realloc(void*, unsigned int) (memory_region.cpp:71)
==18327==    by 0x49050BD: rust_kernel::realloc(void*, unsigned int) (rust_kernel.cpp:108)
==18327==    by 0x49016A7: upcall_ivec_resize_shared (rust_upcall.cpp:563)
==18327==    by 0x8048E82: _rust_main (in /home/banderson/Dev/rust/build/test/run-pass/vec-self-append.stage1)
==18327==    by 0x80490EB: _rust_main_wrap (in /home/banderson/Dev/rust/build/test/run-pass/vec-self-append.stage1)
==18327==    by 0xDEADBEEE: ???
==18327==
@brson brson closed this as completed Aug 12, 2011
@brson brson reopened this Aug 12, 2011
@brson
Copy link
Contributor Author

brson commented Aug 12, 2011

I've updated vec-self-append to the above and XFAILed it

@brson brson closed this as completed in 6841f38 Aug 22, 2011
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
* Add option for split phi nodes

* Fix phi

Co-authored-by: William S. Moses <[email protected]>
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
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