{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13110","repository_url":"https://api.github.com/repos/bitcoin/bitcoin","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13110/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13110/comments","events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13110/events","html_url":"https://github.com/bitcoin/bitcoin/issues/13110","id":318660796,"number":13110,"title":"0.16.0 bitcoin-qt: \"Assertion `copyFrom' failed\" during launch","user":{"login":"DeltaLeonis","id":1979526,"avatar_url":"https://avatars3.githubusercontent.com/u/1979526?v=4","gravatar_id":"","url":"https://api.github.com/users/DeltaLeonis","html_url":"https://github.com/DeltaLeonis","followers_url":"https://api.github.com/users/DeltaLeonis/followers","following_url":"https://api.github.com/users/DeltaLeonis/following{/other_user}","gists_url":"https://api.github.com/users/DeltaLeonis/gists{/gist_id}","starred_url":"https://api.github.com/users/DeltaLeonis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeltaLeonis/subscriptions","organizations_url":"https://api.github.com/users/DeltaLeonis/orgs","repos_url":"https://api.github.com/users/DeltaLeonis/repos","events_url":"https://api.github.com/users/DeltaLeonis/events{/privacy}","received_events_url":"https://api.github.com/users/DeltaLeonis/received_events","type":"User","site_admin":false},"labels":[{"id":64585,"url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Bug","name":"Bug","color":"FBBAAB","default":false},{"id":149424,"url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Wallet","name":"Wallet","color":"08a781","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/bitcoin/bitcoin/milestones/34","html_url":"https://github.com/bitcoin/bitcoin/milestone/34","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones/34/labels","id":3074572,"number":34,"title":"0.16.1","description":"","creator":{"login":"laanwj","id":126646,"avatar_url":"https://avatars0.githubusercontent.com/u/126646?v=4","gravatar_id":"","url":"https://api.github.com/users/laanwj","html_url":"https://github.com/laanwj","followers_url":"https://api.github.com/users/laanwj/followers","following_url":"https://api.github.com/users/laanwj/following{/other_user}","gists_url":"https://api.github.com/users/laanwj/gists{/gist_id}","starred_url":"https://api.github.com/users/laanwj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laanwj/subscriptions","organizations_url":"https://api.github.com/users/laanwj/orgs","repos_url":"https://api.github.com/users/laanwj/repos","events_url":"https://api.github.com/users/laanwj/events{/privacy}","received_events_url":"https://api.github.com/users/laanwj/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":18,"state":"open","created_at":"2018-01-30T11:31:46Z","updated_at":"2018-04-30T12:42:12Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2018-04-28T19:01:50Z","updated_at":"2018-05-03T06:55:43Z","closed_at":null,"author_association":"NONE","body":"<!-- This issue tracker is only for technical issues related to Bitcoin Core.\r\n\r\nGeneral bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com.\r\n\r\nFor reporting security issues, please read instructions at https://bitcoincore.org/en/contact/.\r\n\r\nIf the node is \"stuck\" during sync or giving \"block checksum mismatch\" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->\r\n\r\n<!-- Describe the issue -->\r\n\r\nDuring startup of bitcoint-qt version 0.16.0\r\n\r\n```\r\n$ ./bitcoin-qt\r\n```\r\n\r\n the following assertion is triggered:\r\n\r\n```\r\nbitcoin-qt: wallet/wallet.cpp:542: void CWallet::SyncMetaData(std::pair<std::_Rb_tree_iterator<std::pair<const COutPoint, uint256> >, std::_Rb_tree_iterator<std::pair<const COutPoint, uint256> > >): Assertion `copyFrom' failed.\r\n```\r\n\r\nThe issue reliably reproduces with 0.16.0 when using the same `~/.bitcoin` directory that was used without problems in 0.15.1. Relaunching 0.15.1 instead of 0.16.0 gives no assertion failure and still works without any issue.\r\n\r\nA (stripped down) [debug.log](https://github.com/bitcoin/bitcoin/files/1958057/debug.log) is attached here. The log really ends at `2018-04-28 17:21:47 init message: Loading wallet...` (which seems consistent with the assertion failure).\r\n\r\n`bitcoin.conf` is an empty, zero byte file.\r\n\r\nThis machine runs (K)Ubuntu 17.04. CPU is an AMD A6-7400K Radeon R5, 6 Compute Cores 2C+4G. Disk is an Intel 512 GB 545s SSD.\r\n\r\nBitcoin Core 0.15.1 was downloaded from [https://bitcoin.org/bin/bitcoin-core-0.15.1/bitcoin-0.15.1-x86_64-linux-gnu.tar.gz](https://bitcoin.org/bin/bitcoin-core-0.15.1/bitcoin-0.15.1-x86_64-linux-gnu.tar.gz) if I recall correctly.\r\n\r\nBitcoin Core 0.16.0 was downloaded from [https://bitcoincore.org/bin/bitcoin-core-0.16.0/bitcoin-0.16.0-x86_64-linux-gnu.tar.gz](https://bitcoincore.org/bin/bitcoin-core-0.16.0/bitcoin-0.16.0-x86_64-linux-gnu.tar.gz).\r\n\r\nNote that those are *not* versions from the Ubuntu repositories/the Ubuntu specific downloads.\r\n\r\n<!--- What behavior did you expect? -->\r\n\r\n<!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->\r\n\r\n<!--- How reliably can you reproduce the issue, what are the steps to do so? -->\r\n\r\n<!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->\r\n\r\n<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->\r\n\r\n<!-- Any extra information that might be useful in the debugging process. -->\r\n<!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->\r\n"},"comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments/386205959","html_url":"https://github.com/bitcoin/bitcoin/issues/13110#issuecomment-386205959","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13110","id":386205959,"user":{"login":"DeltaLeonis","id":1979526,"avatar_url":"https://avatars3.githubusercontent.com/u/1979526?v=4","gravatar_id":"","url":"https://api.github.com/users/DeltaLeonis","html_url":"https://github.com/DeltaLeonis","followers_url":"https://api.github.com/users/DeltaLeonis/followers","following_url":"https://api.github.com/users/DeltaLeonis/following{/other_user}","gists_url":"https://api.github.com/users/DeltaLeonis/gists{/gist_id}","starred_url":"https://api.github.com/users/DeltaLeonis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeltaLeonis/subscriptions","organizations_url":"https://api.github.com/users/DeltaLeonis/orgs","repos_url":"https://api.github.com/users/DeltaLeonis/repos","events_url":"https://api.github.com/users/DeltaLeonis/events{/privacy}","received_events_url":"https://api.github.com/users/DeltaLeonis/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T06:55:43Z","updated_at":"2018-05-03T06:55:43Z","author_association":"NONE","body":"This does indeed seem to work.\r\n\r\nHowever, I guess it only fixes the symptom but does not explain why `copyFrom` is a `nullptr` for me, yet isn't for most people? (well... that's what I assume).\r\n\r\nI have not tried to understand the code in more detail and/or run with GDB, but can try to do so if we want to understand the cause? Two remarks about this wallet:\r\n- It only consists of a few old transactions (over 300 000 confirmations) where coins were received\r\n- No coins were ever spent\r\n- It's not an HD wallet\r\n\r\nBy the way, note that the line\r\n```cpp\r\nassert(copyFrom && \"Oldest wallet transaction in range assumed to have been found.\");\r\n```\r\nseems superfluous to me anyway (either the `assert(copyFrom)` or your suggested patch will prevent it from ever failing)."}}
{"actor":{"display_login":"DeltaLeonis"}}