Pages:
Author

Topic: [solved/paid][1btc reward] PHP RPC commands freezing bitcoin (Read 4319 times)

legendary
Activity: 2940
Merit: 1333
I just noticed bitcoin-qt is using 100% CPU.  It's still responsive, but it's a start...

That was probably a red herring.  I was running 'bitcoin-qt -noconnect' to stop it connecting to any peers.  That seems to be what causes the 100% CPU usage, whether I use your wallet or mine.

Yeah - that was unrelated.  Giving bitcoin-qt the -noconnect flag causes the CPU to go to 100% for everyone, I guess.  I reported it, and provided a fix:

https://github.com/bitcoin/bitcoin/issues/1664

So I'm back to not being able to reproduce your problem.  I doubt that broadcasting the transactions to the network would cause a problem, but it's possible.  I guess I'd like to try with one of your bigger wallets once you're able to check them out.
hero member
Activity: 504
Merit: 500
I just noticed bitcoin-qt is using 100% CPU.  It's still responsive, but it's a start...

That was probably a red herring.  I was running 'bitcoin-qt -noconnect' to stop it connecting to any peers.  That seems to be what causes the 100% CPU usage, whether I use your wallet or mine.
could broadcasting unconfirmed transactions add to it?
[~3-6 per minute ~10 minutes per block, so ~30-60 transactions some up to 90kb being broadcast]

though i'm doing the same now
legendary
Activity: 2940
Merit: 1333
I just noticed bitcoin-qt is using 100% CPU.  It's still responsive, but it's a start...

