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

numba decorated function cause debugger assertion failure #1800

Closed
philosofool opened this issue Dec 31, 2024 · 1 comment
Closed

numba decorated function cause debugger assertion failure #1800

philosofool opened this issue Dec 31, 2024 · 1 comment
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@philosofool
Copy link

I can't run the Python debugger when any breakpoint is enabled if there is a numba.njit enabled.

Steps to replicate

  1. Paste the following into a .py file:
import numba 

# No idea if this matters.
assert numba.__version__ == '0.60.0'

@numba.njit
def func(x):
   return x

def do(x):
   return func(x)
   

if __name__ == '__main__':
   do(1)
  1. Place a breakpoint anywhere in the file. (I used line 14 do(1))
  2. Run with the Python debugger.

Expected

The file runs without error.

Observed

The debugger raises the following error, pointing to line 10 func(x):

Exception has occurred: AssertionError
<code object do at 0x7f5279943bb0, file "/code/fastsys/tests/test_utils/import_numba.py", line 9> != <code object func at 0x7f52799af9e0, file "/code/fastsys/tests/test_utils/import_numba.py", line 5>
KeyError: (5, '/code/fastsys/tests/test_utils/import_numba.py', <code object func at 0x7f52799af9e0, file "/code/fastsys/tests/test_utils/import_numba.py", line 5>)

During handling of the above exception, another exception occurred:

  File "/code/fastsys/tests/test_utils/import_numba.py", line 10, in do
    return func(x)
           ^^^^^^^
  File "/code/fastsys/tests/test_utils/import_numba.py", line 14, in <module>
    do(1)
AssertionError: <code object do at 0x7f5279943bb0, file "/code/fastsys/tests/test_utils/import_numba.py", line 9> != <code object func at 0x7f52799af9e0, file "/code/fastsys/tests/test_utils/import_numba.py", line 5>

Details

Version: 1.94.2
Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427
Date: 2024-10-09T16:08:44.566Z
Electron: 30.5.1
ElectronBuildId: 10262041
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Linux x64 6.0.12-76060012-generic

Installed version of the VSCode Python Extension: v2024.22.1

I'm running Python 3.12.7 with numba version 0.60.0.

launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        },
    ]
}
@eleanorjboyd eleanorjboyd transferred this issue from microsoft/vscode-python-debugger Jan 7, 2025
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jan 7, 2025
@rchiodo
Copy link
Contributor

rchiodo commented Jan 7, 2025

Numba can't be used with 3.12 and debugpy. See this issue for more information:
#1719

@rchiodo rchiodo closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants