Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Apparent write beyond end of buffer in jit-compiled code #7343

Closed
abadams opened this issue Feb 13, 2023 · 0 comments · Fixed by #7345
Closed

Apparent write beyond end of buffer in jit-compiled code #7343

abadams opened this issue Feb 13, 2023 · 0 comments · Fixed by #7345
Assignees
Labels

Comments

@abadams
Copy link
Member

abadams commented Feb 13, 2023

The following code writes beyond the end of Buffer r0 inside the JIT-compiled code. Given the schedule, I believe the minimum viable output size is 1024 + 16, starting at -1, not 1024 starting at zero, so it should be failing a bounds check, but it's not.

    Var x;
    const int size = 1024;
    Func h;
    h(x) = {0, 0};
    RDom r(0, size);
    h(r) = {h(r - 1)[0], 0};

    Var xo, xi;
    h.split(x, xo, xi, 16, TailStrategy::RoundUp);

    Buffer<int> r0(size);
    Buffer<int> r1(size);
    h.realize({r0, r1});
@abadams abadams added the bug label Feb 13, 2023
@abadams abadams self-assigned this Feb 13, 2023
abadams added a commit that referenced this issue Feb 13, 2023
Tuple outputs weren't getting appropriate bounds checks due to
overzealous culling of uninteresting code in the add_image_checks pass.
steven-johnson pushed a commit that referenced this issue Feb 14, 2023
Fix #7343

Tuple outputs weren't getting appropriate bounds checks due to
overzealous culling of uninteresting code in the add_image_checks pass.
ardier pushed a commit to ardier/Halide-mutation that referenced this issue Mar 3, 2024
Fix halide#7343

Tuple outputs weren't getting appropriate bounds checks due to
overzealous culling of uninteresting code in the add_image_checks pass.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant