-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Exporting empty state leads to a segmentation fault #1834
Comments
I believe exporting any state with A quick fix is to add Solved in #1800 Edit: Misread. Currently can't export right after init. |
I think you needed a state transition, or else it errored currently on develop. |
Can we close this if fixed on |
cc @jlandrews, I don't think this is fixed. |
So I think the specific bug posted here has been fixed on develop but the fix wasn't merged into 0.23.0. I've just tested on develop though, and it looks like there is an error if you try to export right after an init. I get the following stack trace:
Which I expect is happening because |
Thats a good point. I'm not sure gaiad init should be initializing state however, since |
@ValarDragon don't think that's true technically. Should be able to run as soon as the chain starts (i.e. before the first block) |
I agree with @ValarDragon, if it purposefully panics now then this issue becomes only a UX issue where a better error message (possibly without the unnecessary stack trace) would be a good solution. |
You're right, we can export before the first block, once we have a state. I guess we should change the message to "the chain must have started", or smth to that extent. Thanks for pointing that out. Still not sure if I'm not opposed to just special casing this situation. If there is no state, but the genesis file is created, return the current genesis file. (And display a warning as well) Its not like we're masking some bug with this special case (as not initializing state on |
I think we should go ahead and special case this situation. Agree with @ValarDragon and @amrali here. |
…osmos#1834) Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.46.2 to 0.46.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cosmos/cosmos-sdk/releases">github.com/cosmos/cosmos-sdk's releases</a>.</em></p> <blockquote> <h2>v0.46.3</h2> <h1>Cosmos SDK v0.46.3 Release Notes</h1> <p>This is a security release for the <a href="https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702">Dragonberry security advisory</a>. Please upgrade ASAP.</p> <p>Next to this, we have also included a few minor bugfixes.</p> <p>Chains must add the following to their go.mod for the application:</p> <pre lang="go"><code>replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 </code></pre> <p>Bumping the SDK version should be smooth, however, feel free to tag core devs to review your upgrading PR:</p> <ul> <li><strong>CET</strong>: <a href="https://github.com/tac0turtle"><code>@tac0turtle</code></a>, <a href="https://github.com/okwme"><code>@okwme</code></a>, <a href="https://github.com/AdityaSripal"><code>@AdityaSripal</code></a>, <a href="https://github.com/colin-axner"><code>@colin-axner</code></a>, <a href="https://github.com/julienrbrt"><code>@julienrbrt</code></a></li> <li><strong>EST</strong>: <a href="https://github.com/ebuchman"><code>@ebuchman</code></a>, <a href="https://github.com/alexanderbez"><code>@alexanderbez</code></a>, <a href="https://github.com/aaronc"><code>@aaronc</code></a></li> <li><strong>PST</strong>: <a href="https://github.com/jtremback"><code>@jtremback</code></a>, <a href="https://github.com/nicolaslara"><code>@nicolaslara</code></a>, <a href="https://github.com/czarcas7ic"><code>@czarcas7ic</code></a>, <a href="https://github.com/p0mvn"><code>@p0mvn</code></a></li> <li><strong>CDT</strong>: <a href="https://github.com/ValarDragon"><code>@ValarDragon</code></a>, <a href="https://github.com/zmanian"><code>@zmanian</code></a></li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md">github.com/cosmos/cosmos-sdk's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.3">v0.46.3</a> - 2022-10-20</h2> <p>ATTENTION:</p> <p>This is a security release for the <a href="https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702">Dragonberry security advisory</a>.</p> <p>All users should upgrade immediately.</p> <p>Users <em>must</em> add a replace directive in their go.mod for the new <code>ics23</code> package in the SDK:</p> <pre lang="go"><code>replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v8.0.0 </code></pre> <h3>Features</h3> <ul> <li><a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/13435">#13435</a> Extend error context when a simulation fails.</li> <li>(grpc) <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/13485">#13485</a> Implement a new gRPC query, <code>/cosmos/base/node/v1beta1/config</code>, which provides operator configuration.</li> <li>(cli) <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/13147">#13147</a> Add the <code>--append</code> flag to the <code>sign-batch</code> CLI cmd to combine the messages and sign those txs which are created with <code>--generate-only</code>.</li> <li>(cli) <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/13454">#13454</a> <code>sign-batch</code> CLI can now read multiple transaction files.</li> </ul> <h3>Improvements</h3> <ul> <li><a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/13586">#13586</a> Bump Tendermint to <code>v0.34.22</code>.</li> <li>(auth) <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/13460">#13460</a> The <code>q auth address-by-id</code> CLI command has been renamed to <code>q auth address-by-acc-num</code> to be more explicit. However, the old <code>address-by-id</code> version is still kept as an alias, for backwards compatibility.</li> <li><a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/13433">#13433</a> Remove dead code in cacheMergeIterator <code>Domain()</code>.</li> </ul> <h3>Bug Fixes</h3> <ul> <li>Implement dragonberry security patch. <ul> <li>For applying the patch please refer to the <a href="https://github.com/cosmos/cosmos-sdk/blob/main/RELEASE_NOTES.md">RELEASE NOTES</a></li> </ul> </li> <li>(store) <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/13459">#13459</a> Don't let state listener observe the uncommitted writes.</li> <li><a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/12548">#12548</a> Prevent signing from wrong key while using multisig.</li> </ul> <h3>API Breaking Changes</h3> <ul> <li>(server) <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/pull/13485">#13485</a> The <code>Application</code> service now requires the <code>RegisterNodeService</code> method to be implemented.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cosmos/cosmos-sdk/commit/6d32debf1aca4b7f1ed1429d87be1d02c315f02d"><code>6d32deb</code></a> chore: bump tendermint to <code>0.34.22</code> (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13586">#13586</a>)</li> <li><a href="https://github.com/cosmos/cosmos-sdk/commit/facd40d1423e29558c6891e70b66b451e99bae07"><code>facd40d</code></a> Merge pull request from GHSA-3qp7-gj37-g9rx</li> <li><a href="https://github.com/cosmos/cosmos-sdk/commit/8667eba85db57555c0d7cc437566199e6b5e9549"><code>8667eba</code></a> refactor: Amend <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13497">#13497</a> (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13577">#13577</a>)</li> <li><a href="https://github.com/cosmos/cosmos-sdk/commit/86e8bcb539218e6b2693780fc46d8d12ada8183f"><code>86e8bcb</code></a> refactor: Improve AllocateTokens (backport <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13524">#13524</a>) (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13526">#13526</a>)</li> <li><a href="https://github.com/cosmos/cosmos-sdk/commit/2e3c37853d6be178d0c830128d0b4c161dcd3882"><code>2e3c378</code></a> chore: CHANGELOG update (backport <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13536">#13536</a>) (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13537">#13537</a>)</li> <li><a href="https://github.com/cosmos/cosmos-sdk/commit/37912ec4a20d74b794b0cd828a10c898958b75e8"><code>37912ec</code></a> feat: gRPC query for operator and chain configuration (backport <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13485">#13485</a>) (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13497">#13497</a>)</li> <li><a href="https://github.com/cosmos/cosmos-sdk/commit/f8778706afa70a3e576b408d63eac4892d8e4860"><code>f877870</code></a> feat: add MsgServiceRouter to Baseapp (and runtime's provideCodecs) (backport...</li> <li><a href="https://github.com/cosmos/cosmos-sdk/commit/cb676e2647557543d658172d5a1be61cc40fa2a4"><code>cb676e2</code></a> fix: state listener could observe discarded writes (backport <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13459">#13459</a>) (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/13462">#13462</a>)</li> <li><a href="https://github.com/cosmos/cosmos-sdk/commit/982b891921da32b7881a8d93942cf24ad4acc6b0"><code>982b891</code></a> refactor: Improve and clarify API around <code>AccountAddressById</code> (backport <a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/134">#134</a>...</li> <li>See full diff in <a href="https://github.com/cosmos/cosmos-sdk/compare/v0.46.2...v0.46.3">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/cosmos/cosmos-sdk&package-manager=go_modules&previous-version=0.46.2&new-version=0.46.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
Summary of Bug
This probably low priority, but at [email protected] running
gaiad export
right aftergaiad init
causes a segmentation fault trying to deference a garbage memory address.Steps to Reproduce
gaiad init
gaiad export
For Admin Use
The text was updated successfully, but these errors were encountered: