Skip to content

Crash of eval a invalid expression when debug swift With CodeLLDB(v1.11.5) #1313

@popoaichuiniu

Description

@popoaichuiniu

I used lldb of xcode16.0: "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB"

Backstrace:

`[DEBUG codelldb::dap_codec] --> {"command":"evaluate","arguments":{"expression":"event","frameId":1001,"context":"watch"},"type":"request","seq":37}

error: DeliverManager.debug.dylib [0x0000000021020d2e]: invalid Objective-C method DW_TAG_subprogram (DW_TAG_subprogram), please file a bug and attach the file at the start of this error message

Received signal: SIGSEGV

0: backtrace::capture::Backtrace::new

1: codelldb::hook_crashes::handler

2: __sigtramp

3: __ZN5swift8importer24shouldSuppressDeclImportEPKN5clang4DeclE

4: __ZN5swift8importer21addEntryToLookupTableERNS_16SwiftLookupTableEPN5clang9NamedDeclERNS0_12NameImporterE

5: __ZN5swift8importer21addEntryToLookupTableERNS_16SwiftLookupTableEPN5clang9NamedDeclERNS0_12NameImporterE

6: __ZN5swift13ClangImporter14Implementation14loadAllMembersEPNS_4DeclEy

7: __ZNK5swift19IterableDeclContext14loadAllMembersEv

8: __ZN5swift13ClangImporter14Implementation14loadAllMembersEPNS_4DeclEy

9: __ZNK5swift19IterableDeclContext14loadAllMembersEv

10: __ZN5swift13ClangImporter14Implementation19lookupTypeDeclDWARFEN4llvm9StringRefENS_13ClangTypeKindENS2_12function_refIFvPNS_8TypeDeclEEEE

11: __ZN5swift13ClangImporter14lookupTypeDeclEN4llvm9StringRefENS_13ClangTypeKindENS1_12function_refIFvPNS_8TypeDeclEEEE

12: __ZN5swift8Demangle10ASTBuilder19createObjCClassTypeEN4llvm9StringRefE

13: __ZN5swift8Demangle11TypeDecoderINS0_10ASTBuilderEE17decodeMangledTypeEPNS0_4NodeEjb

14: __ZN5swift8Demangle18getTypeForManglingERNS_10ASTContextEN4llvm9StringRefENS_16GenericSignatureE

15: __ZN12lldb_private15SwiftASTContext19ReconstructTypeImplENS_11ConstStringE

16: __ZN12lldb_private15SwiftASTContext15ReconstructTypeENS_11ConstStringE

17: __ZN12lldb_private15SwiftASTContext12GetSwiftTypeENS_12CompilerTypeE

18: __ZNK12lldb_private19SwiftASTManipulator23GetSwiftTypeForVariableERKNS_23SwiftASTManipulatorBase12VariableInfoE

19: __ZN12lldb_private19SwiftASTManipulator31GetVarDeclForVariableInFunctionERKNS_23SwiftASTManipulatorBase12VariableInfoEPN5swift8FuncDeclE

20: __ZN12lldb_private19SwiftASTManipulator20AddExternalVariablesEN4llvm15MutableArrayRefINS_23SwiftASTManipulatorBase12VariableInfoEEE

21: __ZN12lldb_private21SwiftExpressionParser14ParseAndImportERNS_15SwiftASTContext17ScopedDiagnosticsERNSt3__13mapIPKcNS0_15SILVariableInfoENS4_4lessIS7_EENS4_9allocatorINS4_4pairIKS7_S8_EEEEEERjRNS_17DiagnosticManagerE

22: __ZN12lldb_private21SwiftExpressionParser5ParseERNS_17DiagnosticManagerEjj

23: __ZN12lldb_private19SwiftUserExpression29GetTextAndSetExpressionParserERNS_17DiagnosticManagerERNSt3__110unique_ptrINS_25SwiftExpressionSourceCodeENS3_14default_deleteIS5_EEEERNS_16ExecutionContextEPNS_21ExecutionContextScopeE

24: __ZN12lldb_private19SwiftUserExpression5ParseERNS_17DiagnosticManagerERNS_16ExecutionContextENS_15ExecutionPolicyEbb

25: _ZN12lldb_private14UserExpression8EvaluateERNS_16ExecutionContextERKNS_25EvaluateExpressionOptionsEN4llvm9StringRefES7_RNSt3__110shared_ptrINS_11ValueObjectEEERNS_6StatusEPNS8_12basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEPSA

26: _ZN12lldb_private6Target18EvaluateExpressionEN4llvm9StringRefEPNS_21ExecutionContextScopeERNSt3__110shared_ptrINS_11ValueObjectEEERKNS_25EvaluateExpressionOptionsEPNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEPS7

27: __ZN4lldb7SBFrame18EvaluateExpressionEPKcRKNS_19SBExpressionOptionsE

28: __ZN4lldb7SBFrame18EvaluateExpressionEPKc

29: _ZL32_wrap_SBFrame_EvaluateExpressionP7_objectS0

30: _PyCFunction_GetFlags

31: __PyObject_Call

32: __PyEval_EvalFrameDefault

33: __PyEval_EvalFrameDefault

34: __PyFunction_Vectorcall

35: __PyEval_EvalFrameDefault

36: __PyEval_EvalFrameDefault

37: __PyFunction_Vectorcall

38: __PyEval_EvalFrameDefault

39: __PyEval_EvalFrameDefault

40: __PyEval_EvalFrameDefault

41: __PyFunction_Vectorcall

42: __PyEval_EvalFrameDefault

43: __PyEval_EvalFrameDefault

44: __PyEval_EvalFrameDefault

45: _PyEval_EvalCode

46: __PyAST_ExprAsUnicode

47: _PyCMethod_New

48: __PyEval_EvalFrameDefault

49: __PyEval_EvalFrameDefault

50: __PyEval_EvalFrameDefault

51: __PyFunction_Vectorcall

52: __PyEval_EvalFrameDefault

53: __PyEval_EvalFrameDefault

54: __PyFunction_Vectorcall

55: _PyInit__ctypes

56:

57:

58: codelldb::python::PythonSession::evaluate

59: codelldb::debug_session::variables::::evaluate_expr_in_frame

60: codelldb::debug_session::variables::::handle_evaluate_expression

61: codelldb::debug_session::variables::::handle_evaluate

62: codelldb::debug_session::DebugSession::handle_request_args

63: codelldb::debug_session::DebugSession::handle_request

64: tokio::runtime::task::core::Core<T,S>::poll

65: tokio::runtime::task::harness::Harness<T,S>::poll

66: tokio::task::local::LocalSet::tick

67: <tokio::task::local::LocalSet as core::future::future::Future>::poll

68: codelldb::run_debug_session::{{closure}}

69: tokio::runtime::context::runtime::enter_runtime

70: tokio::runtime::runtime::Runtime::block_on

71: codelldb::debug_server

72: codelldb::main

73: std::sys_common::backtrace::__rust_begin_short_backtrace

74: std::rt::lang_start::{{closure}}

75: std::rt::lang_start_internal

76: _main

Debug adapter exit code=255, signal=null.`

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:CrashAdapter crash.cause:LLDBCaused by a bug in LLDB engine. Generally, this is not something I can fix myself.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions