Handle no chain tip available in InvalidChainFound() #6377

Merged
merged 1 commit into from Aug 7, 2015

Conversation

Projects
None yet
2 participants
@rnicoll
Contributor

rnicoll commented Jul 4, 2015

Handle the case where no chain tip is available, in InvalidChainFound(). This fixes a null pointer deference when running unit tests, if the genesis block or block validation code is broken.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jul 21, 2015

Member

The initialization takes care that the node will not be started as long as the chain tip is NULL (see #5243). So this is not a case that should happen.

Maybe add an assert(tip) instead?

Member

laanwj commented Jul 21, 2015

The initialization takes care that the node will not be started as long as the chain tip is NULL (see #5243). So this is not a case that should happen.

Maybe add an assert(tip) instead?

@laanwj laanwj added the Tests label Jul 21, 2015

Handle no chain tip available in InvalidChainFound()
Handle the case where no chain tip is available, in InvalidChainFound(). This fixes a null pointer deference when running unit tests, if the genesis block or block validation code is broken.
@rnicoll

This comment has been minimized.

Show comment
Hide comment
@rnicoll

rnicoll Jul 22, 2015

Contributor

Done - it still core dumps, but it's clear about where the failure was, at least (i.e. you don't have to dig out gdb to trace down what went wrong).

Contributor

rnicoll commented Jul 22, 2015

Done - it still core dumps, but it's clear about where the failure was, at least (i.e. you don't have to dig out gdb to trace down what went wrong).

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jul 23, 2015

Member

Well it is meant to be fatal if it gets there with a NULL chaintip. Dumping core on abort() is a feature, not a bug.
utACK

Member

laanwj commented Jul 23, 2015

Well it is meant to be fatal if it gets there with a NULL chaintip. Dumping core on abort() is a feature, not a bug.
utACK

@laanwj laanwj merged commit c433828 into bitcoin:master Aug 7, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Aug 7, 2015

Merge pull request #6377
c433828 Handle no chain tip available in InvalidChainFound() (Ross Nicoll)

@rnicoll rnicoll deleted the rnicoll:invalid-chain-found branch Mar 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment