ManojNimbalkar / bitcoin-wallet

Automatically exported from code.google.com/p/bitcoin-wallet
0 stars 0 forks source link

Synchronizing to blockchain force closes Bitcoin Wallet #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start Bitcoin
2. Wait for synchronization to reach "4 weeks behind"
3. See force close
4. Go to 1. :)

After the restart Wallet needs to synchronize from the start (blockchain is not 
saved).

What is the expected output? What do you see instead?
Synchronizing to today and no Force Close.

What version of Bitcoin Wallet are you using? On what Android version and
what phone? Don't just state 'most recent', this is not enough info.
Bitcoin Wallet version 2.13, Android 4.0.2 on Galaxy Nexus

If you have problems with particular transactions, what is your Bitcoin
address? If you happen to have transaction IDs, please state them as well.
I think that may be related to a particular transaction although I once had a 
fully synchronized Wallet past the point that now causes a Force Close. All 
details with transaction numbers are in the attached log file.

Please provide any additional information below.
I did a "reset blockchain" action because one of my outgoing transactions were 
pending for a week, now I can't fully synchronize the wallet. If more 
information (including logs) is necessary I can provide it.

Original issue reported on code.google.com by wiktor.k...@gmail.com on 14 Jun 2012 at 9:13

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for reporting. I forwarded this report to BitCoinJ

http://code.google.com/p/bitcoinj/issues/detail?id=209

Can you state your public Bitcoin address(es) of that wallet?

Original comment by andreas....@gmail.com on 14 Jun 2012 at 11:19

GoogleCodeExporter commented 9 years ago
Sure, they're not critical.

I've used those addresses:

1NBsnFx93ty8cpufitsZ5rxs1ZtPu2xWs4
1Q4wL3osVztjTJcvmoBZvbQRJuzwcX4Has
1GLGUaGoMhhpj6MqWbsKCaUjGmr4sfJSJC
1E6yjpw1ULcbviZC7L9LeXFyfX51sut9qE
1AMJXriT2MGywwEW2xJ2bgfPTHgYwrkrjq
17JNfrvZxc37fLxsAQNYJpvjsbUQvdRQvx
1JLWEqpfSPz327mF3koArSTsV51rTULbVz
1FQbPYhHsuEdYjCWutfRHDVjJBSrR8WVUV
1KmG5P1WowLWqQ3cRpSB8Ai2TQ1kZdBfLt

I've also seen some BlockStoreExceptions being thrown in logcat. That wasn't 
fatal to Bitcoin Wallet as it only stopped the synchronization (exiting and 
opening the application continued the process). They may or may not be relevant 
they may be helpful.

There was a warning too:
W/System.err( 4047): 2972674 [PeerGroup-4-thread-4] INFO 
com.google.bitcoin.core.Peer - Received alert from peer 
Peer(dnsseed.bitcoin.dashjr.org/125.37.166.25:8333): URGENT: upgrade required, 
see http://bitcoin.org/dos for details

Original comment by wiktor.k...@gmail.com on 15 Jun 2012 at 8:19

Attachments:

GoogleCodeExporter commented 9 years ago
The alert is totally harmless for us. It is meant for users of old Satoshi 
clients, urging them to upgrade to more secure versions. We just ignore them.

The three BlockStoreExceptions you posted are harmless as well, because they 
happend right after a regular shutdown of the PeerGroup (at the detected end of 
a blockchain download). Granted, shutdown currently is not very nice, but at 
least it should not leave any damage.

Let's wait until there is some comment on the upstream bug.

Original comment by andreas....@gmail.com on 15 Jun 2012 at 9:35

GoogleCodeExporter commented 9 years ago
Just recently the Wallet successfully synchronized the blockchain. I didn't do 
anything special just let it download it again (watching the output in logcat). 
I'm glad that it works but the problem was very real and persistent for almost 
a week. Thanks for help and explanation, oh and by the way I forgot to thank 
you for such a simple yet powerful application - so thank you again!

Original comment by wiktor.k...@gmail.com on 15 Jun 2012 at 10:07

GoogleCodeExporter commented 9 years ago
I am having the same problem.  I reset the block chain because I had a 
transaction that wasn't completed after a few days and it wasn't even showing 
on the blockchain.  I am also using android and my wallet also got stuck at 4 
weeks left of syncing.  I tried force stopping and restarting the phone (as 
suggested above) and after about two and a half hours it now has 3 weeks left.  
I'm homing the rest completes soon.

Original comment by Ostrowsk...@gmail.com on 23 Jun 2012 at 10:44

GoogleCodeExporter commented 9 years ago
Force stopping apps is generally not a good idea, unless its really the last 
way out.

Original comment by andreas....@gmail.com on 23 Jun 2012 at 6:40

GoogleCodeExporter commented 9 years ago
Today I had two blockchain restarts. They were preceded by out of memory errors:

D/dalvikvm( 9316): GC_FOR_ALLOC freed 2251K, 8% free 60593K/65543K, paused 512ms
I/dalvikvm-heap( 9316): Forcing collection of SoftReferences for 415761-byte 
allocation
D/dalvikvm( 9316): GC_BEFORE_OOM freed 19K, 8% free 60573K/65543K, paused 525ms
E/dalvikvm-heap( 9316): Out of memory on a 415761-byte allocation.
I/dalvikvm( 9316): "PeerGroup-2-thread-2" daemon prio=3 tid=12 RUNNABLE
I/dalvikvm( 9316):   | group="main" sCount=0 dsCount=0 obj=0x4367d980 
self=0x3d5760
I/dalvikvm( 9316):   | sysTid=15060 nice=13 sched=0/0 cgrp=bg_non_interactive 
handle=3890624
I/dalvikvm( 9316):   | schedstat=( 0 0 0 ) utm=17382 stm=462 core=0
I/dalvikvm( 9316):   at 
com.google.bitcoin.core.BitcoinSerializer.deserializePayload(BitcoinSerializer.j
ava:~212)
I/dalvikvm( 9316):   at 
com.google.bitcoin.core.BitcoinSerializer.deserialize(BitcoinSerializer.java:195
)
I/dalvikvm( 9316):   at 
com.google.bitcoin.core.TCPNetworkConnection.readMessage(TCPNetworkConnection.ja
va:164)
I/dalvikvm( 9316):   at com.google.bitcoin.core.Peer.run(Peer.java:182)
I/dalvikvm( 9316):   at 
com.google.bitcoin.core.PeerGroup$3.run(PeerGroup.java:553)
I/dalvikvm( 9316):   at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
I/dalvikvm( 9316):   at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
I/dalvikvm( 9316):   at java.lang.Thread.run(Thread.java:856)
I/dalvikvm( 9316):
W/System.err( 9316): 3491733 [PeerGroup-2-thread-2] INFO 
com.google.bitcoin.core.PeerGroup - Download peer died. Picking a new one.

And then a toast message appeared with protobuf error and the log contained:

W/System.err(23921): com.google.protobuf.InvalidProtocolBufferException: 
Message missing required fields: network_identifier
W/System.err(23921):    at 
org.bitcoinj.wallet.Protos$Wallet$Builder.buildParsed(Protos.java:4761)
W/System.err(23921):    at 
org.bitcoinj.wallet.Protos$Wallet$Builder.access$8000(Protos.java:4676)
W/System.err(23921):    at 
org.bitcoinj.wallet.Protos$Wallet.parseFrom(Protos.java:4621)
W/System.err(23921):    at 
com.google.bitcoin.store.WalletProtobufSerializer.readWallet(WalletProtobufSeria
lizer.java:212)
W/System.err(23921):    at 
com.google.bitcoin.core.Wallet.loadFromFileStream(Wallet.java:305)
W/System.err(23921):    at 
de.schildbach.wallet.WalletApplication.loadWalletFromProtobuf(WalletApplication.
java:206)
W/System.err(23921):    at 
de.schildbach.wallet.WalletApplication.onCreate(WalletApplication.java:105)
W/System.err(23921):    at 
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
W/System.err(23921):    at 
android.app.ActivityThread.handleBindApplication(ActivityThread.java:3925)
W/System.err(23921):    at 
android.app.ActivityThread.access$1300(ActivityThread.java:122)
W/System.err(23921):    at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1184)
W/System.err(23921):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(23921):    at android.os.Looper.loop(Looper.java:137)
W/System.err(23921):    at 
android.app.ActivityThread.main(ActivityThread.java:4340)
W/System.err(23921):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(23921):    at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err(23921):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
W/System.err(23921):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
W/System.err(23921):    at dalvik.system.NativeStart.main(Native Method)

Original comment by wiktor.k...@gmail.com on 24 Jun 2012 at 6:26

GoogleCodeExporter commented 9 years ago
After updating to newest version (2.17) the application still crashes in 
certain points (OOM errors) but... after launching it again the wallet will 
keep synchronizing at the point where it failed. Excellent! Does this version 
contain additional code that prevents blockchain corruption?

Original comment by wiktor.k...@gmail.com on 30 Jun 2012 at 2:07

GoogleCodeExporter commented 9 years ago
I think, i have the same issue.
I'm unable to synchronize the blockchain for more than 3 weeks now.
The application randomly crashes. Most of the time it resumes synchronizing 
after restart, but sometimes it resets the blockchain and restarts from the 
beginning. But never finishes.
While synchronizing, the app uses up to 70% CPU, memory usage is about 30MB.

The crash report (sent several) contains the following:

Total Internal memory: 1125998592
Available Internal memory: 192454656

java.lang.OutOfMemoryError
    at com.google.bitcoin.core.BitcoinSerializer.deserializePayload(BitcoinSerializer.java:212)
    at com.google.bitcoin.core.BitcoinSerializer.deserialize(BitcoinSerializer.java:195)
    at com.google.bitcoin.core.TCPNetworkConnection.readMessage(TCPNetworkConnection.java:162)
    at com.google.bitcoin.core.Peer.run(Peer.java:182)
    at com.google.bitcoin.core.PeerGroup$3.run(PeerGroup.java:553)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
    at java.lang.Thread.run(Thread.java:856)

Original comment by daniel.p...@gmail.com on 22 Sep 2012 at 8:41

GoogleCodeExporter commented 9 years ago
Daniel, you might want to follow upstream issue
http://code.google.com/p/bitcoinj/issues/detail?id=217

Do you have a lot of apps installed/running when this happens? If yes, try 
removing all apps you don't need.

Original comment by andreas....@gmail.com on 22 Sep 2012 at 9:14

GoogleCodeExporter commented 9 years ago
Thanks for the reply, Andreas.
I disabled all non-system-apps and tried synchronizing, but it still crashes 
and resets the wallet. There are about 130 - 150 MB of free RAM, this should be 
enough.
Will wait for the bitcoinj issue being solved.

Original comment by daniel.p...@gmail.com on 24 Sep 2012 at 5:42

GoogleCodeExporter commented 9 years ago
Out of memory errors while synching the blockchain should now be fixed, since 
we save a lot of memory by using bloom filtering.

Make sure to update to version 2.41 (just released).

Original comment by andreas....@gmail.com on 24 Feb 2013 at 11:38

GoogleCodeExporter commented 9 years ago
one last resort in those situations where bitcoin wallet network 
synchronization does not complete is to rescan.

in the command line
bitcoin-qt -rescan

not sure what the exact command is, but it is something like that

Original comment by ntri...@gmail.com on 22 Jun 2014 at 4:40