-
Notifications
You must be signed in to change notification settings - Fork 767
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
RangeError: Maximum call stack size exceeded with library Firedrake #1315
Comments
This is one of the few errors we had left after our big release, so I'm glad to finally know what code caused it. |
@salazardetroya We just put out 2021.5.3 moments ago; can you test with that version to verify that this still occurs? |
I still get the same error with 2021.5.3. The new log is:
|
Thanks. |
I'm trying to install the firedrake package, but it's a pretty odd beast, and I'm running into errors during installation:
|
Instructions for installation are here: https://www.firedrakeproject.org/download.html |
If you want to debug this do you want to do it over on our side rather than here? |
Thanks for offering to help, but stack overflow (infinite recursion) bugs are typically quite difficult to debug. We really need a local repro case for this one. |
FWIW I tried to install firedrake locally by pip installing the repo, but it appears as though some of its dependencies don't correctly indicate theirs and It'd be nice to know how the original issue filer set up their environment, or if @wence- can reproduce it as well. |
@jakebailey I followed the instructions in https://www.firedrakeproject.org/download.html. Firedrake heavily depends on other non-python libraries such as PETSc. I believe this is why it cannot be easily installed through pip. |
Okay, thanks. I'll have to try and pull out my non-ARM Mac to see if I can get this to work. Unfortunately, the script assumes an |
There is also a docker image https://hub.docker.com/r/firedrakeproject/firedrake . I am not sure if it is possible to debug through docker with the VSCode container capabilities. |
You can ask not to install the dependencies with --no-package-manager (we have arch users). I don't know what the relevant package names are, but the build deps we need are listed here https://www.firedrakeproject.org/download.html --minimal-petsc will be helpful to speed things up. |
I guess I meant the install issues. FWIW, I don't tend to use vscode myself but could reproduce the error @salazardetroya reports. |
I thought of a way that you can help if you're able to repro the problem in VS Code. Add the following options to your
Then repro the crash and look at the Output window for Pylance. I'm interested in the last hundred or so lines of log output before the crash. Thanks! |
I think you want something like this:
|
Thanks for the logs. Unfortunately, there's not enough information there for me to diagnose the problem. Let's continue to look for ways to repro it locally. |
I'm happy to try and debug getting a firedrake environment up for you to reproduce. The homebrew-based json decoder error you posted in #1315 (comment) is one I haven't seen before (but I don't know what macos hardware/release you are on). |
I've personally been unable to run the script on my Arch machine; I think I have everything, but it fails complaining about some missing blas symbols from numpy very late into the build (confusing, because I have openblas). Next thing I'll try is a Mac. |
Can you try with |
Thanks, the latter let me complete the build on Linux and I can now reproduce the issue:
|
Full stack trace by increasing the limit from the default 10. Working to get the evaluator tracing force enabled at the CLI.
|
Narrowed down to just: from pyop2.base import Global
Global() (Which is thankfully reproducible just from the PyOP2 repo without any build steps.) |
Big thanks to @jakebailey for helping to track down a straightforward repro case. I was able to find and fix the bug. It was triggered by a complex interaction between various unannotated methods. This included a class-based decorator Pyright (the type checker that underlies pylance) contains various recursion checks, but it was missing one in this particular call chain. The fix was as easy as adding this check. |
Thanks!! I will check the daily build for the fix. |
We publish a new version of pylance approximately once a week, typically on Wed or Thurs. We'll update this bug report when a version is released with this fix. |
Thanks |
This issue has been fixed in version 2021.5.4, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202154-26-may-2021 |
Environment data
Expected behaviour
Correct highlighting in the attached script (at the bottom) using the firedrake library (https://github.com/firedrakeproject/firedrake):
Actual behaviour
I am getting the error
but only if the function
foo()
is included. The first linesby themselves are ok
Logs
Code Snippet / Additional information
The text was updated successfully, but these errors were encountered: