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

rustc generates overlapping memcpy for swap #5041

Closed
brson opened this issue Feb 19, 2013 · 1 comment
Closed

rustc generates overlapping memcpy for swap #5041

brson opened this issue Feb 19, 2013 · 1 comment
Labels
A-codegen Area: Code generation

Comments

@brson
Copy link
Contributor

brson commented Feb 19, 2013

This is showing up for me under valgrind with any test runner, but the bots aren't seeing it. Here's a reduced test case:

fn main() {
    let mut test = TestDescAndFn {
        desc: TestDesc {
            name: DynTestName(~"test"),
            should_fail: false
        },
        testfn: DynTestFn(|| ()),
    };
    test <-> test;
}

pub enum TestName {
    DynTestName(~str)
}

pub enum TestFn {
    DynTestFn(~fn()),
    DynBenchFn(~fn(&mut int))
}

pub struct TestDesc {
    name: TestName,
    should_fail: bool
}

pub struct TestDescAndFn {
    desc: TestDesc,
    testfn: TestFn,
}
==14043== Source and destination overlap in memcpy(0x65f1378, 0x65f1378, 40)
==14043==    at 0x4C2CC30: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14043==    by 0x400EFE: main::_549c6ab1ca2b3fae::_00 (in /home/brian/dev/rust3/build/x86_64-unknown-linux-gnu/test/run-pass/swap-overlapping.stage1-x86_64-unknown-linux-gnu)
==14043==    by 0x400F9D: _rust_main (in /home/brian/dev/rust3/build/x86_64-unknown-linux-gnu/test/run-pass/swap-overlapping.stage1-x86_64-unknown-linux-gnu)
==14043==    by 0x51AE413: task_start_wrapper(spawn_args*) (rust_task.cpp:162)
brson added a commit to brson/rust that referenced this issue Feb 21, 2013
@catamorphism
Copy link
Contributor

Fixed in 423843e

flip1995 pushed a commit to flip1995/rust that referenced this issue May 27, 2020
multiple_crate_versions: skip dev and build deps

changelog: multiple_crate_versions: skip dev and build deps

Closes rust-lang#5041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation
Projects
None yet
Development

No branches or pull requests

2 participants