Open
Description
Behaviour
Expected vs. Actual
Steps to reproduce:
- create interactive job with singularity compute
- open vscode link, the remote environment will be open, and debug python by attach running process id
Please contact @shantnu Suman, if you need to reproduce it
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.5
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
- Value of the
python.languageServer
setting: Default
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Attaching to PID: 1576 (elapsed: 1.00s).
Attaching to PID: 1576 (elapsed: 2.00s).
Attaching to PID: 1576 (elapsed: 3.00s).
Attaching to PID: 1576 (elapsed: 4.01s).
Attaching to PID: 1576 (elapsed: 5.01s).
Attaching to PID: 1576 (elapsed: 6.01s).
Attaching to PID: 1576 (elapsed: 7.01s).
Attaching to PID: 1576 (elapsed: 8.01s).
Attaching to PID: 1576 (elapsed: 9.01s).
Attaching to PID: 1576 (elapsed: 10.01s).
The attach to PID is taking longer than expected.
On Linux it's possible to customize the value of
`PYDEVD_GDB_SCAN_SHARED_LIBRARIES` so that fewer libraries.
are scanned when searching for the needed symbols.
i.e.: set in your environment variables (and restart your editor/client
so that it picks up the updated environment variable value):
PYDEVD_GDB_SCAN_SHARED_LIBRARIES=libdl, libltdl, libc, libfreebl3
-- the actual library may be different (the gdb output typically
-- writes the libraries that will be used, so, it should be possible
-- to test other libraries if the above doesn't work).
--- Starting attach to pid: 1576 ---
[New LWP 1581]
[New LWP 1584]
[New LWP 1586]
[New LWP 1588]
[New LWP 1590]
[New LWP 1592]
[New LWP 1595]
[New LWP 1597]
[New LWP 1599]
[New LWP 1601]
[New LWP 1604]
[New LWP 1606]
[New LWP 1607]
[New LWP 1610]
[New LWP 1614]
[New LWP 1615]
[New LWP 1616]
[New LWP 1617]
[New LWP 1620]
[New LWP 1624]
[New LWP 1625]
[New LWP 1626]
[New LWP 1627]
[New LWP 1630]
[New LWP 1633]
[New LWP 1636]
[New LWP 1638]
[New LWP 1639]
[New LWP 1640]
[New LWP 1641]
[New LWP 1642]
[New LWP 1644]
[New LWP 1653]
[New LWP 1654]
[New LWP 1672]
[New LWP 1673]
[New LWP 1674]
[New LWP 1675]
[New LWP 1676]
[New LWP 1677]
[New LWP 1678]
[New LWP 1679]
[New LWP 1680]
[New LWP 1681]
[New LWP 1682]
[New LWP 1683]
[New LWP 1684]
[New LWP 1685]
[New LWP 1693]
[New LWP 1694]
[New LWP 1695]
[New LWP 1696]
[New LWP 1697]
[New LWP 1698]
[New LWP 1699]
[New LWP 1700]
[New LWP 1701]
[New LWP 1702]
[New LWP 1703]
[New LWP 1704]
[New LWP 1705]
[New LWP 1706]
[New LWP 1707]
[New LWP 1711]
[New LWP 1713]
[New LWP 1716]
[New LWP 1717]
[New LWP 1719]
[New LWP 1721]
[New LWP 1723]
[New LWP 1725]
[New LWP 1727]
[New LWP 1730]
[New LWP 1737]
[New LWP 1739]
[New LWP 1748]
[New LWP 1761]
[New LWP 1763]
[New LWP 1766]
[New LWP 1772]
[New LWP 1773]
[New LWP 1774]
[New LWP 1775]
[New LWP 1776]
[New LWP 1778]
[New LWP 1779]
[New LWP 1780]
[New LWP 1781]
[New LWP 1782]
[New LWP 1783]
[New LWP 1784]
[New LWP 1785]
[New LWP 1786]
[New LWP 1787]
[New LWP 1788]
[New LWP 1789]
[New LWP 1790]
[New LWP 1791]
[New LWP 1792]
[New LWP 1794]
[New LWP 1799]
[New LWP 1800]
[New LWP 1802]
[New LWP 1812]
[New LWP 1813]
[New LWP 1814]
[New LWP 1815]
[New LWP 1816]
[New LWP 1817]
[New LWP 1818]
[New LWP 1819]
[New LWP 1820]
[New LWP 1821]
[New LWP 1822]
[New LWP 1823]
[New LWP 1824]
[New LWP 1825]
[New LWP 1826]
[New LWP 1827]
[New LWP 1828]
[New LWP 1829]
[New LWP 1830]
[New LWP 1831]
[New LWP 1832]
[New LWP 1833]
[New LWP 1834]
[New LWP 1840]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
warning: Loadable section ".note.gnu.property" outside of ELF segments
0x00007fa37385ffcb in select () from /lib/x86_64-linux-gnu/libc.so.6
The target architecture is set automatically (currently i386:x86-64)
Attach to PID failed.
$1 = (void *) 0x0
No symbol "DoAttach" in current context.
[Inferior 1 (process 1576) detached]
E+00009.876: Code injection into PID=1576 failed:
Traceback (most recent call last):
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/../debugpy/server/cli.py", line 391, in attach_to_pid
add_code_to_python_process.run_python_code(
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py", line 471, in run_python_code_linux
subprocess.check_call(' '.join(cmd), shell=True, env=env)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'gdb --nw --nh --nx --pid 1576 --batch --eval-command='set scheduler-locking off' --eval-command='set architecture auto' --eval-command='call (void*)dlopen("/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_linux_amd64.so", 2)' --eval-command='sharedlibrary attach_linux_amd64' --eval-command='call (int)DoAttach(0, "import codecs;import json;import sys;decode = lambda s: codecs.utf_8_decode(bytearray(s))[0] if s is not None else None;script_dir = decode([47, 104, 111, 109, 101, 47, 97, 105, 115, 99, 117, 115, 101, 114, 47, 46, 118, 115, 99, 111, 100, 101, 45, 115, 101, 114, 118, 101, 114, 47, 101, 120, 116, 101, 110, 115, 105, 111, 110, 115, 47, 109, 115, 45, 112, 121, 116, 104, 111, 110, 46, 112, 121, 116, 104, 111, 110, 45, 50, 48, 50, 51, 46, 50, 48, 46, 48, 47, 112, 121, 116, 104, 111, 110, 70, 105, 108, 101, 115, 47, 108, 105, 98, 47, 112, 121, 116, 104, 111, 110, 47, 100, 101, 98, 117, 103, 112, 121, 47, 97, 100, 97, 112, 116, 101, 114, 47, 46, 46, 47, 46, 46, 47, 100, 101, 98, 117, 103, 112, 121, 47, 46, 46, 47, 100, 101, 98, 117, 103, 112, 121, 47, 115, 101, 114, 118, 101, 114]);setup = json.loads(decode([123, 34, 109, 111, 100, 101, 34, 58, 32, 34, 99, 111, 110, 110, 101, 99, 116, 34, 44, 32, 34, 97, 100, 100, 114, 101, 115, 115, 34, 58, 32, 91, 34, 49, 50, 55, 46, 48, 46, 48, 46, 49, 34, 44, 32, 52, 49, 51, 57, 57, 93, 44, 32, 34, 119, 97, 105, 116, 95, 102, 111, 114, 95, 99, 108, 105, 101, 110, 116, 34, 58, 32, 102, 97, 108, 115, 101, 44, 32, 34, 108, 111, 103, 95, 116, 111, 34, 58, 32, 110, 117, 108, 108, 44, 32, 34, 97, 100, 97, 112, 116, 101, 114, 95, 97, 99, 99, 101, 115, 115, 95, 116, 111, 107, 101, 110, 34, 58, 32, 34, 57, 55, 98, 98, 100, 55, 97, 48, 51, 53, 52, 99, 99, 97, 52, 57, 102, 56, 49, 55, 52, 98, 52, 54, 49, 101, 49, 56, 49, 49, 50, 98, 98, 56, 97, 56, 99, 54, 56, 100, 99, 54, 49, 50, 97, 99, 52, 52, 100, 98, 99, 102, 101, 99, 101, 49, 48, 48, 101, 55, 102, 48, 56, 50, 34, 125]));sys.path.insert(0, script_dir);import attach_pid_injected;del sys.path[0];attach_pid_injected.attach(setup);", 0)'' returned non-zero exit status 1.
Stack where logged:
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/../debugpy/server/cli.py", line 398, in attach_to_pid
log.reraise_exception("Code injection into PID={0} failed:", pid)
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/../debugpy/common/log.py", line 222, in reraise_exception
_exception(format_string, *args, **kwargs)
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/../debugpy/server/cli.py", line 398, in attach_to_pid
log.reraise_exception("Code injection into PID={0} failed:", pid)
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/../debugpy/server/cli.py", line 391, in attach_to_pid
add_code_to_python_process.run_python_code(
File "/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py", line 471, in run_python_code_linux
subprocess.check_call(' '.join(cmd), shell=True, env=env)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'gdb --nw --nh --nx --pid 1576 --batch --eval-command='set scheduler-locking off' --eval-command='set architecture auto' --eval-command='call (void*)dlopen("/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_linux_amd64.so", 2)' --eval-command='sharedlibrary attach_linux_amd64' --eval-command='call (int)DoAttach(0, "import codecs;import json;import sys;decode = lambda s: codecs.utf_8_decode(bytearray(s))[0] if s is not None else None;script_dir = decode([47, 104, 111, 109, 101, 47, 97, 105, 115, 99, 117, 115, 101, 114, 47, 46, 118, 115, 99, 111, 100, 101, 45, 115, 101, 114, 118, 101, 114, 47, 101, 120, 116, 101, 110, 115, 105, 111, 110, 115, 47, 109, 115, 45, 112, 121, 116, 104, 111, 110, 46, 112, 121, 116, 104, 111, 110, 45, 50, 48, 50, 51, 46, 50, 48, 46, 48, 47, 112, 121, 116, 104, 111, 110, 70, 105, 108, 101, 115, 47, 108, 105, 98, 47, 112, 121, 116, 104, 111, 110, 47, 100, 101, 98, 117, 103, 112, 121, 47, 97, 100, 97, 112, 116, 101, 114, 47, 46, 46, 47, 46, 46, 47, 100, 101, 98, 117, 103, 112, 121, 47, 46, 46, 47, 100, 101, 98, 117, 103, 112, 121, 47, 115, 101, 114, 118, 101, 114]);setup = json.loads(decode([123, 34, 109, 111, 100, 101, 34, 58, 32, 34, 99, 111, 110, 110, 101, 99, 116, 34, 44, 32, 34, 97, 100, 100, 114, 101, 115, 115, 34, 58, 32, 91, 34, 49, 50, 55, 46, 48, 46, 48, 46, 49, 34, 44, 32, 52, 49, 51, 57, 57, 93, 44, 32, 34, 119, 97, 105, 116, 95, 102, 111, 114, 95, 99, 108, 105, 101, 110, 116, 34, 58, 32, 102, 97, 108, 115, 101, 44, 32, 34, 108, 111, 103, 95, 116, 111, 34, 58, 32, 110, 117, 108, 108, 44, 32, 34, 97, 100, 97, 112, 116, 101, 114, 95, 97, 99, 99, 101, 115, 115, 95, 116, 111, 107, 101, 110, 34, 58, 32, 34, 57, 55, 98, 98, 100, 55, 97, 48, 51, 53, 52, 99, 99, 97, 52, 57, 102, 56, 49, 55, 52, 98, 52, 54, 49, 101, 49, 56, 49, 49, 50, 98, 98, 56, 97, 56, 99, 54, 56, 100, 99, 54, 49, 50, 97, 99, 52, 52, 100, 98, 99, 102, 101, 99, 101, 49, 48, 48, 101, 55, 102, 48, 56, 50, 34, 125]));sys.path.insert(0, script_dir);import attach_pid_injected;del sys.path[0];attach_pid_injected.attach(setup);", 0)'' returned non-zero exit status 1.
PYDEVD_GDB_SCAN_SHARED_LIBRARIES not set (scanning all libraries for needed symbols).
Running: gdb --nw --nh --nx --pid 1576 --batch --eval-command='set scheduler-locking off' --eval-command='set architecture auto' --eval-command='call (void*)dlopen("/home/aiscuser/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_linux_amd64.so", 2)' --eval-command='sharedlibrary attach_linux_amd64' --eval-command='call (int)DoAttach(0, "import codecs;import json;import sys;decode = lambda s: codecs.utf_8_decode(bytearray(s))[0] if s is not None else None;script_dir = decode([47, 104, 111, 109, 101, 47, 97, 105, 115, 99, 117, 115, 101, 114, 47, 46, 118, 115, 99, 111, 100, 101, 45, 115, 101, 114, 118, 101, 114, 47, 101, 120, 116, 101, 110, 115, 105, 111, 110, 115, 47, 109, 115, 45, 112, 121, 116, 104, 111, 110, 46, 112, 121, 116, 104, 111, 110, 45, 50, 48, 50, 51, 46, 50, 48, 46, 48, 47, 112, 121, 116, 104, 111, 110, 70, 105, 108, 101, 115, 47, 108, 105, 98, 47, 112, 121, 116, 104, 111, 110, 47, 100, 101, 98, 117, 103, 112, 121, 47, 97, 100, 97, 112, 116, 101, 114, 47, 46, 46, 47, 46, 46, 47, 100, 101, 98, 117, 103, 112, 121, 47, 46, 46, 47, 100, 101, 98, 117, 103, 112, 121, 47, 115, 101, 114, 118, 101, 114]);setup = json.loads(decode([123, 34, 109, 111, 100, 101, 34, 58, 32, 34, 99, 111, 110, 110, 101, 99, 116, 34, 44, 32, 34, 97, 100, 100, 114, 101, 115, 115, 34, 58, 32, 91, 34, 49, 50, 55, 46, 48, 46, 48, 46, 49, 34, 44, 32, 52, 49, 51, 57, 57, 93, 44, 32, 34, 119, 97, 105, 116, 95, 102, 111, 114, 95, 99, 108, 105, 101, 110, 116, 34, 58, 32, 102, 97, 108, 115, 101, 44, 32, 34, 108, 111, 103, 95, 116, 111, 34, 58, 32, 110, 117, 108, 108, 44, 32, 34, 97, 100, 97, 112, 116, 101, 114, 95, 97, 99, 99, 101, 115, 115, 95, 116, 111, 107, 101, 110, 34, 58, 32, 34, 57, 55, 98, 98, 100, 55, 97, 48, 51, 53, 52, 99, 99, 97, 52, 57, 102, 56, 49, 55, 52, 98, 52, 54, 49, 101, 49, 56, 49, 49, 50, 98, 98, 56, 97, 56, 99, 54, 56, 100, 99, 54, 49, 50, 97, 99, 52, 52, 100, 98, 99, 102, 101, 99, 101, 49, 48, 48, 101, 55, 102, 48, 56, 50, 34, 125]));sys.path.insert(0, script_dir);import attach_pid_injected;del sys.path[0];attach_pid_injected.attach(setup);", 0)'
User Settings
Multiroot scenario, following user settings may not apply:
languageServer: "Pylance"
testing
• pytestEnabled: true