That was probably a red herring.  I was running 'bitcoin-qt -noconnect' to stop it connecting to any peers.  That seems to be what causes the 100% CPU usage, whether I use your wallet or mine.
legendary
Activity: 2940
Merit: 1333
I just noticed bitcoin-qt is using 100% CPU.  It's still responsive, but it's a start...
hero member
Activity: 504
Merit: 500
Okay so I'm trying to make use of the PHP martingale bot that's bouncing around, and after a while the bitcoin client freezes and jsonRPC fails to connect (the client stays frozen and won't start until the whole computer is restarted) it doesn't seem to be connected to anything specific, just after a while (30 transactions on one wallet, 1800 on another) cpu use of the client hits 25% and it freezes

bitcoind freezes then crashes

I'm in windows 7 with the latest client from bitcoin.org

Anyone know how to stop this?

edit : it seems to happen when trying to use the rpc at the same time as bitcoin is downloading a block

OK, so I'm unable to reproduce this behaviour.

When I try to create a transaction that spends most of the satoshis, it very quickly selects the right coins, but then takes about 6 seconds signing all the inputs, and then fails because the maximum transaction size is apparently 100kb:

Code:
static const unsigned int MAX_BLOCK_SIZE = 1000000;
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;

                if (nBytes >= MAX_BLOCK_SIZE_GEN/5)
                    return false;

That puts a hard limit of something like 555 inputs on a transaction, although the coin selection code makes no attempt to keep the set of selected inputs to 555 or less.

So in summary: when you try to spend more than 555 inputs at a time it fails to create the transaction after taking a relatively long time to sign all the inputs, but I'm not yet seeing and crashes or long freezes.  Any idea what I might do to provoke the failures you were seeing?

I'm really not sure, at first i thought the new blocks coming in had something to do with it, it may have been a factor, i assume that the 100kb size limit is the problem though, 6 seconds would be some of the ones in the client, (some of them minutes) and the early 'warning sign' ones using RPC

A thing i noticed is it would get worse with every bet, i may have sent you a wallet that i stopped early so was just 'slowing down' instead of freezing and making rpc fail (i chose the smallest one first and then corrupted my blockchain yadda yadda yadda so just sent that one)
legendary
Activity: 2940
Merit: 1333
Okay so I'm trying to make use of the PHP martingale bot that's bouncing around, and after a while the bitcoin client freezes and jsonRPC fails to connect (the client stays frozen and won't start until the whole computer is restarted) it doesn't seem to be connected to anything specific, just after a while (30 transactions on one wallet, 1800 on another) cpu use of the client hits 25% and it freezes

bitcoind freezes then crashes

I'm in windows 7 with the latest client from bitcoin.org

Anyone know how to stop this?

edit : it seems to happen when trying to use the rpc at the same time as bitcoin is downloading a block

OK, so I'm unable to reproduce this behaviour.

When I try to create a transaction that spends most of the satoshis, it very quickly selects the right coins, but then takes about 6 seconds signing all the inputs, and then fails because the maximum transaction size is apparently 100kb:

Code:
static const unsigned int MAX_BLOCK_SIZE = 1000000;
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;

                if (nBytes >= MAX_BLOCK_SIZE_GEN/5)
                    return false;

That puts a hard limit of something like 555 inputs on a transaction, although the coin selection code makes no attempt to keep the set of selected inputs to 555 or less.

So in summary: when you try to spend more than 555 inputs at a time it fails to create the transaction after taking a relatively long time to sign all the inputs, but I'm not yet seeing and crashes or long freezes.  Any idea what I might do to provoke the failures you were seeing?
hero member
Activity: 504
Merit: 500
Yes, the the satoshi dice thread https://bitcointalksearch.org/topic/m.1086135

Dooglus suggested a change in the clients source and after all else failed i built that (took me hours to make bitcoin build in windows) and it seems the problem is solved, if it ignores the single satoshi's it doesn't freeze (well hasn't in the last 24 hours at least)

Just waiting on his bitcoin address

the issue isn't bitcoind, it is windows, should have used linux Smiley

fyi it froze slightly quicker in ubuntu, but at least used 100% cpu instead of just one core

still should have used linux, aka Gentoo or Centos, but if this is a big bug, is it reported? Cause I am using the latest bitcoind and I never have this problem on my VPS and I get ~1000 php rpc calls. I use hardly any CPU.
Since removing the clients ability to spend single satoshi inputs i have not had a problem, i'm not sure exactly what the problem is/was, but i think the single satoshi inputs are/were a big part of it, RPC froze the client (timeout set to 600 but it never waited that long before throwing cannot connect) and the client spat "transaction create failed" (After freezing for a few seconds to a few minutes) at me if i tried to spend "the wrong amount" of bitcoins (if it failed i tried more or less and it would eventually work)- the biggest transaction i saw was ~90kb, perhaps at a certain size the client can't do it? a better error would be "transaction too big" then... >.> but i am not sure
legendary
Activity: 1498
Merit: 1000
Yes, the the satoshi dice thread https://bitcointalksearch.org/topic/m.1086135

Dooglus suggested a change in the clients source and after all else failed i built that (took me hours to make bitcoin build in windows) and it seems the problem is solved, if it ignores the single satoshi's it doesn't freeze (well hasn't in the last 24 hours at least)

Just waiting on his bitcoin address

the issue isn't bitcoind, it is windows, should have used linux Smiley

fyi it froze slightly quicker in ubuntu, but at least used 100% cpu instead of just one core

still should have used linux, aka Gentoo or Centos, but if this is a big bug, is it reported? Cause I am using the latest bitcoind and I never have this problem on my VPS and I get ~1000 php rpc calls. I use hardly any CPU.
NRF
sr. member
Activity: 279
Merit: 250
now that's what i call shotgun debugging!

It's Windows  Tongue .  Its the only sort of debugging I know that works with that OS.

Many a time some friend of family member asks my about a problem they are having with there windows box and the first thing I ask is "Have you switched it off and on yet?".  Works 90% of the time Tongue .

hero member
Activity: 504
Merit: 500
Yes, the the satoshi dice thread https://bitcointalksearch.org/topic/m.1086135

Dooglus suggested a change in the clients source and after all else failed i built that (took me hours to make bitcoin build in windows) and it seems the problem is solved, if it ignores the single satoshi's it doesn't freeze (well hasn't in the last 24 hours at least)

Just waiting on his bitcoin address

the issue isn't bitcoind, it is windows, should have used linux Smiley

fyi it froze slightly quicker in ubuntu, but at least used 100% cpu instead of just one core

although building probably would have been easier in linux with gitian, after the vm taking too long i just decided to make it work in windows, and it was interesting to say the least
legendary
Activity: 1498
Merit: 1000
Yes, the the satoshi dice thread https://bitcointalksearch.org/topic/m.1086135

Dooglus suggested a change in the clients source and after all else failed i built that (took me hours to make bitcoin build in windows) and it seems the problem is solved, if it ignores the single satoshi's it doesn't freeze (well hasn't in the last 24 hours at least)

Just waiting on his bitcoin address

the issue isn't bitcoind, it is windows, should have used linux Smiley
legendary
Activity: 2058
Merit: 1431
Try this;-

1. Shut everything down.

2. Disable your firewall.

3. Disable your Virus protection.

4. Go to User Account Control Settings and set it all the way to the bottom

5. Reboot (making sure that none of the above start automatically)

6. Start Bitcoind as administrator (right click on the Icon and "Run as administrator")

7. Start your process that invokes the PHP script (right click on the Icon and "Run as administrator")

8. See if it is fixed!!!

At that point, if it is not fixed restart all of the above and reboot.  If it is fixed work backwards up the list until it is broken again, then yell "Aha, that's the problem".  ;P
now that's what i call shotgun debugging!
legendary
Activity: 2940
Merit: 1333
Do you have a wallet which still causes the hangups and crashes but which is empty enough to share with me?  I'd like to be able to reproduce the problem without having to make thousands of SatoshiDice bets to get there...  Smiley

I have a copy of your wallet.  It contains:

  * 2121 addresses which have been used and are currently empty,
  * 1484 which contain a single satoshi,
  * 1 address with 8 separate single satoshis, and
  * 1 address with a single 48508 satoshi coin.

I'll see if I can get the client to hang when I ask it to select coins for a transaction.
hero member
Activity: 504
Merit: 500
Great to see you got a solve/workaround, would never have found that :-)
Even if i had of had the idea, i would never have found where in the source to change, i don't know the language and a lot of it is plain greek to me, hell making it build in windows was a mix of other people's stories and deleting everything under macos, linux or !windows in the .pro file

The source looks easy enough to follow, like php, but... there is a lot of it, and i have a feeling to know one part of it i would need to know most of it...

What i know of php i know from changing other people work, the same will probably hold true for bitcoin, next on my list is to make a client that lists the single satoshi's as a separate balance, and has a button/text box that will make a transaction with N single satoshi's - but i'm not stressing too much on it, just looking through source every now and then following variables to see what they do

Eventually computer programming will be done by thought, and there will be no need to "know how" to do it.... either that or computer programming will be done by computers, and they will have no need for us... except as entertainment...

note to self : add 'boredom' to future skynet
legendary
Activity: 2940
Merit: 1333
Just waiting on his bitcoin address

1 BTC received.  Thanks.
sr. member
Activity: 295
Merit: 250
Great to see you got a solve/workaround, would never have found that :-)
legendary
Activity: 2940
Merit: 1333
Yes, the the satoshi dice thread https://bitcointalksearch.org/topic/m.1086135

Dooglus suggested a change in the clients source and after all else failed i built that (took me hours to make bitcoin build in windows) and it seems the problem is solved, if it ignores the single satoshi's it doesn't freeze (well hasn't in the last 24 hours at least)

Just waiting on his bitcoin address

I PM'ed drakahn my address after reading the other thread, then caught up on this thread.  I guess I may as well post the contents of the PM here:

Hi.

I'm glad my little change worked for you.

My address is: 1Up2upZ1xo4tBoq86GLYywwRmshzJc7tA

I hadn't seen your thread offering the bounty, but would have been interested to look into the problem.

Do you have a wallet which still causes the hangups and crashes but which is empty enough to share with me?  I'd like to be able to reproduce the problem without having to make thousands of SatoshiDice bets to get there...  Smiley
hero member
Activity: 504
Merit: 500
Yes, the the satoshi dice thread https://bitcointalksearch.org/topic/m.1086135

Dooglus suggested a change in the clients source and after all else failed i built that (took me hours to make bitcoin build in windows) and it seems the problem is solved, if it ignores the single satoshi's it doesn't freeze (well hasn't in the last 24 hours at least)

Just waiting on his bitcoin address
hero member
Activity: 560
Merit: 500
I am the one who knocks
Did you get this solveD?
hero member
Activity: 504
Merit: 500
okay so i want to use sendmany to be able to control where the return tx get sent to, but it freezes fast using sendmany

changing back to sendtoaddress it lasts about 8 hours (1200 transactions this last time) but pays out a lot in fee's then freezes leaving me with all the losses all over the place
http://blockchain.info/tx-index/14167011/3c4ce78154144dcc3b420ec1f86bbf0944ea171dac8e6b35261e6485e51ff14c
to organise, and often when organising the client throws "Failed to create transaction" which i suspect is related to the bot failing

at least it died while it was ahead this time.
Pages:
Jump to: