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

Infinite loops unhandled #1805

Closed
deelawn opened this issue Mar 20, 2024 · 1 comment
Closed

Infinite loops unhandled #1805

deelawn opened this issue Mar 20, 2024 · 1 comment
Assignees
Labels
🐞 bug Something isn't working 📦 🤖 gnovm Issues or PRs gnovm related

Comments

@deelawn
Copy link
Contributor

deelawn commented Mar 20, 2024

Props to @leohhhn for identifying this.

When the gno vm encounters an infinite loop, it is never able to finish execution. It should probably stop after a certain number of CPU cycles.

Here is an example using recursion:

package main

func main() {
    println(recurse())
}

func recurse() int {
    return recurse()
}

And an example using a for loop:

package main

func main() {
    var n int
    for {
        n++
    }
    println(n)
}

Both of these will cause the vm to hang.

@deelawn deelawn added 🐞 bug Something isn't working 📦 🤖 gnovm Issues or PRs gnovm related labels Mar 20, 2024
@deelawn deelawn self-assigned this Mar 20, 2024
@zivkovicmilos zivkovicmilos added this to the 4️⃣ test4.gno.land milestone Mar 25, 2024
@deelawn
Copy link
Contributor Author

deelawn commented Mar 28, 2024

Decided this is not a bug as this only happens when running gno programs, not from within the keeper when the chain is running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📦 🤖 gnovm Issues or PRs gnovm related
Projects
None yet
Development

No branches or pull requests

2 participants