Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 248761 - NPE in Parser$ASTVisitor#traverseChildren
Summary: NPE in Parser$ASTVisitor#traverseChildren
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Photran.Refactoring Engine (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jeffrey Overbey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-26 14:24 EDT by Jean Utke CLA
Modified: 2011-01-31 08:11 EST (History)
1 user (show)

See Also:


Attachments
Part 1 of the test sources (10.99 KB, text/plain)
2008-09-26 14:24 EDT, Jean Utke CLA
g.watson: iplog+
Details
part 2 (of 2) of the test sources (7.94 KB, text/plain)
2008-09-26 14:25 EDT, Jean Utke CLA
g.watson: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean Utke CLA 2008-09-26 14:24:49 EDT
Created attachment 113615 [details]
Part 1 of the test sources

Build ID: M20080911-1700

Steps To Reproduce:
1.Made a new Photran project on existing directory with 2 source files (see the attachments)
2.enabled analyzer
3.opened a file and tried to find a declaration and then the indexer fails with a nullpointer exception 


More information:
the call stack on the console is as follows: 
!SESSION 2008-09-26 10:41:53.042 -----------------------------------------------
eclipse.buildId=M20080911-1700
java.version=1.6.0_07
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86 -debug -consolelog

!ENTRY org.eclipse.core.jobs 4 2 2008-09-26 10:42:18.792
!MESSAGE An internal error occurred during: "Photran indexer".
!STACK 0
java.lang.NullPointerException
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.traverseChildren(Parser.java:8097)
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.visitASTListNode(Parser.java:8102)
        at org.eclipse.photran.internal.core.parser.Parser$ASTListNode.accept(Parser.java:7549)
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.traverseChildren(Parser.java:8097)
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.visitASTFormatStmtNode(Parser.java:8234)
        at org.eclipse.photran.internal.core.parser.ASTFormatStmtNode.accept(ASTFormatStmtNode.java:60)
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.traverseChildren(Parser.java:8097)
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.visitASTListNode(Parser.java:8102)
        at org.eclipse.photran.internal.core.parser.Parser$ASTListNode.accept(Parser.java:7549)
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.traverseChildren(Parser.java:8097)
        at org.eclipse.photran.internal.core.analysis.binding.ImplicitSpecCollector.visitASTSubroutineSubprogramNode(ImplicitSpecCollector.java:80)
        at org.eclipse.photran.internal.core.parser.ASTSubroutineSubprogramNode.accept(ASTSubroutineSubprogramNode.java:92)
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.traverseChildren(Parser.java:8097)
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.visitASTListNode(Parser.java:8102)
        at org.eclipse.photran.internal.core.parser.Parser$ASTListNode.accept(Parser.java:7549)
        at org.eclipse.photran.internal.core.parser.Parser$ASTVisitor.traverseChildren(Parser.java:8097)
        at org.eclipse.photran.internal.core.analysis.binding.ImplicitSpecCollector.visitASTExecutableProgramNode(ImplicitSpecCollector.java:62)
        at org.eclipse.photran.internal.core.parser.ASTExecutableProgramNode.accept(ASTExecutableProgramNode.java:44)
        at org.eclipse.photran.core.FortranAST.accept(FortranAST.java:45)
        at org.eclipse.photran.internal.core.analysis.binding.Binder.bind(Binder.java:19)
        at org.eclipse.photran.core.vpg.PhotranVPGBuilder.populateVPG(PhotranVPGBuilder.java:339)
        at org.eclipse.photran.core.vpg.PhotranVPGBuilder.populateVPG(PhotranVPGBuilder.java:1)
        at bz.over.vpg.VPG.computeEdgesAndAnnotations(VPG.java:178)
        at bz.over.vpg.VPG.acquireTransientAST(VPG.java:123)
        at bz.over.vpg.VPG.forceRecomputationOfEdgesAndAnnotations(VPG.java:211)
        at bz.over.vpg.eclipse.EclipseVPG.indexIfNotUpToDate(EclipseVPG.java:411)
        at bz.over.vpg.eclipse.EclipseVPG$WorkspaceSyncResourceVisitor.index(EclipseVPG.java:178)
        at bz.over.vpg.eclipse.EclipseVPG.ensureVPGIsUpToDate(EclipseVPG.java:117)
        at bz.over.vpg.eclipse.EclipseVPG$VPGInitialWorkspaceSyncJob.runInWorkspace(EclipseVPG.java:96)
        at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Jean Utke CLA 2008-09-26 14:25:38 EDT
Created attachment 113616 [details]
part 2 (of 2) of the test sources
Comment 2 Jean Utke CLA 2008-10-01 16:11:27 EDT
It seems that the error depends at least also on the version of the JRE.
My version - where the error shows up is: 
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.6.0_07-b06
java.specification.name=Java Platform API Specification
java.specification.vendor=Sun Microsystems Inc.
java.specification.version=1.6
java.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
java.version=1.6.0_07
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) Client VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Sun Microsystems Inc.
java.vm.specification.version=1.0
java.vm.vendor=Sun Microsystems Inc.
java.vm.version=10.0-b23


Another setup  where the error does not show up and the indexer appears
to work as intended is with an older JRE: 
java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version=1.5.0_13-b05-237
java.specification.name=Java Platform API Specification
java.specification.vendor=Sun Microsystems Inc.
java.specification.version=1.5
java.vendor=Apple Inc.
java.vendor.url=http://www.apple.com/
java.vendor.url.bug=http://bugreport.apple.com/
java.version=1.5.0_13
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) Client VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Sun Microsystems Inc.
java.vm.specification.version=1.0
java.vm.vendor=Apple Inc.
java.vm.version=1.5.0_13-119 
Comment 3 Jeffrey Overbey CLA 2009-07-23 15:58:58 EDT
Thanks for the bug report.  I will put the fix into CVS shortly, and it will be in the next build.