Ticket #145 (closed task: fixed)

Opened 2 months ago

Last modified 2 months ago

Static analysis fails unhelpfully when FortressLibrary.fsi is changed

Reported by: jmaessen Assigned to: nbeckman
Priority: blocker Milestone:
Component: static analysis Version:
Keywords: Cc:

Description

The enclosed patch changes FortressLibrary?.fs[si] slightly. It fails when static analysis is run as shown below. The failure occurs on "fortress compile" or "fortress run" or "ant testSystem" (so pretty much any way you might try to run the interpreter). The files appear to parse without trouble.

cd ~/PFC/Library && fortress compile -debug FortressLibrary.fss
Guessing FORTRESS_HOME=/Users/jmaessen/PFC
Compiling file FortressLibrary.fss
Add component graph FortressLibrary
Finding file FortressLibrary
Finding file FortressLibrary
Add import api NativeArray
Add import api NatReflect
Add export api [Executable]
Add edge NativeArray
Add API graph NativeArray
Add edge NatReflect
Add API graph NatReflect
Add API graph FortressLibrary
Add API graph AnyType
Add API graph FortressBuiltin
Add API graph NatReflect
Add API graph NativeArray
Get component for FortressLibrary
Finding file NativeArray
Api NativeArray is newer 1206460061000 than the cache 0
Finding file NatReflect
Api NatReflect is newer 1206378766000 than the cache 0
Finding file FortressLibrary
Component FortressLibrary is newer 1215107860000 than the cache 0
Finding file FortressBuiltin
Api FortressBuiltin is newer 1215021184000 than the cache 0
Finding file AnyType
Api AnyType is newer 1208290796000 than the cache 0
Finding file FortressLibrary
Api FortressLibrary is newer 1215107989000 than the cache 0
Component FortressLibrary -> []
Out of date APIs [Api NativeArray, Api NatReflect, Api AnyType, Api FortressBuiltin, Api FortressLibrary]
Out of date components [Component FortressLibrary]
Finding file NativeArray
Finding file NatReflect
Finding file FortressBuiltin
Finding file AnyType
Finding file FortressLibrary
Exception in thread "main" java.lang.IllegalArgumentException: Undefined API: FortressLibrary
	at com.sun.fortress.compiler.GlobalEnvironment$FromMap.api(GlobalEnvironment.java:62)
	at com.sun.fortress.compiler.disambiguator.TopLevelEnv.typeConsIndex(TopLevelEnv.java:404)
	at com.sun.fortress.compiler.disambiguator.ExprDisambiguator.inheritedMethods(ExprDisambiguator.java:420)
	at com.sun.fortress.compiler.disambiguator.ExprDisambiguator.forAbsObjectDecl(ExprDisambiguator.java:489)
	at com.sun.fortress.compiler.disambiguator.ExprDisambiguator.forAbsObjectDecl(ExprDisambiguator.java:134)
	at com.sun.fortress.nodes.AbsObjectDecl.accept(AbsObjectDecl.java:1033)
	at com.sun.fortress.nodes.NodeUpdateVisitor.recur(NodeUpdateVisitor.java:2970)
	at com.sun.fortress.nodes.NodeUpdateVisitor.recurOnListOfAbsDecl(NodeUpdateVisitor.java:3010)
	at com.sun.fortress.nodes.NodeUpdateVisitor.forApi(NodeUpdateVisitor.java:1256)
	at com.sun.fortress.nodes.NodeUpdateVisitor.forApi(NodeUpdateVisitor.java:26)
	at com.sun.fortress.nodes.Api.accept(Api.java:44)
	at com.sun.fortress.compiler.Disambiguator.disambiguateApis(Disambiguator.java:167)
	at com.sun.fortress.Shell.analyze(Shell.java:468)
	at com.sun.fortress.repository.GraphRepository.parseApis(GraphRepository.java:475)
	at com.sun.fortress.repository.GraphRepository.parseApis(GraphRepository.java:450)
	at com.sun.fortress.repository.GraphRepository.refreshGraph(GraphRepository.java:317)
	at com.sun.fortress.repository.GraphRepository.getComponent(GraphRepository.java:140)
	at com.sun.fortress.Shell.compile(Shell.java:321)
	at com.sun.fortress.Shell.compile(Shell.java:290)
	at com.sun.fortress.Shell.compile(Shell.java:276)
	at com.sun.fortress.Shell.main(Shell.java:144)

Attachments

curr.patch (5.0 kB) - added by jmaessen on 07/03/08 11:31:54.
Patch to FortressLibrary?.fs[si] that manifests the bug

Change History

07/03/08 11:31:54 changed by jmaessen

  • attachment curr.patch added.

Patch to FortressLibrary?.fs[si] that manifests the bug

07/03/08 11:42:33 changed by jmaessen

The actual bug can be found using the Jun 15 version. It's in FortressLibrary?.fss, here:

trait ReadableArray1[\T, nat b0, nat s0\]
        extends { Indexed1[\s0\], Rank1, ArrayTypeWith0[\T,ZZ32\] }

That extends clause ought to read:

        extends { Indexed1[\s0\], Rank1, ReadableArray[\T,ZZ32\] }

07/03/08 11:57:11 changed by jon

  • owner changed from jon to nbeckman.

07/03/08 16:00:24 changed by nbeckman

  • status changed from new to closed.
  • resolution set to fixed.

This was a problem that I introduced when I put a "Index rebuilding" step in between type disambiguation and expr disambiguation.