-
Notifications
You must be signed in to change notification settings - Fork 323
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
Debug.breakpoint
is sometimes not seeing variables defined in the parent scope, nor ones defined within the REPL; only if IR caches are enabled
#8405
Comments
Another interaction with the above program:
Here we can see that first accessing This time I've run it under a debugger and so we can pause the threads and see what the JVM is doing: threads_report.txt This is weird as it looks as if it is just waiting to read next line from the REPL. But we clearly see it is not, as we did not get another |
Now this is weird, it seems that even if I just turn on regular
This is quite serious as it makes the REPL virtually unusable. |
Part of this issue seems to have been fixed by #8496 - after rebuilding I no longer get the behaviour where the REPL hangs forever (waiting for input). However, the issue with exceptions when trying to inspect variables in scope still remains:
|
I was able to reproduce the original issue to some extent. Sometimes, when in the debugger REPL, typing just
However, when running with |
This is the stack trace in the problematic spot:
It appears that the problem is in |
I don't know how to proceed further. Since |
Why? It shows that our IR caches have a bug. We should fix that, no? |
I just did a fully clean build with the above patch applied, and run the repro above. I don't see the scary frame access errors indeed, but it is still a defect that I cannot access the variables in scope in the REPL:
Nor if I define a new variable, it cannot be accessed:
I agree this is not the most pressing issue, as it does not affect our end-users directly. But it does very much limit the usability of our Interestingly enough, indeed if I run with
That is good to know - that there is a simple and robust workaround. It still makes me very worried - what is happening in the IR caching logic that makes such weird errors. This definitely should not be happening with IR caches enabled and I'm worried that the bug that is causing this behaviour may also cause unexpected behaviour in our regular user code - which may be much harder to debug than this simple example. |
Debug.breakpoint
is sometimes not seeing variables defined in the parent scope, nor ones defined within the REPL; only if IR caches are enabled
Latest status is described in this comment below.
I'm not exactly sure what circumstances are needed to trigger this exactly, but I know a deterministic repro that allows me to reproduce the scenario.
First, apply the following diff to the current develop and rebuild the engine+libs (
buildEngineDistribution
):Then we can run the following file in the command line:
That will print the following output:
and put us into an interactive REPL.
Now you can reproduce the following interaction:
So we can see that first, defining a new variable called
xyz = 2+2
causes some weird crash within the handling of the local frame, which is then recovered. For some reason afterwards, thefile
argument that should be in scope is not visible. Then we try to check the value ofreader
and that hangs the JVM.The text was updated successfully, but these errors were encountered: