-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Warning required when total size of indices is greater than INT_MAX #6758
Comments
Hi @yanang007. Thanks for reporting this! Taichi currently uses i32 for indexing so this behavior is known.
Thanks for the suggestion! We should give a warning indeed. |
Thanks for your quick reply! Then should I close this issue or change it into a feature request for the warning message? |
Sorry to repoen the issue. I did see a warning from SNode::create_node, but code like this will still break the program without any alarm.
A good idea may be to introduce a unified check for total size somewhere. |
Yep. Thanks for the suggestion. I've just marked this issue as a feature request. |
✨ 新的taichi函数封装与with-able FieldBuilder
✨ 新的taichi函数封装与with-able FieldBuilder
✨ 新的taichi函数封装与with-able FieldBuilder
…v#6846) Issue: fix taichi-dev#6758 ### Brief Summary This PR adds a boundary check for ndarray similar to https://github.com/taichi-dev/taichi/blob/a87b98fd40fc93dbe1bdf8c4e3932a6078379fa3/taichi/ir/snode.cpp#L89-L93 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
✨ 新的taichi函数封装与with-able FieldBuilder
✨ 新的taichi函数封装与with-able FieldBuilder
Describe the bug
Accessing elements in ndarray with size greater than INT_MAX will randomly receive SIGSEGV. (Arch=x64)
To Reproduce
where 5578 is a random number. Here is an example to find one.
Log/Screenshots
Additional comments
Please let me know if diagnoses or any other information is needed.
It may be a potential int overflow in indexing, but I haven't seen any for now.
taichi/taichi/program/ndarray.cpp
Lines 135 to 158 in 797feaf
I noticed that taichi has been tested on even larger scales. If this is an intended behavior or a known limitation for CPU arch, it probably would be better to give a warning about it.
The text was updated successfully, but these errors were encountered: