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

Add ability to re-enable disabled hooks post-restore #16959

Closed
dsouzai opened this issue Mar 20, 2023 · 2 comments · Fixed by #19754
Closed

Add ability to re-enable disabled hooks post-restore #16959

dsouzai opened this issue Mar 20, 2023 · 2 comments · Fixed by #19754
Labels
comp:vm criu Used to track CRIU snapshot related work

Comments

@dsouzai
Copy link
Contributor

dsouzai commented Mar 20, 2023

If J9HookDisable succeeds there is no way to re-enable it. This is problematic in CRIU mode as some event that is disabled pre-checkpoint may need to be re-enabled post-restore. Additionally there exists code that uses J9HookDisable as a way to test if a hook is enabled or disabled. Scanning through the code, it seems that there is a desire to have J9HookDisabled invoked because it ensures that the hook is in a well defined state. Therefore, there should be a way to re-enable hooks that have been initialized with J9HOOK_FLAG_DISABLED.

@dsouzai dsouzai added comp:vm criu Used to track CRIU snapshot related work labels Mar 20, 2023
@dsouzai
Copy link
Contributor Author

dsouzai commented Mar 20, 2023

fyi @JasonFengJ9 @tajila

@dsouzai
Copy link
Contributor Author

dsouzai commented Mar 20, 2023

See the discussion in #16960 for more details, but to summarize:

The JIT generates code based on the environment as initialized during VM startup. If it does not use J9HookDisable to determine whether an event can be hooked, and instead only checks the flags, then if a JVMTI agent is loaded later it will not be prevented from requesting that the VM report an event, at which point the compiled code will not be able to request such an event.

As such, the change to the compiler in #16926 will need to be reconsidered depending on the level of JVMTI support we want to have wrt to CRIU. As it stands, if an agent were to attach post-restore, it could request that the VM report throw/catch events but compiled code will fail to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm criu Used to track CRIU snapshot related work
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant