Community
Participate
Working Groups
Using Cygwin on Windows XP __and__ setting "structural parsing" (note the the auto discovery stuff is on to get the right include path), the below file, also in attachment put the parser in infinite loop in ExpressionParser.errorHandling(), the swith case never return. #include <iostream> #include <string.h> #include <vector> using namespace std; int main() { vector<char> A(10); cout << "Tamaño = " << A.size() << endl; for(size_t i = 0; i<A.size(); ++i) A[i]= i + 'a'; cout << "Contenido " << endl; for(size_t i = 0; i<A.size(); ++i) cout << A[i]; cout << endl; A.push_back('z'); cout << "Nuevo Tamaño = " << A.size() << endl; cout << "Nuevo Contenido " << endl; for(size_t i = 0; i<A.size(); ++i) cout << A[i]; cout << endl; return 0; }
Created attachment 13893 [details] foo.cc
wrong component should be CDT_parse
Are you seeing this w/HEAD or 2_0 branch?
I cannot reproduce this with either HEAD or 2_0. Can either of you try this again and let me know if it's still reproducible? Thanks in advance
I can not test it since all I got now is an ArrayIndexOOBException See log below. Let me update again from the repository and I'll get back to you. Thread [org.eclipse.cdt.internal.ui.text.CSourceViewerConfiguration$1] (Suspended (exception ArrayIndexOutOfBoundsException)) Scanner2.branchState(int) line: 1136 Scanner2.skipOverConditionalCode(boolean) line: 1766 Scanner2.handlePPDirective(int) line: 1221 Scanner2.fetchToken() line: 528 Scanner2.nextToken() line: 326 StructuralParser(ExpressionParser).fetchToken() line: 2722 StructuralParser(ExpressionParser).LA(int) line: 147 StructuralParser(ExpressionParser).LT(int) line: 165 StructuralParser(ExpressionParser).consumeTemplateArguments(IASTScope, IToken, TemplateParameterManager, IASTCompletionNode$CompletionKind) line: 605 StructuralParser(ExpressionParser).name(IASTScope, IASTCompletionNode$CompletionKind, KeywordSetKey) line: 490 StructuralParser(ExpressionParser).consumePointerOperators (IDeclarator) line: 785 StructuralParser(Parser).declarator(IDeclaratorOwner, IASTScope, SimpleDeclarationStrategy, IASTCompletionNode$CompletionKind) line: 2354 StructuralParser(Parser).initDeclarator(DeclarationWrapper, SimpleDeclarationStrategy, IASTCompletionNode$CompletionKind, boolean) line: 2015 StructuralParser(Parser).simpleDeclaration(SimpleDeclarationStrategy, IASTScope, IASTTemplate, IASTCompletionNode$CompletionKind, boolean, KeywordSetKey) line: 1181 StructuralParser(Parser).simpleDeclarationStrategyUnion(IASTScope, IASTTemplate, IASTCompletionNode$CompletionKind, KeywordSetKey) line: 923 StructuralParser(Parser).declaration(IASTScope, IASTTemplate, IASTCompletionNode$CompletionKind, KeywordSetKey) line: 899 StructuralParser(Parser).linkageSpecification(IASTScope) line: 445 StructuralParser(Parser).declaration(IASTScope, IASTTemplate, IASTCompletionNode$CompletionKind, KeywordSetKey) line: 895 StructuralParser(Parser).translationUnit() line: 187 StructuralParser(Parser).parse() line: 140 CModelBuilder.parse(boolean, boolean) line: 192 CModelBuilder.parse(boolean) line: 206 WorkingCopy(TranslationUnit).parse(Map) line: 487 WorkingCopy(TranslationUnit).buildStructure(OpenableInfo, IProgressMonitor, Map, IResource) line: 315 WorkingCopy(Openable).generateInfos(Object, Map, IProgressMonitor) line: 291 WorkingCopy(CElement).openWhenClosed(CElementInfo, IProgressMonitor) line: 403 WorkingCopy(Openable).makeConsistent(IProgressMonitor, boolean) line: 217 WorkingCopy(Openable).makeConsistent(IProgressMonitor) line: 202 ReconcileWorkingCopyOperation.executeOperation() line: 49 ReconcileWorkingCopyOperation(CModelOperation).execute() line: 312 ReconcileWorkingCopyOperation(CModelOperation).run(IProgressMonitor) line: 531 CModelManager.runOperation(CModelOperation, IProgressMonitor) line: 927 WorkingCopy(CElement).runOperation(CModelOperation, IProgressMonitor) line: 346 WorkingCopy.reconcile(boolean, IProgressMonitor) line: 300 CReconcilingStrategy.reconcile() line: 72 CReconcilingStrategy.reconcile(IRegion) line: 54 CSourceViewerConfiguration$1(Reconciler).process(DirtyRegion) line: 149 AbstractReconciler$BackgroundThread.run() line: 204
Andrew has committed a fix to the ArrayOutOfBoundsException. He apologizes to all who suffered.
> He apologizes to all who suffered. 8-) It is better, meaning that the ArrayIndexOOB and the forever loop are gone. You can turn this to "Fixed" as I can now open the file in the ceditor. The verification was done using the head. Thanks. But now I have a new problem .. better use a new PR.
Lowering to Major since I cannot reproduce the problem.
Sorry, I didn't see your comment. Marking as fixed. Thanks Alain!
Still happens, but not the IndexOOB but the loop Chris will attach a test case and the debug stack
Created attachment 14067 [details] header in question
I'll still getting this problem when opening "cygwin/usr/include/inttypes.h". Thread [main] (Suspended) StructuralParser(ExpressionParser).LA(int) line: 149 StructuralParser(ExpressionParser).LT(int) line: 165 StructuralParser(ExpressionParser).errorHandling() line: 2902 StructuralParser(Parser).failParseWithErrorHandling() line: 283 StructuralParser(Parser).linkageSpecification(IASTScope) line: 452 StructuralParser(Parser).declaration(IASTScope, IASTTemplate, IASTCompletionNode$CompletionKind, KeywordSetKey) line: 896 StructuralParser(Parser).translationUnit() line: 187 StructuralParser(Parser).parse() line: 140 CModelBuilder.parse(boolean, boolean) line: 192 CModelBuilder.parse(boolean) line: 206 ExternalTranslationUnit(TranslationUnit).parse(Map) line: 487 ExternalTranslationUnit(TranslationUnit).buildStructure(OpenableInfo, IProgressMonitor, Map, IResource) line: 315 ExternalTranslationUnit(Openable).generateInfos(Object, Map, IProgressMonitor) line: 291 ExternalTranslationUnit(CElement).openWhenClosed(CElementInfo, IProgressMonitor) line: 403 ExternalTranslationUnit(CElement).getElementInfo(IProgressMonitor) line: 288 ExternalTranslationUnit(CElement).getElementInfo() line: 278 ExternalTranslationUnit(Openable).getBuffer() line: 110 EditorUtility.getStorage(ITranslationUnit) line: 424 EditorUtility.getEditorInput(ICElement) line: 210 EditorUtility.getEditorInput(Object) line: 226 EditorUtility.isOpenInEditor(Object) line: 69 CView.linkToEditor(IStructuredSelection) line: 871 CView$5.run() line: 293 RunnableLock.run() line: 35 UISynchronizer(Synchronizer).runAsyncMessages() line: 106 Display.runAsyncMessages() line: 2749 Display.readAndDispatch() line: 2434 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1377 Workbench.runUI() line: 1348 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 254 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 141 IDEApplication.run(Object) line: 96 PlatformActivator$1.run(Object) line: 335 EclipseStarter.run(Object) line: 273 EclipseStarter.run(String[], Runnable) line: 129 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object[]) line: 324 Main.basicRun(String[]) line: 183 Main.run(String[]) line: 644 Main.main(String[]) line: 628
Something pretty bad has happened here in the scanner ... IToken '{''s next token is itself, thus, errorHandling loops forever.
#error was encountered in ieefp.h and caused Scanner2 to get confused.
Fix applied to HEAD & 2_0. #error was causing an infinite loop.