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

StackOverFlow error with 11.6.1 during editing a .cpp file #954

Open
marcelr opened this issue Dec 8, 2024 · 1 comment
Open

StackOverFlow error with 11.6.1 during editing a .cpp file #954

marcelr opened this issue Dec 8, 2024 · 1 comment

Comments

@marcelr
Copy link

marcelr commented Dec 8, 2024

Describe the bug

I get a StackOverflowError after opening a .cpp file in eclipese editor, this opens two dialogs (see below).
This is a show stopper forcing me to edit in vi (which my collegue argues is much fun).

Closing the error dialogs opens them after some seconds of work in the cpp editor again.
Index Rebuild did not help

Here you see the recursion snippet:

java.lang.StackOverflowError
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamedTypeSpecifier.accept(CPPASTNamedTypeSpecifier.java:95)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration.accept(CPPASTParameterDeclaration.java:106)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator.postAccept(CPPASTFunctionDeclarator.java:292)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator.accept(CPPASTDeclarator.java:220)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition.accept(CPPASTFunctionDefinition.java:208)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier.accept(CPPASTCompositeTypeSpecifier.java:201)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration.accept(CPPASTSimpleDeclaration.java:112)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamespaceDefinition.accept(CPPASTNamespaceDefinition.java:144)
        at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:289)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.getDeclarations(CPPVisitor.java:3058)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTranslationUnit.getDefinitionsInAST(CPPASTTranslationUnit.java:155)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTranslationUnit.getDefinitionsInAST(CPPASTTranslationUnit.java:147)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.findDefinition(CPPFunction.java:835)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.getType(CPPFunction.java:385)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.getType(CPPFunction.java:1)
        at org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil.getSignature(IndexCPPSignatureUtil.java:73)
        at org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil.getSignatureHash(IndexCPPSignatureUtil.java:162)
        at org.eclipse.cdt.internal.core.pdom.dom.cpp.CPPFindBinding.findBinding(CPPFindBinding.java:140)
        at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.doAdaptBinding(PDOMCPPLinkage.java:1250)
        at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptBinding(PDOMCPPLinkage.java:1205)
        at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptBinding(PDOMCPPLinkage.java:1185)
        at org.eclipse.cdt.internal.core.pdom.PDOM.findBindingInLinkage(PDOM.java:1220)
        at org.eclipse.cdt.internal.core.pdom.PDOM.adaptBinding(PDOM.java:1202)
        at org.eclipse.cdt.internal.core.pdom.PDOM.adaptBinding(PDOM.java:1185)
        at org.eclipse.cdt.internal.core.index.CIndex.adaptBinding(CIndex.java:491)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.areEquivalentBindings(CPPVisitor.java:1758)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.areEquivalentBindings(CPPVisitor.java:1746)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor$CollectDeclarationsAction.isDeclarationBinding(CPPVisitor.java:1713)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor$CollectDeclarationsAction.visit(CPPVisitor.java:1700)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName.accept(CPPASTName.java:158)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTQualifiedName.accept(CPPASTQualifiedName.java:246)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTUsingDeclaration.accept(CPPASTUsingDeclaration.java:100)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarationStatement.accept(CPPASTDeclarationStatement.java:82)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement.accept(CPPASTCompoundStatement.java:103)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIfStatement.accept(CPPASTIfStatement.java:160)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement.accept(CPPASTCompoundStatement.java:103)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition.accept(CPPASTFunctionDefinition.java:225)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier.accept(CPPASTCompositeTypeSpecifier.java:201)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration.accept(CPPASTSimpleDeclaration.java:112)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamespaceDefinition.accept(CPPASTNamespaceDefinition.java:144)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamespaceDefinition.accept(CPPASTNamespaceDefinition.java:144)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamespaceDefinition.accept(CPPASTNamespaceDefinition.java:144)
        at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:289)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.getDeclarations(CPPVisitor.java:3058)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTranslationUnit.getDefinitionsInAST(CPPASTTranslationUnit.java:155)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTranslationUnit.getDefinitionsInAST(CPPASTTranslationUnit.java:147)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.findDefinition(CPPFunction.java:835)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.getType(CPPFunction.java:385)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.getType(CPPFunction.java:1)
        at org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil.getSignature(IndexCPPSignatureUtil.java:73)
        at org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil.getSignatureHash(IndexCPPSignatureUtil.java:162)
        at org.eclipse.cdt.internal.core.pdom.dom.cpp.CPPFindBinding.findBinding(CPPFindBinding.java:140)
        at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.doAdaptBinding(PDOMCPPLinkage.java:1250)
        at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptBinding(PDOMCPPLinkage.java:1205)
        at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptBinding(PDOMCPPLinkage.java:1185)
        at org.eclipse.cdt.internal.core.pdom.PDOM.findBindingInLinkage(PDOM.java:1220)
        at org.eclipse.cdt.internal.core.pdom.PDOM.adaptBinding(PDOM.java:1202)
        at org.eclipse.cdt.internal.core.pdom.PDOM.adaptBinding(PDOM.java:1185)

