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

Vector operations can produce underread on allocated buffers #3738

Open
steven-johnson opened this issue Mar 18, 2019 · 2 comments
Open

Vector operations can produce underread on allocated buffers #3738

steven-johnson opened this issue Mar 18, 2019 · 2 comments

Comments

@steven-johnson
Copy link
Contributor

Some failures in #3252 appear to be happening because we can generate code that will do vector loads from before the allocation start of a malloc'ed buffer; in the past, this has never been an issue because our halide_malloc implementation overallocates at the start in order to ensure proper alignment (so the 'illegal' read is still from allocated memory). The change to use an already-aligned alloc exposes this issue; it appears that the same issue is triggering at least some failures in the experimental WASM branch in conjunction with the JIT tests (which is also using an allocator with no 'slop' at the beginning).

Options:

  • Fix codegen so that we can never underread an allocated buffer.
  • Explicitly quantify the apron sizes needed both before and after an allocated buffer, and ensure that all allocators follow the rules (either via better code in the caller or by stricter implementation requirements in halide_malloc).
@steven-johnson
Copy link
Contributor Author

Did this really get fixed? I think it's still an issue.

@dsharletg
Copy link
Contributor

It looks like it probably is. I saw the reference from #1044 last, but it looks like that was also a stale issue being closed, not the PR that I thought it was.

@dsharletg dsharletg reopened this Jul 14, 2021
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

2 participants