{"record":{"id":"e875469ac0dcf1d1","repo":"JetBrains/intellij-community","slug":"internal-exception-invalid-stackframe","errorCode":null,"errorMessage":"Internal exception - invalid stackframe","messagePattern":"Internal exception - invalid stackframe","errorType":"exception","errorClass":"EvaluateException","httpStatus":null,"severity":"warning","filePath":"java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/NodeDescriptorImpl.java","lineNumber":73,"sourceCode":"    myUserData.put(key, value);\n  }\n\n  public void updateRepresentation(EvaluationContextImpl context, DescriptorLabelListener labelListener) {\n    updateRepresentationNoNotify(context, labelListener);\n    labelListener.labelChanged();\n  }\n\n  public void updateRepresentationNoNotify(EvaluationContextImpl context, DescriptorLabelListener labelListener) {\n    try {\n      try {\n        myEvaluateException = null;\n        myLabel = calcRepresentation(context, labelListener);\n      }\n      catch (InconsistentDebugInfoException e) {\n        throw new EvaluateException(JavaDebuggerBundle.message(\"error.inconsistent.debug.info\"));\n      }\n      catch (InvalidStackFrameException e) {\n        throw new EvaluateException(JavaDebuggerBundle.message(\"error.invalid.stackframe\"));\n      }\n      catch (ObjectCollectedException e) {\n        throw EvaluateExceptionUtil.OBJECT_WAS_COLLECTED;\n      }\n      catch (VMDisconnectedException e) {\n        throw e;\n      }\n      catch (RuntimeException e) {\n        if (e.getCause() instanceof InterruptedException) {\n          throw e;\n        }\n        if (context != null && context.getVirtualMachineProxy().canBeModified()) { // do not care in read only vms\n          LOG.debug(e);\n        }\n        else {\n          LOG.warn(e);\n        }\n        throw new EvaluateException(JavaDebuggerBundle.message(\"internal.debugger.error\"));","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/NodeDescriptorImpl.java#L55-L91","documentation":"NodeDescriptorImpl.updateRepresentationNoNotify catches InvalidStackFrameException — thrown by JDI when an operation references a StackFrame that is no longer valid (the thread resumed or popped its frame) — while computing a node label, and converts it into this EvaluateException. The node's label then shows the 'invalid stackframe' message instead of a value.","triggerScenarios":"The debugged thread resumed (step over/return, resume, evaluate expression with side effects) between the moment the variables tree queued label updates and the moment they ran; or the frame was invalidated by a breakpoint hit or frame pop while the tree was still refreshing.","commonSituations":"Rapidly stepping while the Variables view is still asynchronously computing labels; evaluating an expression that resumes the thread (method invocation in the debugger); breakpoints that trigger during label evaluation; race after VM resume.","solutions":["Refresh the debugger view (click the frame/thread again in the Frames panel) to rebuild the tree against the current, valid frame","Avoid evaluate-with-side-effects while the variables tree is updating; pause first, then evaluate","If it happens constantly, disable asynchronous labels (Registry: debugger.async.stack.traces / related async label options) or update the IDE — races here have been fixed over versions","Restart the debug session if the VM state is fully desynchronized"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check frame validity before triggering label computation\nboolean frameValid = threadReference.isSuspended() && frame != null && frame.is_valid();","typeGuard":null,"tryCatchPattern":"try {\n  descriptor.updateRepresentationNoNotify(context, listener);\n} catch (EvaluateException e) {\n  // frame went invalid (thread resumed): simply skip — tree refresh will rebuild\n}","preventionTips":["Do not resume/step while the Variables view is still loading","Avoid debugger evaluations that invoke methods (they resume the thread) during tree updates","Refresh the frames view after each step to resynchronize descriptors"],"tags":["intellij-debugger","jdi","stack-frame","race-condition","variables-view"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}