bitcoin-qt core dumps when bitcoin(d/-qt) is already running #10815

Closed
morcos opened this Issue Jul 13, 2017 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

morcos commented Jul 13, 2017

On master at 7666250

It's expected to just exit cleanly with an error message that it can't obtain a lock on the data directory.
Instead it shows that error message and then when you click it away it core dumps.

This doesn't happen with bitcoind.

This also results in losing RPC credentials to the running bitcoin(d/-qt)

laanwj added this to the 0.15.0 milestone Jul 13, 2017

Owner

laanwj commented Jul 13, 2017

This problem happens because Shutdown() is called, even though the data directory was not locked.

Most easily reproducible in the GUI, though it's also possible to happen with bitcoind in a rare race condition (if the check in AppInitSanityChecks succeeds, but the lock can't actually be grabbed in AppInitSanityChecks and that exits with false, it will fall through and call Shutdown).

laanwj added the GUI label Jul 14, 2017

@laanwj laanwj added a commit to laanwj/bitcoin that referenced this issue Jul 15, 2017

@laanwj laanwj init: Factor out AppInitLockDataDirectory
Alternative to #10818, alternative solution to #10815.

After this change: All the AppInit steps before and inclusive
AppInitLockDataDirectory must not have Shutdown() called in case of
failure. Only when AppInitMain fails, Shutdown should be called.

Changes the GUI and bitcoind code to consistently do this.
ceec6cb

@laanwj laanwj added a commit to laanwj/bitcoin that referenced this issue Jul 17, 2017

@laanwj laanwj init: Factor out AppInitLockDataDirectory
Alternative to #10818, alternative solution to #10815.

After this change: All the AppInit steps before and inclusive
AppInitLockDataDirectory must not have Shutdown() called in case of
failure. Only when AppInitMain fails, Shutdown should be called.

Changes the GUI and bitcoind code to consistently do this.
dba485d

@laanwj laanwj added a commit that referenced this issue Jul 17, 2017

@laanwj laanwj Merge #10832: init: Factor out AppInitLockDataDirectory and fix start…
…up core dump issue


dba485d init: Factor out AppInitLockDataDirectory (Wladimir J. van der Laan)

Pull request description:

  Alternative to #10818, alternative solution to #10815.

  After this change: All the AppInit steps before and inclusive AppInitLockDataDirectory must not have Shutdown() called in case of failure. Only when AppInitMain fails, Shutdown should be called.

  Changes the GUI and bitcoind code to consistently do this.

Tree-SHA512: 393e1a0ae05eb8e791025069e3ac4f6f3cdeb459ec63feda85d01cf6696ab3fed7632b6a0ac3641b8c7015af51d46756b5bba77f5e5f0c446f0c2dea58bbc92e
89bb036

morcos closed this Jul 17, 2017

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