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

Compiler crash during zing generation #12

Closed
paulthomson opened this issue Jan 14, 2016 · 2 comments
Closed

Compiler crash during zing generation #12

paulthomson opened this issue Jan 14, 2016 · 2 comments

Comments

@paulthomson
Copy link

The following causes a KeyNotFoundException when generating the zing model.

crash.p:

module MyModule
{

main machine Manager {


    start state Init
    {
        entry
        {
            send this, halt;
        }
    }

}
}

test crash: MyModule;
implementation MyModule;
D:\pazure\testing>pc crash.p
Writing stubs.c ...
Writing program.h ...
Writing program.c ...

Unhandled Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.Pc.PToZing.TypeTranslationContext.ConstructType(FuncTerm type) in d:\pazure\P\Src\Pc\Compiler\PToZing.cs:line 4263
   at Microsoft.Pc.PToZing.TypeTranslationContext.PTypeToZingExpr(FuncTerm pType) in d:\pazure\P\Src\Pc\Compiler\PToZing.cs:line 4256
   at Microsoft.Pc.PToZing.FoldNulApp(FuncTerm ft, IEnumerable`1 children, ZingFoldContext ctxt) in d:\pazure\P\Src\Pc\Compiler\PToZing.cs:line 3273
   at Microsoft.Pc.PToZing.ZingFold(ZingFoldContext ctxt, Node n, IEnumerable`1 children) in d:\pazure\P\Src\Pc\Compiler\PToZing.cs:line 2855
   at Microsoft.Pc.PToZing.<>c__DisplayClass53.<MkZingFunMethod>b__52(Node x, IEnumerable`1 ch) in d:\pazure\P\Src\Pc\Compiler\PToZing.cs:line 3956
   at Microsoft.Formula.API.ASTComputation`1.Compute()
   at Microsoft.Formula.API.ASTConcr`1.Compute[S](Func`2 unfold, Func`3 fold, CancellationToken cancel)
   at Microsoft.Pc.PToZing.MkZingFunMethod(String machineName, String funName, FunInfo funInfo) in d:\pazure\P\Src\Pc\Compiler\PToZing.cs:line 3954
   at Microsoft.Pc.PToZing.GenerateMachineClass(String machineName) in d:\pazure\P\Src\Pc\Compiler\PToZing.cs:line 2080
   at Microsoft.Pc.PToZing.MkZingClasses(List`1 elements) in d:\pazure\P\Src\Pc\Compiler\PToZing.cs:line 2098
   at Microsoft.Pc.PToZing.GenerateZing(List`1& FileNames, AST`1& outModel) in d:\pazure\P\Src\Pc\Compiler\PToZing.cs:line 1687
   at Microsoft.Pc.Compiler.GenerateZing(List`1 flags) in d:\pazure\P\Src\Pc\Compiler\Compiler.cs:line 412
   at Microsoft.Pc.Compiler.Compile(String inputFileName, List`1& flags) in d:\pazure\P\Src\Pc\Compiler\Compiler.cs:line 378
   at Microsoft.Pc.Compiler.Compile(String inputFileName) in d:\pazure\P\Src\Pc\Compiler\Compiler.cs:line 42
   at Microsoft.Pc.CommandLine.Main(String[] args) in d:\pazure\P\Src\Pc\CommandLine\CommandLine.cs:line 85
@paulthomson
Copy link
Author

Only on the modp branch, I think.

@ankushdesai
Copy link
Member

I have fixed this bug.
P\Tst\RegressionTests\Feature1SMLevelDecls\DynamicError\Halt

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