-
Notifications
You must be signed in to change notification settings - Fork 111
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
Internal Panic: Index Out of Bounds #290
Comments
The issue is the loom Cell is being reused across loom runs. Fundamentally, all loom objects must be created in each iteration of the model. This is why switching to a loom thread-local fixes it. The best we can do is catch this and panic w/ a better error message. Off the top of my head, each iteration of the model could get a unique identifier. Loom objects could then include the iteration identifier and panic if the object's identifier doesn't match the runtime's identifier. Is this something you want to look into doing? |
This seems like an easy enough issue for a new contributor to pick up. I would like to give it a try. From a cursory glance at the source code, I figured I could try the following:
Does this seem like a reasonable approach? |
Actually, the |
The following program:
...panics with:
The issue does not occur if
loom::thread_local!
(but unfortunately it took me several days to realize that loom even provided a mocked version ofthread_local!
and that I might want to use it).The text was updated successfully, but these errors were encountered: