Bitcoin Forum

Bitcoin => Project Development => Topic started by: MatthewLM on October 18, 2013, 03:09:47 PM



Title: [REVOKED] Networking problems on OSX. Libevent/Libev.
Post by: MatthewLM on October 18, 2013, 03:09:47 PM
Edit: This offer has been revoked as a solution has been found. evthread_use_pthreads(); was not called and it needed to be.

Hello!

I have a problem with the networking code in cbitcoin which only occurs with OSX. I've tried using the libevent and libev libraries and both of them seemingly give the same problem. I've got libevent and libev to work on Linux Mint. If you try running the tests for cbitcoin on OSX Mountain Lion, the testCBNodeFull should stall because the nodes do not receive events for the connection, nor does the connection timeout work. What I have done is try to create a minimised example of the problem which clearly shows that the connection events are not working. I looked at tcpdump, and it appears to me that the connection is established. For some reason testCBNetworkCommunicator works when the code is almost identical. I should also mention that sometimes it has been working for me, and once the connection event was fired but not the accept event. Most of the time none of the events fire.

The code for the minimised example and more information is shown on this stack overflow question: http://stackoverflow.com/questions/19364342/libevent-code-not-connecting-or-timing-out-on-osx-mountain-lion

You can download and try cbitcoin using:

Code:
git clone https://github.com/MatthewLM/cbitcoin.git
cd cbitcoin
./configure
make test

The problematic code can be found on the accountingAndNodes branch.

Use "make debug-test" to build and test with debug symbols enabled. The libev counterpart to the default libevent code is currently found in /experimental. You will need to modify the makefile slightly to get that to work which is a simple affair.

Thanks,

Matthew Mitchell


Title: Re: [0.25BTC BOUNTY] Socket problems on OSX. Libevent/Libev.
Post by: MatthewLM on October 21, 2013, 04:54:21 PM
The stackoverflow bounty ends in two days, so make sure not to miss out! I have also raised the bitcoin bounty to 0.25BTC. Not only that, the price of bitcoin has been rising. I suspect this should be an easy problem to solve for anyone with experience of libevent or libel or perhaps socket programming on OSX.


Title: Re: [0.3BTC BOUNTY] Networking problems on OSX. Libevent/Libev.
Post by: MatthewLM on October 22, 2013, 12:05:39 PM
Last chance: The stackoverflow bounty ends tomorrow. I've also raised the bitcoin bounty one last time to 0.3BTC. Not only that, but the price of bitcoin has risen quite substantially making this a much more attractive offer.


Title: Re: [REVOKED] Networking problems on OSX. Libevent/Libev.
Post by: MatthewLM on October 23, 2013, 03:20:02 PM
This offer is now revoked. I needed to call evthread_use_pthreads(); which I forgot to do.