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

Clean up thread_locals in EOS VM OC #1503

Open
linh2931 opened this issue Aug 16, 2023 · 0 comments
Open

Clean up thread_locals in EOS VM OC #1503

linh2931 opened this issue Aug 16, 2023 · 0 comments

Comments

@linh2931
Copy link
Member

Please see the comments by @spoonincode in (#1498 (comment))

(obviously not in this PR) but I'd really like for us to noodle on how to move away from these thread_locals, they have dangerous lifetime semantics imo. In this particular example, when eosvmoc_tier is destroyed, cc is destroyed, but the exec created with a reference to that cc lives on. So if executor's dtor (which will run well after eosvmoc_tier's dtor) touches the code_cache_async that was passed to it via reference: bad news! It's a real trap -- passing a reference to some object to the ctor of an object implies that reference will be valid for the lifetime of the object.. but it's not true here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants