Skip to content

Conversation

@Mrs-X
Copy link

@Mrs-X Mrs-X commented Feb 13, 2018

Calling pivx-cli getinfo during the initial blockindex-load results in a segmentation fault.

There are lots of places where chainActive.Tip() is not explicitly checked, but I tested them (hopefully) all and only getinfo seems to have problems.

@ghost ghost assigned Mrs-X Feb 13, 2018
@ghost ghost added the review label Feb 13, 2018
Copy link

@Warrows Warrows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@presstab
Copy link

./src/pivx-cli -testnet getinfo
{
  "version": 3009900,
  "protocolversion": 70912,
  "blocks": -1,
  "timeoffset": 0,
  "connections": 0,
  "proxy": "",
  "difficulty": 1,
  "testnet": true,
  "status": "Blockchain information not yet available"
}

ACK 336e3d8

@Fuzzbawls
Copy link
Collaborator

good catch! ACK 336e358

@Fuzzbawls Fuzzbawls added this to the 3.1.0 milestone Feb 14, 2018
@presstab presstab merged commit 336e3d8 into PIVX-Project:master Feb 14, 2018
presstab added a commit that referenced this pull request Feb 14, 2018
336e3d8 [RPC] Segfault pivx-cli getinfo while loading block index (Mrs-X)

Tree-SHA512: 30bf65f7f527ba78bdcd0e2fef4da77f15a049f605a0cb3000b565c0e19e8dd274a137d1371435c0793617004591757b6b5e31029ed7a247d46bb6368cfec88b
@ghost ghost removed Bug review labels Feb 14, 2018
@Mrs-X Mrs-X added the Bug label Feb 14, 2018
@Sieres
Copy link

Sieres commented Apr 1, 2018

ACK

@dmichael
Copy link

This may be related, but I can also get pivxd to crash when issuing the following commands before the block index has loaded (during the Loading block index ... message

  • getmasternodeoutputs
  • getblockchaininfo

Results in pivx exited with code 139

random-zebra added a commit that referenced this pull request Oct 11, 2020
1947519 [Cleanup] Remove unneeded "fix" for segfault with getinfo on startup (random-zebra)
84acfa1 [RPC] Throw immediately if RPC is used when the server is in warmup (random-zebra)

Pull request description:

  **Problem**:
  Most RPC commands crash the wallet during the initialization phase.

  **Solution**:
  An attempt to fix this specifically for `getinfo` was made in #543, checking the existence of `chainActive.Tip()`.
  A better solution, instead of checking all places that try to access the block index, (or  the chainstate, or the second layer maps, etc...), is to throw a JSON-RPC exception with any call, if the server is still in warm-up phase (returning the exact init message), directly from `CRPCTable::execute`.

  Closes #1908

ACKs for top commit:
  furszy:
    ACK 1947519
  Fuzzbawls:
    utACK 1947519

Tree-SHA512: 4f37e512cb411473135c6d1fbb5013bddbcfca62b8a1ed6777481e90f60374480e3617ed1329a10d3cb1e614a2f17a827da2dce1da793b0db3c6b13222cdec19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants