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

KEVM proof crash NoSuchElementException: key not found: #EmptyK #1997

Closed
fasapa opened this issue May 19, 2023 · 3 comments
Closed

KEVM proof crash NoSuchElementException: key not found: #EmptyK #1997

fasapa opened this issue May 19, 2023 · 3 comments

Comments

@fasapa
Copy link

fasapa commented May 19, 2023

I was attempting to prove basic properties of the OpenZeppelin ERC20 contract, more specifically the decimals() call, and some proofs crashes K. KEVM version 1.0.133.

Steps to reproduce:

  1. kevm solc-to-k ERC20.sol ERC20 --pyk --main-module ERC20-VERIFICATION --verbose > erc20-bin-runtime.k
  2. kevm kompile erc20-spec.md --pyk --backend haskell --syntax-module VERIFICATION --main-module VERIFICATION --definition erc20-spec/haskell (erc20-bin-runtime.k and erc20-spec.md)
  3. kevm prove erc20-spec.md --backend haskell --definition erc20-spec/haskell --pyk --claim ERC20-SPEC.decimals

Expected result:

Proof passing or failing without a crash.

Actual result:

Proof is crashing:

[Error] Internal: Uncaught exception thrown of type NoSuchElementException.
Please rerun your program with the --debug flag to generate a stack trace, and
file a bug report at https://github.com/runtimeverification/k/issues
(NoSuchElementException: key not found: #EmptyK)

The output of kevm prove with --verbose flag: crash.txt. I have the same proof with --debug flag, but it is too big to upload it to github.

@fasapa
Copy link
Author

fasapa commented May 19, 2023

Observed the same behavior in the newest KEVM version 1.0.168.

@fasapa
Copy link
Author

fasapa commented May 19, 2023

changed the output from

<output> .Bytes   => #buf(8, 18) </output>

to

<output> .Bytes   => #buf(32, 18) </output>

and it didn't crash. It was a typo in the spec, but isn't supposed to crash.

@iFrostizz iFrostizz transferred this issue from runtimeverification/pyk Aug 7, 2023
@iFrostizz
Copy link
Contributor

Just tested this and it has been fixed since.
The typo is correct though !
Note that the commands slightly changed now

kevm solc-to-k ERC20.sol ERC20 --pyk --main-module ERC20-VERIFICATION --verbose > erc20-bin-runtime.k

kevm kompile erc20-spec.md --pyk --target haskell --syntax-module VERIFICATION --main-module VERIFICATION --output-definition erc20-spec/haskell

kevm prove erc20-spec.md --backend haskell --definition erc20-spec/haskell --pyk --claim ERC20-SPEC.decimals -v --save-directory .

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