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

fix(gnovm): make stacktrace correctly handle realm panic #3273

Merged
merged 4 commits into from
Dec 7, 2024

Conversation

ltzmaxwell
Copy link
Contributor

@ltzmaxwell ltzmaxwell commented Dec 5, 2024

While finalizing the realm, all statements in the machine have been popped out. A necessary check must be performed during stack trace handling.

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Dec 5, 2024
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Dec 5, 2024

I'm a bot that assists the Gno Core team in maintaining this repository. My role is to ensure that contributors understand and follow our guidelines, helping to streamline the development process.

The following requirements must be fulfilled before a pull request can be merged.
Some requirement checks are automated and can be verified by the CI, while others need manual verification by a staff member.

These requirements are defined in this configuration file.

Automated Checks

🟢 Maintainers must be able to edit this pull request (more info)
🟢 The pull request head branch must be up-to-date with its base (more info)

Manual Checks

No manual checks match this pull request.

Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

The pull request head branch must be up-to-date with its base (more info)

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Head branch (ltzmaxwell:fix/maxwell/stacktrace) is up to date with base (master): behind by 0 / ahead by 4

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@leohhhn
Copy link
Contributor

leohhhn commented Dec 5, 2024

Hey @ltzmaxwell, in what case does this problem show up? Can you add some example stack before and after? Just trying to figure out if this will change any edge case for users.

@ltzmaxwell
Copy link
Contributor Author

Hey @ltzmaxwell, in what case does this problem show up? Can you add some example stack before and after? Just trying to figure out if this will change any edge case for users.

Hey @leohhhn

this is what it looks before:

 -test.short -run 'TestFiles$/realm14.gno' -v -p 1 -timeout=30m
=== RUN   TestFiles
=== PAUSE TestFiles
=== CONT  TestFiles
=== RUN   TestFiles/realm14.gno
--- FAIL: TestFiles (0.07s)
    --- FAIL: TestFiles/realm14.gno (0.02s)
panic: deleted descendants should not have a reference count of less than zero [recovered]
	panic: deleted descendants should not have a reference count of less than zero [recovered]
	panic: runtime error: index out of range [-1] [recovered]
	panic: runtime error: index out of range [-1]

goroutine 24 [running]:
testing.tRunner.func1.2({0x204c320, 0xc0006986f0})
	/usr/local/go/src/testing/testing.go:1631 +0x24a
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1634 +0x377

this is what it looks now:

 -test.short -run 'TestFiles$/realm14.gno' -v -p 1 -timeout=30m
=== RUN   TestFiles
=== PAUSE TestFiles
=== CONT  TestFiles
=== RUN   TestFiles/realm14.gno
    files_test.go:92: unexpected panic: deleted descendants should not have a reference count of less than zero
        output:

        stack:
        goroutine 37 [running]:
        runtime/debug.Stack()
        	/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
        github.com/gnolang/gno/gnovm/pkg/test.(*TestOptions).runTest.func1()
        	/Users/maxwell/workbench/blockchain/gno/gno_core/gno/gnovm/pkg/test/filetest.go:196 +0xbf
        panic({0x203a800?, 0x2122f60?})
        	/usr/local/go/src/runtime/panic.go:770 +0x132
        github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).Run.func1()
        	/Users/maxwell/workbench/blockchain/gno/gno_core/gno/gnovm/pkg/gnolang/machine.go:1140 +0x9d
        panic({0x203a800?, 0x2122f60?})
        	/usr/local/go/src/runtime/panic.go:770 +0x132
        github.com/gnolang/gno/gnovm/pkg/gnolang.(*Realm).decRefDeletedDescendants(0xc00015cee0, {0x49dc2dc8, 0xc00051b220}, {0x2139d80, 0xc000572fa0})

@ltzmaxwell ltzmaxwell requested review from mvertes and omarsy and removed request for mvertes December 6, 2024 03:36
@mvertes mvertes self-requested a review December 6, 2024 08:53
@petar-dambovaliev petar-dambovaliev self-requested a review December 7, 2024 11:13
@thehowl thehowl merged commit 66c2eb6 into gnolang:master Dec 7, 2024
104 checks passed
omarsy pushed a commit to TERITORI/gno that referenced this pull request Dec 7, 2024
…) == 0` (gnolang#3273)

While finalizing the realm, all statements in the machine have been
popped out. A necessary check must be performed during stack trace
handling.
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>

Co-authored-by: Petar Dambovaliev <petar.atanasov.1987@gmail.com>
Villaquiranm pushed a commit to Villaquiranm/gno that referenced this pull request Dec 9, 2024
…) == 0` (gnolang#3273)

While finalizing the realm, all statements in the machine have been
popped out. A necessary check must be performed during stack trace
handling.
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>

Co-authored-by: Petar Dambovaliev <petar.atanasov.1987@gmail.com>
r3v4s pushed a commit to gnoswap-labs/gno that referenced this pull request Dec 10, 2024
…) == 0` (gnolang#3273)

While finalizing the realm, all statements in the machine have been
popped out. A necessary check must be performed during stack trace
handling.
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>

Co-authored-by: Petar Dambovaliev <petar.atanasov.1987@gmail.com>
@Kouteki Kouteki removed the in focus label Dec 16, 2024
albttx pushed a commit that referenced this pull request Jan 10, 2025
…) == 0` (#3273)

While finalizing the realm, all statements in the machine have been
popped out. A necessary check must be performed during stack trace
handling.
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>

Co-authored-by: Petar Dambovaliev <petar.atanasov.1987@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related
Projects
Development

Successfully merging this pull request may close these issues.

7 participants