etotheipi / BitcoinArmory

Python-Based Bitcoin Software
Other
826 stars 620 forks source link

Segmentation fault - mdb_enlarge_map failed - Cannot allocate memory #289

Closed roycamp closed 9 years ago

roycamp commented 9 years ago

I have spent nearly two weeks reinstalling, redownloading (blockchain/multiple methods), rebuilding, trying different versions, etc with no luck resolving this issue.

Armory 0.93.1 (32bit) OS: Whonix (Debian/Linux) VM running in VirtualBox 10GB ram, 2 cores, 300GB space (60% free)

-INFO  - 1430696064: (BlockUtils.cpp:1343) Reading headers and building chain...
-INFO  - 1430696064: (BlockUtils.cpp:1344) Starting at block file 264 offset 24573315
-INFO  - 1430696064: (BlockUtils.cpp:1346) Block height 354849
-DEBUG - 1430696064: (Blockchain.cpp:211) Organizing chain w/ rebuild
-INFO  - 1430696067: (BlockUtils.cpp:1381) Looking for first unrecognized block
-INFO  - 1430696067: (BlockUtils.cpp:1532) Loading block data... file 5 offset 62256682
mdb_enlarge_map failed with error: "Cannot allocate memory", id: 12
Segmentation fault

Fresh boot with 80% available memory, swap not being used (I did try increasing swap and increasing swappiness) the error is still thrown. The system does not appear to be running out of memory unless armory is failing to allocate a significant (8+ GB) amount of memory at once.

After crash (looks about the same leading up to the crash):

user@host:~$ free
             total       used       free     shared    buffers     cached
Mem:      10518380    4434856    6083524          0      36992    4144988
-/+ buffers/cache:     252876   10265504
Swap:       522236          0     522236

Full output:

user@host:~$ armory --debug
(INFO) ArmoryUtils.py:1074 - C++ block utilities loaded successfully
(INFO) ArmoryUtils.py:598 - Executing popen: free -m
(INFO) ArmoryUtils.py:598 - Executing popen: ['cat', '/proc/cpuinfo']
(INFO) ArmoryUtils.py:1184 - 
(INFO) ArmoryUtils.py:1185 - 
(INFO) ArmoryUtils.py:1186 - 
(INFO) ArmoryUtils.py:1187 - ************************************************************
(INFO) ArmoryUtils.py:1188 - Invoked: /usr/lib/armory/ArmoryQt.py --debug
(INFO) ArmoryUtils.py:1189 - ************************************************************
(INFO) ArmoryUtils.py:1190 - Loading Armory Engine:
(INFO) ArmoryUtils.py:1191 -    Armory Version        : 0.93.1
(INFO) ArmoryUtils.py:1192 -    Armory Build:         : a9e0f25d51
(INFO) ArmoryUtils.py:1193 -    PyBtcWallet  Version  : 1.35                                                                                   
(INFO) ArmoryUtils.py:1194 - Detected Operating system: Linux                                                                                  
(INFO) ArmoryUtils.py:1195 -    OS Variant            : debian-7.8-                                                                            
(INFO) ArmoryUtils.py:1196 -    User home-directory   : /home/user                                                                             
(INFO) ArmoryUtils.py:1197 -    Satoshi BTC directory : /home/user/.bitcoin/                                                                   
(INFO) ArmoryUtils.py:1198 -    Armory home dir       : /home/user/.armory/                                                                    
(INFO) ArmoryUtils.py:1199 - Detected System Specs    :                                                                                        
(INFO) ArmoryUtils.py:1200 -    Total Available RAM   : 10.03 GB
(INFO) ArmoryUtils.py:1201 -    CPU ID string         : Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz
(INFO) ArmoryUtils.py:1202 -    Number of CPU cores   : 2 cores
(INFO) ArmoryUtils.py:1203 -    System is 64-bit      : False
(INFO) ArmoryUtils.py:1204 -    Preferred Encoding    : UTF-8
(INFO) ArmoryUtils.py:1205 -    Machine Arch          : i686
(INFO) ArmoryUtils.py:1206 -    Available HDD (ARM)   : 187 GB
(INFO) ArmoryUtils.py:1207 -    Available HDD (BTC)   : 187 GB
(INFO) ArmoryUtils.py:1208 - 
(INFO) ArmoryUtils.py:1209 - Network Name: Main Network
(INFO) ArmoryUtils.py:1210 - Satoshi Port: 8333
(INFO) ArmoryUtils.py:1211 - Do wlt check: True
(INFO) ArmoryUtils.py:1212 - Named options/arguments to armoryengine.py:
(INFO) ArmoryUtils.py:1214 -     nettimeout      : 2
(INFO) ArmoryUtils.py:1214 -     rescan          : False
(INFO) ArmoryUtils.py:1214 -     ignoreAllZC     : False
(INFO) ArmoryUtils.py:1214 -     enableSupernode : False
(INFO) ArmoryUtils.py:1214 -     disableModules  : False
(INFO) ArmoryUtils.py:1214 -     port            : None
(INFO) ArmoryUtils.py:1214 -     interport       : 8223
(INFO) ArmoryUtils.py:1214 -     skipStatsReport : False
(INFO) ArmoryUtils.py:1214 -     forceWalletCheck: False
(INFO) ArmoryUtils.py:1214 -     rebuild         : False
(INFO) ArmoryUtils.py:1214 -     datadir         : DEFAULT
(INFO) ArmoryUtils.py:1214 -     clearMempool    : False
(INFO) ArmoryUtils.py:1214 -     offline         : False
(INFO) ArmoryUtils.py:1214 -     coverageOutputDir: None
(INFO) ArmoryUtils.py:1214 -     armoryDBDir     : DEFAULT
(INFO) ArmoryUtils.py:1214 -     satoshiPort     : DEFAULT
(INFO) ArmoryUtils.py:1214 -     useTorSettings  : False
(INFO) ArmoryUtils.py:1214 -     netlog          : False
(INFO) ArmoryUtils.py:1214 -     keypool         : 100
(INFO) ArmoryUtils.py:1214 -     coverageInclude : None
(INFO) ArmoryUtils.py:1214 -     forceOnline     : False
(INFO) ArmoryUtils.py:1214 -     skipAnnounceCheck: False
(INFO) ArmoryUtils.py:1214 -     redownload      : False
(INFO) ArmoryUtils.py:1214 -     multisigFile    : DEFAULT
(INFO) ArmoryUtils.py:1214 -     disableTorrent  : False
(INFO) ArmoryUtils.py:1214 -     testAnnounceCode: False
(INFO) ArmoryUtils.py:1214 -     mtdebug         : False
(INFO) ArmoryUtils.py:1214 -     logDisable      : False
(INFO) ArmoryUtils.py:1214 -     settingsPath    : /home/user/.armory/ArmorySettings.txt
(INFO) ArmoryUtils.py:1214 -     verbosity       : None
(INFO) ArmoryUtils.py:1214 -     doDebug         : True
(INFO) ArmoryUtils.py:1214 -     enableDetSign   : False
(INFO) ArmoryUtils.py:1214 -     testnet         : False
(INFO) ArmoryUtils.py:1214 -     rpcport         : DEFAULT
(INFO) ArmoryUtils.py:1214 -     satoshiHome     : DEFAULT
(INFO) ArmoryUtils.py:1214 -     satoshiRpcport  : DEFAULT
(INFO) ArmoryUtils.py:1214 -     logFile         : /home/user/.armory/ArmoryQt.py.log.txt
(INFO) ArmoryUtils.py:1214 -     disableConfPermis: False
(INFO) ArmoryUtils.py:1215 - Other arguments:
(INFO) ArmoryUtils.py:1218 - ************************************************************
(INFO) ArmoryUtils.py:1613 - C++ block utilities loaded successfully
(INFO) BDM.py:418 - Using the asynchronous/multi-threaded BlockDataManager.
(INFO) BDM.py:419 - Blockchain operations will happen in the background.  
(INFO) BDM.py:420 - Devs: check TheBDM.getState() before asking for data.
(INFO) BDM.py:421 - Registering addresses during rescans will queue them for 
(INFO) BDM.py:422 - inclusion after the current scan is completed.
/usr/lib/armory/armoryengine/Transaction.py:2675: SyntaxWarning: import * only allowed at module level
  def PyCreateAndSignTx_old(srcTxOuts, dstAddrsVals):
(DEBUG) ArmoryQt.py:7076 - Checking for already open socket...
(INFO) ArmoryUtils.py:3517 - Using settings file: /home/user/.armory/ArmorySettings.txt
(INFO) ArmoryQt.py:2735 - loadWalletsAndSettings
(INFO) announcefetch.py:271 - Fetching: https://bitcoinarmory.com/announce.txt?osvar=debian&os=lin&ver=0.93.1
(DEBUG) announcefetch.py:275 - Downloading URL: https://bitcoinarmory.com/announce.txt?osvar=debian&os=lin&ver=0.93.1
(INFO) ArmoryQt.py:2789 - Loading wallets...
(DEBUG) ArmoryUtils.py:1044 - /home/user/.armory/atisignedannounce is a directory.
(DEBUG) ArmoryUtils.py:1044 - /home/user/.armory/databases is a directory.
(DEBUG) ArmoryUtils.py:1044 - /home/user/.armory/bittorrentcache is a directory.
(INFO) ArmoryQt.py:2848 - Number of wallets read in: 0
(INFO) ArmoryQt.py:2297 - Setting up networking...
(ERROR) announcefetch.py:283 - Specified URL was inaccessible
(ERROR) announcefetch.py:284 - Tried: https://bitcoinarmory.com/announce.txt?osvar=debian&os=lin&ver=0.93.1
(INFO) announcefetch.py:271 - Fetching: https://s3.amazonaws.com/bitcoinarmory-media/announce.txt
(DEBUG) announcefetch.py:275 - Downloading URL: https://s3.amazonaws.com/bitcoinarmory-media/announce.txt
(INFO) ArmoryQt.py:2326 - Internet status: 0
(INFO) ArmoryQt.py:2441 - startBitcoindIfNecessary
(INFO) ArmoryQt.py:2490 - setSatoshiPaths
(INFO) SDM.py:282 - Total size of files in /home/user/.bitcoin/blocks is 33.0 GB
(DEBUG) SDM.py:311 - Exec setupSDM
(INFO) ArmoryUtils.py:598 - Executing popen: ['whereis', 'bitcoind']
(INFO) SDM.py:453 - "whereis" returned: ['/usr/local/bin/bitcoind']
(INFO) SDM.py:321 - Found bitcoind in the following places:
(INFO) SDM.py:323 -    /usr/local/bin/bitcoind
(INFO) SDM.py:323 -    /usr/local/bin/bitcoind
(INFO) SDM.py:325 - Using: /usr/local/bin/bitcoind
(INFO) SDM.py:496 - Reading bitcoin.conf file
(INFO) SDM.py:536 - Setting permissions on bitcoin.conf
(INFO) SDM.py:597 - Called startBitcoind
(INFO) SDM.py:282 - Total size of files in /home/user/.bitcoin/blocks is 33.0 GB
(INFO) ArmoryUtils.py:598 - Executing popen: ['/usr/local/bin/bitcoind', '-datadir=/home/user/.bitcoin/']
(INFO) SDM.py:669 - PID of bitcoind: 18807
(INFO) SDM.py:670 - PID of armory:   18359
(INFO) ArmoryUtils.py:598 - Executing popen: ['python', '/usr/lib/armory/guardian.py', '18359', '18807']
(DEBUG) ArmoryQt.py:2473 - Bitcoind started without error
(DEBUG) ArmoryQt.py:1411 - setupSystemTray
(DEBUG) SDM.py:844 - Creating proxy
(INFO) SDM.py:848 - Creating proxy in SDM: host=127.0.0.1, port=8332
(DEBUG) SDM.py:891 - generic socket error
(INFO) ArmoryQt.py:1514 - setupUriRegistration
(INFO) ArmoryUtils.py:598 - Executing popen: gconftool-2 --get /desktop/gnome/url-handlers/bitcoin/command
(INFO) ArmoryUtils.py:598 - Executing popen: xdg-mime query default x-scheme-handler/bitcoin
(INFO) ArmoryUtils.py:598 - Executing popen: find /home/user -type f -name "mimeTypes.rdf"
(DEBUG) ArmoryQt.py:4361 - setupDashboard
(INFO) ArmoryQt.py:664 - Usermode: Advanced
(INFO) ArmoryQt.py:1809 - Changing usermode:
(INFO) ArmoryQt.py:1810 -    From: Advanced
(INFO) ArmoryQt.py:1818 -      To: Advanced
(INFO) ArmoryQt.py:5887 - Dashboard switched to auto-BadConnection
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(DEBUG) SDM.py:887 - generic jsonrpc exception
(INFO) ArmoryQt.py:2524 - loadBlockchainIfNecessary
(ERROR) ArmoryQt.py:1323 - 4 attempts to load blockchain failed.  Remove mempool.bin.
(ERROR) ArmoryQt.py:1328 - File mempool.bin does not exist. Nothing deleted.
(INFO) ArmoryQt.py:2545 - Setting netmode: 1
-INFO  - 1430697319: (BlockUtils.cpp:894) blkfile dir: /home/user/.bitcoin/blocks
-INFO  - 1430697319: (BlockUtils.cpp:895) lmdb dir: /home/user/.armory/databases
-INFO  - 1430697319: (lmdb_wrapper.cpp:478) Opening databases...
(INFO) ArmoryQt.py:6021 - Dashboard switched to "Scanning" mode
-INFO  - 1430697319: (BlockUtils.cpp:1226) Executing: doInitialSyncOnLoad
-INFO  - 1430697319: (BlockUtils.cpp:1297) Total number of blk*.dat files: 265
-INFO  - 1430697319: (BlockUtils.cpp:1298) Total blockchain bytes: 35,423,109,561
-INFO  - 1430697319: (BlockUtils.cpp:1671) Reading headers from db
(INFO) Networking.py:65 - Connection initiated.  Start handshake
(INFO) ArmoryQt.py:6021 - Dashboard switched to "Scanning" mode
(INFO) Networking.py:156 - Received version message from peer:
(INFO) Networking.py:157 -    Version:     70002
(INFO) Networking.py:158 -    SubVersion:  /Satoshi:0.10.0/
(INFO) Networking.py:159 -    TimeStamp:   1430697320
(INFO) Networking.py:160 -    StartHeight: 354851
(INFO) Networking.py:357 - Handshake finished, connection open!
-INFO  - 1430697322: (BlockUtils.cpp:1697) Found 354880 headers in db
-DEBUG - 1430697322: (Blockchain.cpp:211) Organizing chain w/ rebuild
-WARN  - 1430697323: (BlockUtils.cpp:1327) --- Fetching SSH summaries for 0 registered addresses
-INFO  - 1430697324: (BlockUtils.cpp:1340) Left off at file 264, offset 24790103
-INFO  - 1430697324: (BlockUtils.cpp:1343) Reading headers and building chain...
-INFO  - 1430697324: (BlockUtils.cpp:1344) Starting at block file 264 offset 24790103
-INFO  - 1430697324: (BlockUtils.cpp:1346) Block height 354850
-DEBUG - 1430697324: (Blockchain.cpp:211) Organizing chain w/ rebuild
-INFO  - 1430697400: (BlockUtils.cpp:1381) Looking for first unrecognized block
-INFO  - 1430697400: (BlockUtils.cpp:1532) Loading block data... file 5 offset 92500380
mdb_enlarge_map failed with error: "Cannot allocate memory", id: 12
Segmentation fault

Any ideas? Thanks

gurnec commented 9 years ago

@roycamp Armory 0.93.x does not support 32-bit OS's for online usage (only for offline usage). You'll either need to install it in a 64-bit VM & OS, install the latest Armory 0.92.x, or wait for Armory 0.94.

If this answers your question, you may want to consider closing this issue.

(source: https://bitcointalk.org/index.php?topic=963268.msg10898644#msg10898644)

roycamp commented 9 years ago

I was able to get it to work with 0.92.3, thanks!