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

Debugger panicks if Python cannot be initialized #1177

Open
rmecham opened this issue Nov 8, 2024 · 0 comments
Open

Debugger panicks if Python cannot be initialized #1177

rmecham opened this issue Nov 8, 2024 · 0 comments
Labels
area:Crash Adapter crash. cause:CodeLLDB The cause has been determined to be in this project

Comments

@rmecham
Copy link

rmecham commented Nov 8, 2024

OS: macOS Sonoma 14.7 (but running a dev container with Ubuntu 22.04.5; Linux 47cc581bb18e 6.6.51-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2024-09-12 12:56:22 aarch64 aarch64 aarch64 GNU/Linux)
VSCode version: 1.95.2
CodeLLDB version: 1.11.1
Compiler: Swift 5.10
Debuggee: aarch64-unknown-linux-gnu

When attempting a "Run and Debug" launch, the compilation completes successfully but the debugger session fails to launch. An error message appears saying: "Oops! The debug adapter has terminated abnormally. Source: CodeLLDB" There is also a button to "Open log". With verbose logging enabled, clicking on the "Open log" button yields the following:

Initial debug configuration: {
  type: 'lldb',
  request: 'launch',
  sourceLanguages: [ 'swift' ],
  args: [ 'serve' ],
  cwd: '${workspaceFolder:workspace}',
  name: 'Debug WebServerMain',
  program: '${workspaceFolder:workspace}/.build/debug/WebServerMain',
  preLaunchTask: 'swift: Build Debug WebServerMain',
  env: {
    ** redacted **
  },
  initCommands: [ 'settings set target.disable-aslr false' ],
  __configurationTarget: 6
}
Resolved debug configuration: {
  type: 'lldb',
  request: 'launch',
  sourceLanguages: [ 'swift' ],
  args: [ 'serve' ],
  cwd: '${workspaceFolder:workspace}',
  name: 'Debug WebServerMain',
  program: '${workspaceFolder:workspace}/.build/debug/WebServerMain',
  preLaunchTask: 'swift: Build Debug WebServerMain',
  env: {
    ** redacted **
  },
  initCommands: [ 'settings set target.disable-aslr false' ],
  __configurationTarget: 6,
  expressions: 'native',
  relativePathBase: '/workspace',
  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'auto',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    scriptConfig: {},
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}
liblldb: /usr/lib/liblldb.so
environment: {}
settings: {
  evaluateForHovers: true,
  commandCompletions: true,
  sourceLanguages: [ 'swift' ]
}
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/lldb/__init__.py", line 725, in <module>
    eLanguageTypeExtRenderScript = _lldb.eLanguageTypeExtRenderScript
AttributeError: module '_lldb' has no attribute 'eLanguageTypeExtRenderScript'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'lldb' is not defined
[ERROR codelldb] Initialize Python interpreter: Error:  Fail
    Error Message:
    error: module importing failed: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/plcoder/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/adapter/scripts/codelldb/__init__.py", line 1, in <module>
        from .api import evaluate, wrap, unwrap, get_config, create_webview, display_html, debugger_message
      File "/home/plcoder/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/adapter/scripts/codelldb/api.py", line 1, in <module>
        import lldb
      File "/usr/lib/python3/dist-packages/lldb/__init__.py", line 725, in <module>
        eLanguageTypeExtRenderScript = _lldb.eLanguageTypeExtRenderScript
    AttributeError: module '_lldb' has no attribute 'eLanguageTypeExtRenderScript'
    
[DEBUG codelldb] Connecting to 127.0.0.1:38281
[DEBUG codelldb] New debug session
thread 'main' panicked at adapter/codelldb/src/debug_session.rs:127:33:
mpsc bounded channel requires buffer > 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Debug adapter exit code=101 (0x65), signal=null.

After reverting to CodeLLDB version 1.11.0, the problem went away.

@vadimcn vadimcn changed the title Debugger Fails to Launch with v1.11.1 Debugger panicks if Python cannot be initialized Nov 9, 2024
@vadimcn vadimcn added cause:CodeLLDB The cause has been determined to be in this project area:Crash Adapter crash. labels Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Crash Adapter crash. cause:CodeLLDB The cause has been determined to be in this project
Projects
None yet
Development

No branches or pull requests

2 participants