and finally a NullPointerException

!ENTRY org.eclipse.cdt.codan.core 4 1 2024-12-08 11:43:17.501
!MESSAGE Internal Error
!STACK 0
java.lang.NullPointerException: Cannot invoke "java.lang.Number.longValue()" because "value" is null
        at org.eclipse.cdt.codan.internal.checkers.MagicNumberChecker$1.visit(MagicNumberChecker.java:153)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression.accept(CPPASTLiteralExpression.java:292)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression.accept(CPPASTBinaryExpression.java:180)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTConditionalExpression.accept(CPPASTConditionalExpression.java:133)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTConditionalExpression.accept(CPPASTConditionalExpression.java:137)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTConditionalExpression.accept(CPPASTConditionalExpression.java:137)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTConditionalExpression.accept(CPPASTConditionalExpression.java:137)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTConditionalExpression.accept(CPPASTConditionalExpression.java:137)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression.accept(CPPASTBinaryExpression.java:180)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement.accept(CPPASTExpressionStatement.java:80)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement.accept(CPPASTCompoundStatement.java:103)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIfStatement.accept(CPPASTIfStatement.java:160)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement.accept(CPPASTCompoundStatement.java:103)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition.accept(CPPASTFunctionDefinition.java:225)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTemplateDeclaration.accept(CPPASTTemplateDeclaration.java:131)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamespaceDefinition.accept(CPPASTNamespaceDefinition.java:144)
        at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamespaceDefinition.accept(CPPASTNamespaceDefinition.java:144)
        at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:289)
        at org.eclipse.cdt.codan.internal.checkers.MagicNumberChecker.processAst(MagicNumberChecker.java:104)
        at org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker.processModel(AbstractIndexAstChecker.java:116)
        at org.eclipse.cdt.codan.internal.core.CodanRunner.processResource(CodanRunner.java:96)
        at org.eclipse.cdt.codan.internal.core.CodanRunner.runInEditor(CodanRunner.java:50)
        at org.eclipse.cdt.codan.internal.core.CodanBuilder.processResource(CodanBuilder.java:130)
        at org.eclipse.cdt.codan.core.cxx.internal.model.CxxCodanReconciler.reconciledAst(CxxCodanReconciler.java:40)
        at org.eclipse.cdt.codan.internal.ui.cxx.CodanCReconciler.reconciled(CodanCReconciler.java:60)
        at org.eclipse.cdt.internal.ui.editor.CEditor.reconciled(CEditor.java:3107)
        at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:100)
        at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:64)
        at org.eclipse.cdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:89)
        at org.eclipse.cdt.internal.ui.text.CCompositeReconcilingStrategy.reconcile(CCompositeReconcilingStrategy.java:90)
        at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:78)
        at org.eclipse.cdt.internal.ui.text.CReconciler.process(CReconciler.java:346)
        at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:207)

To Reproduce
Steps to reproduce the behavior:

  1. Open eclipse
  2. Open a .cpp file
  3. Typing something into the cpp file
  4. See error (screenshots below)

Expected behavior
Editing without error

Screenshots
grafik

grafik

Version Information (please complete the following information):

  • Debian 12.8
  • Eclipse Version from Help -> About Version: 2024-09 (4.33.0) Build id: 20240905-0614
  • CDT Version from Help -> About -> Installation Details -> Features tab:
    C/C++ Development Tools 11.6.1.202407022008 org.eclipse.cdt.feature.group Eclipse CDT
  • g++ --version g++ (GCC) 14.2.0 (self compiled)
eclipse.buildId=4.33.0.20240905-0613
java.version=23
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.cpp.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.cpp.product -consoleLog
@jonahgraham
Copy link
Member

@marcelr if this is the reason you were asking about CDT 12.0 as a user in #914 (comment) I just wanted to let you know that it is very unlikely that this is solved/different. You can try out CDT-LSP which has better support for newer C++ standards in https://github.com/eclipse-cdt/cdt-lsp?tab=readme-ov-file#try-it-out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants