Re: [Bitcoin-development] 0.4rc1 known bugs

2011-09-06 Thread Pieter Wuille
On Sun, Sep 4, 2011 at 13:59, Pieter Wuille
pieter.wui...@cs.kuleuven.be wrote:
 I've compiled bitcoind with Gavin's DEBUG_LOCKORDER, and fixed two potential
 reported deadlock issues (see 
 https://github.com/sipa/bitcoin/commits/lockfixes).

My mistake: these are not actual potential deadlocks, as all locking
of cs_vRecv/cs_vSend
happens inside TRY_CRITICAL_SECTION blocks. Gavin, maybe you can add the rule to
your debug code that ignores critical sections which are only locked
through TRY_...?

 + sipa found what looks like a deadlock between the addr-handling and
 IRC-join-handling code.

Regarding the actual deadlock between IRC seeding and AddAddress:

Internally, DB also uses pthreads to implement the txn_begin()/commit() scheme,
though I'm not sure with which granularity. These need to be taken into account
when searching for deadlocks, but are obviously not detected by
DEBUG_LOCKORDER.

In particular here, the processing of addr created a db transaction for the
entire message, while only locking cs_mapAddresses inside AddAddress. For
IRC seeded addresses however, no db tx was precreated, and AddAddress first
locked cs_mapAddress, and then did the database write (causing a lock) inside.

A solution: in main.cpp, ProcessMessage, case addr:

  // Store the new addresses
  CAddrDB addrDB;
+ CRITICAL_BLOCK(cs_mapAddresses) {
  addrDB.TxnBegin();
  int64 nNow = GetAdjustedTime();
  int64 nSince = nNow - 10 * 60;

  }
  }
  addrDB.TxnCommit();  // Save addresses (it's ok if this fails)
+ }
  if (vAddr.size()  1000)


which makes sure that cs_mapAddresses is always entered before starting
a database transaction.

However, there may be similar issues in other place where TxnBegin is called
explicitly. Also, maybe there are other solutions, like changing BDB parameters
that make the db transaction fail instead of block, for example.

-- 
Pieter

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] 0.4rc1 known bugs

2011-09-06 Thread Luke-Jr
Got a fix for the encrypted-wallet mining issue:
- unique_coinbase

It depends on (and merges) the getwork_dedupe fix already common on pools and 
other miners who pay attention to the latest mining fixes.

To merge:
  git fetch git://gitorious.org/~Luke-Jr/bitcoin/luke-jr-bitcoin.git \
unique_coinbase  git merge FETCH_HEAD

--
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] 0.4rc1 known bugs

2011-09-05 Thread Michael Grønager
Sorry, by bad - first clean checkout for quite a while (must have changed it 
earlier myself...).

/M

On 05/09/2011, at 14:42, Luke-Jr wrote:

 On Monday, September 05, 2011 3:25:47 AM Michael Grønager wrote:
 Findings - compile (I do not use the UPNP feature):
 in the makefile.unix I have to change the:
 USE_UPNP:=0
 to
 USE_UPNP:=
 i.e. it is defined if it is 0 !
 
 Yes, the default is UPnP supported, disabled by default (USE_UPNP=0), not 
 UPnP not supported (USE_UPNP=). This is documented in build-unix.txt ...
 
 --
 Special Offer -- Download ArcSight Logger for FREE!
 Finally, a world-class log management solution at an even better 
 price-free! And you'll get a free Love Thy Logs t-shirt when you
 download Logger. Secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsisghtdev2dev
 ___
 Bitcoin-development mailing list
 Bitcoin-development@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bitcoin-development

Michael Gronager, PhD
Owner Ceptacle / NDGF Director, NORDUnet A/S
Jens Juels Gade 33
2100 Copenhagen E
Mobile: +45 31 62 14 01
E-mail: grona...@ceptacle.com



--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] 0.4rc1 known bugs]

2011-09-04 Thread Pieter Wuille
On Sat, Sep 03, 2011 at 08:13:14PM -0400, Gavin Andresen wrote:
 Quick status update on 0.4; I probably won't have time to tackle these
 properly before Tuesday:
 
 + sipa found what looks like a deadlock between the addr-handling and
 IRC-join-handling code.

I've compiled bitcoind with Gavin's DEBUG_LOCKORDER, and fixed two potential
reported deadlock issues (see 
https://github.com/sipa/bitcoin/commits/lockfixes).

No deadlock warnings are given any more, but the issue remains. Just starting up
bitcoin with an empty addr.dat seems enough to cause it every few attempts. 
Is there is locked code that waits for an event that never occurs?

-- 
Pieter

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development


Re: [Bitcoin-development] 0.4rc1 known bugs

2011-09-03 Thread Matt Corallo
On Sat, 2011-09-03 at 20:13 -0400, Gavin Andresen wrote:
 Quick status update on 0.4; I probably won't have time to tackle these
 properly before Tuesday:
 
 + sipa found what looks like a deadlock between the addr-handling and
 IRC-join-handling code.
 + UukGoblin reports a deadlock problem on a bitcoind handling getwork 
 requests.
 
 If you want to get more familiar with the bitcoin code and you have a
 lot of patience, tracking down deadlocks a great way to do it.
 
 + ArtForz found a performance bug with transactions that have
 thousands of inputs and outputs on the solidcoin test network.
  (not as big an issue for bitcoin due to fees being based on
 transaction size, but still worrying)
 
+ (my fault) Gitian doesnt build properly.


--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development