runtimeverification / runtimeverification/kontrol

TUI crashes when clicking on non-deterministic branch

Open
#70 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement tui
Dominant language
Python
Stars
122
Forks
16
PR merge metrics
No merged PRs in 30d

Description

When you get a non-deterministic branch and click it in the TUI, you get a crash with the following error message:

╭────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────╮
│ /nix/store/3q2jq2933abmcn832icdj8fd00pzcxc4-python3.10-pyk-0.1.434/lib/python3.10/site-packages/pyk/k │
│ cfg/tui.py:400 in on_graph_chunk_selected                                                             │
│                                                                                                       │
│   397 │   │   elif message.chunk_id.startswith('ndbranch_'):                                          │
│   398 │   │   │   self._selected_chunk = None                                                         │
│   399 │   │   │   node_source, node_target, *_ = message.chunk_id[8:].split('_')                      │
│ ❱ 400 │   │   │   source_id = int(node_source)                                                        │
│   401 │   │   │   target_id = int(node_target)                                                        │
│   402 │   │   │   ndbranch = single(self._kcfg.ndbranches(source_id=source_id, target_id=targe        │
│   403 │   │   │   self.query_one('#node-view', NodeView).update(ndbranch)                             │
│                                                                                                       │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮                      │
│ │           _ = ['9']                                                          │                      │
│ │     message = Selected()                                                     │                      │
│ │ node_source = ''                                                             │                      │
│ │ node_target = '8'                                                            │                      │
│ │        self = APRProofViewer(title='APRProofViewer', classes={'-dark-mode'}) │                      │
│ ╰──────────────────────────────────────────────────────────────────────────────╯                      │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: invalid literal for int() with base 10: ''

Reproduction:

  • clone https://github.com/smart-transaction/test-contract
  • checkout branch hjort
  • kevm foundry-kompile --verbose && kevm foundry-prove --test PinataTest.testA0 --smt-timeout 300 --smt-retry-limit 4 --verbose
  • open with kevm foundry-view-kcfg
  • locate a non-deterministic branch (I see one after node 8).
  • click it

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pyk/kcfg/tui.py at on_graph_chunk_selected, especially the ndbranch_ handling around line 400. Reproduce the failure with the listed test-contract checkout and kevm commands, then open the KCFG TUI and click the non-deterministic branch after node 8. Done means selecting that branch no longer crashes with a ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.