Bitcoin Forum
December 06, 2024, 08:04:26 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: [solved/paid][1btc reward] PHP RPC commands freezing bitcoin  (Read 4337 times)
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
August 08, 2012, 06:34:50 PM
 #21

Just waiting on his bitcoin address

1 BTC received.  Thanks.

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
drakahn (OP)
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500



View Profile
August 08, 2012, 07:09:42 PM
 #22

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

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
August 08, 2012, 08:37:23 PM
 #23

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.

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1452



View Profile
August 08, 2012, 09:49:54 PM
 #24

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!

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
gweedo
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000


View Profile
August 08, 2012, 09:55:49 PM
 #25

Yes, the the satoshi dice thread https://bitcointalk.org/index.php?topic=77870.msg1086135#msg1086135

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
drakahn (OP)
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500



View Profile
August 08, 2012, 09:58:01 PM
 #26

Yes, the the satoshi dice thread https://bitcointalk.org/index.php?topic=77870.msg1086135#msg1086135

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

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
NRF
Sr. Member
****
Offline Offline

Activity: 279
Merit: 250



View Profile
August 08, 2012, 10:06:25 PM
 #27

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 .

gweedo
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000


View Profile
August 08, 2012, 10:07:35 PM
 #28

Yes, the the satoshi dice thread https://bitcointalk.org/index.php?topic=77870.msg1086135#msg1086135

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.
drakahn (OP)
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500



View Profile
August 08, 2012, 10:20:10 PM
 #29

Yes, the the satoshi dice thread https://bitcointalk.org/index.php?topic=77870.msg1086135#msg1086135

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

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
August 08, 2012, 10:58:12 PM
 #30

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?

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
drakahn (OP)
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500



View Profile
August 08, 2012, 11:06:56 PM
 #31

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)

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
August 08, 2012, 11:59:25 PM
 #32

I just noticed bitcoin-qt is using 100% CPU.  It's still responsive, but it's a start...

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
August 09, 2012, 12:13:45 AM
 #33

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.

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
drakahn (OP)
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500



View Profile
August 09, 2012, 12:19:50 AM
 #34

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

14ga8dJ6NGpiwQkNTXg7KzwozasfaXNfEU
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1333



View Profile
August 09, 2012, 01:03:37 AM
 #35

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.

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!