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

[BUG] StackOverflow in TypeUnifer when in annotation using type variable and sets in record fields #925

Closed
shonfeder opened this issue Jul 23, 2021 · 3 comments
Assignees
Labels
bug FTC-Snowcat Feature: Fully-functional type checker Snowcat

Comments

@shonfeder
Copy link
Contributor

Description

Type checking a spec with a type annotation on an operator taking a type variable to a record with a value whose type is the set of elements of that variable produces a stack overflow.

Input specification

------------------- MODULE scratch -----------------------

EXTENDS Integers, FiniteSets

\* @type: (a) => [f: Set(a)];
Optional(x) == [f |-> x]


============================================================

The command line parameters used to run the tool

apalache-mc typecheck scratch.tla

Expected behavior

It should check the type.

Log files

PASS #1: TypeCheckerSnowcat                                       I@13:41:58.840
 > Running Snowcat .::.                                           I@13:41:58.840
(Please report an issue at: [https://github.com/informalsystems/apalache/issues],java.lang.StackOverflowError)
Unhandled exception                                               E@13:41:58.971
java.lang.StackOverflowError: null
	at at.forsyte.apalache.tla.typecheck.etc.TypeUnifier.compute(TypeUnifier.scala:67)
	at at.forsyte.apalache.tla.typecheck.etc.TypeUnifier.compute(TypeUnifier.scala:121)
	at at.forsyte.apalache.tla.typecheck.etc.TypeUnifier.insert(TypeUnifier.scala:221)
	at at.forsyte.apalache.tla.typecheck.etc.TypeUnifier.compute(TypeUnifier.scala:90)
	at at.forsyte.apalache.tla.typecheck.etc.TypeUnifier.compute(TypeUnifier.scala:121)
	at at.forsyte.apalache.tla.typecheck.etc.TypeUnifier.insert(TypeUnifier.scala:221)
	at at.forsyte.apalache.tla.typecheck.etc.TypeUnifier.compute(TypeUnifier.scala:90)
	at at.forsyte.apalache.tla.typecheck.etc.TypeUnifier.compute(TypeUnifier.scala:121)
	at at.forsyte.apalache.tla.typecheck.etc.TypeUnifier.insert(TypeUnifier.scala:221)
[snip]

System information

  • Apalache version [apalache-mc version]: 0.15.12-SNAPSHOT build v0.15.11-12-g28ed4e6-dirty
  • OS [e.g. Ubuntu Linux or Mac OS, and the current version]: Linux system76-pc 5.11.0-7614-generic #15~1622578982~20.10~383c0a9~dev-Ubuntu SMP Wed Jun 2 00:50:39 U x86_64 x86_64 x86_64 GNU/Linux
  • JDK version [e.g. OpenJDK 0.8.0]: openjdk 11.0.11 2021-04-20
@shonfeder shonfeder added the bug label Jul 23, 2021
@shonfeder shonfeder self-assigned this Jul 23, 2021
@konnov konnov added the FTC-Snowcat Feature: Fully-functional type checker Snowcat label Jul 26, 2021
@konnov
Copy link
Contributor

konnov commented Jul 26, 2021

Wow! :)

@konnov konnov self-assigned this Jul 27, 2021
@konnov
Copy link
Contributor

konnov commented Jul 27, 2021

Sorry @shonfeder , I took this one from you and fixed it :)

@konnov konnov closed this as completed in ff9b457 Jul 27, 2021
konnov added a commit that referenced this issue Jul 27, 2021
closes #925: fix infinite recursion in the type unifier
@shonfeder
Copy link
Contributor Author

shonfeder commented Jul 27, 2021

I'll remember that! ;)

@konnov konnov added this to the Typechecker Snowcat milestone Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug FTC-Snowcat Feature: Fully-functional type checker Snowcat
Projects
None yet
Development

No branches or pull requests

2 participants