Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Nov 5, 2020

This is a refactor to set the status to SUCCESS (like it is done in MakeBerkeleyDatabase, too). It also happens to fix a false positive valgrind warning (tested with bionic-gcc and focal-clang):

 node1 stderr ==28149== Conditional jump or move depends on uninitialised value(s)
==28149==    at 0x464471: LoadWallets(interfaces::Chain&) (load.cpp:105)
==28149==    by 0x44BFBA: interfaces::(anonymous namespace)::WalletClientImpl::load() (wallet.cpp:510)
==28149==    by 0x1640F9: AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) (init.cpp:1815)
==28149==    by 0x144F3F: AppInit (bitcoind.cpp:142)
==28149==    by 0x144F3F: main (bitcoind.cpp:172)
==28149== 
{
   <insert_a_suppression_name_here>
   Memcheck:Cond
   fun:_Z11LoadWalletsRN10interfaces5ChainE
   fun:_ZN10interfaces12_GLOBAL__N_116WalletClientImpl4loadEv
   fun:_Z11AppInitMainRKN4util3RefER11NodeContextPN10interfaces21BlockAndHeaderTipInfoE
   fun:AppInit
   fun:main
} 

TEST                                             | STATUS    | DURATION

wallet_hd.py --descriptors                       | ✖ Failed  | 69 s

@maflcko maflcko changed the title wallet: Set DatabaseStatus::SUCCESSS in MakeSQLiteDatabase wallet: Set DatabaseStatus::SUCCESS in MakeSQLiteDatabase Nov 5, 2020
@maflcko maflcko force-pushed the 2011-walletSqliteSuccess branch from fab45c3 to faf5fa7 Compare November 5, 2020 19:49
@achow101
Copy link
Member

achow101 commented Nov 5, 2020

ACK faf5fa7

@practicalswift
Copy link
Contributor

Concept ACK

@MarcoFalke I'm trying to correlate the line numbers in the valgrind output with the code: do you know which revision you were running? valgrind false positives are quite rare so it would be interesting to analyze this case :)

Copy link
Contributor

@mjdietzx mjdietzx left a comment

Choose a reason for hiding this comment

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

ack faf5fa7

@maflcko
Copy link
Member Author

maflcko commented Nov 5, 2020

@practicalswift It is normal master, line 105 is:

            if (!database && status == DatabaseStatus::FAILED_NOT_FOUND) {

status should only be read when the db doesn't exists, in which case status is also set.

@maflcko maflcko merged commit 65460c2 into bitcoin:master Nov 6, 2020
@maflcko maflcko deleted the 2011-walletSqliteSuccess branch November 6, 2020 07:15
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Nov 6, 2020
…eDatabase

faf5fa7 wallet: Set DatabaseStatus::SUCCESS in MakeSQLiteDatabase (MarcoFalke)

Pull request description:

  This is a refactor to set the status to `SUCCESS` (like it is done in `MakeBerkeleyDatabase`, too). It also happens to fix a false positive valgrind warning (tested with bionic-gcc and focal-clang):

  ```
   node1 stderr ==28149== Conditional jump or move depends on uninitialised value(s)
  ==28149==    at 0x464471: LoadWallets(interfaces::Chain&) (load.cpp:105)
  ==28149==    by 0x44BFBA: interfaces::(anonymous namespace)::WalletClientImpl::load() (wallet.cpp:510)
  ==28149==    by 0x1640F9: AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) (init.cpp:1815)
  ==28149==    by 0x144F3F: AppInit (bitcoind.cpp:142)
  ==28149==    by 0x144F3F: main (bitcoind.cpp:172)
  ==28149==
  {
     <insert_a_suppression_name_here>
     Memcheck:Cond
     fun:_Z11LoadWalletsRN10interfaces5ChainE
     fun:_ZN10interfaces12_GLOBAL__N_116WalletClientImpl4loadEv
     fun:_Z11AppInitMainRKN4util3RefER11NodeContextPN10interfaces21BlockAndHeaderTipInfoE
     fun:AppInit
     fun:main
  }

  TEST                                             | STATUS    | DURATION

  wallet_hd.py --descriptors                       | ✖ Failed  | 69 s
  ```

ACKs for top commit:
  achow101:
    ACK faf5fa7

Tree-SHA512: e8cbac195d05518467f89725d413bdf226d74671eba1c1eb80b3a61d65724af75a1fe93bcb5c608eaa0d54eddce992738bd923e7d83e493f54c3f4c67b66408c
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants