Alo Sarv
lead developer

Donate via

Latest Builds

version 0.3
tar.gz tar.bz2
Boost 1.33.1 Headers
MLDonkey Downloads Import Module Development
Payment completed
Development in progress.
Developer's Diary

Sunday, May 22, 2005

Hunting same bug for two days?

*sighs*. Apparently, I just spent two days trying to track down a single bug. It all started yesterday morning, when I went to fix some strange crash somewhere in ED2K::Client class, in socket event handler. Some tracking showed that the crash occours after Client calls destroy(), which in turn deletes the socket (if existing). This lead to a chain-reaction of events inside Scheduler, which was supposed to abort all pending requests for the socket, as well as clean everything up, and if new events came in between the time of actual implementation-socket destruction (which is lazily-deleted by SocketWatcher), or new events were already in pending events queue, those events should'v been quietly discarded. However, they weren't, leading to the afore-mentioned crash.

Fixing it wasn't trivial, however. Most obvious solution was to add simple ref-counted boolean in SSocketWrapper (internal Scheduler class for wrapping the frontend/backend handlers together), which could be checked, however, the checks always succeeded (even though even debugger showed that the ref-counted bool was set to false). So I sat there, looking at it rather stupidly - debugger shows all ok, but code behaves differently.

Today, I believe I finally caught it. Apparently, notify() methods in Scheduler were declared const, however, invoking boost::function is (or at least should be) non-const operation. No compilers detected this, but it would seem this lead to the afore-mentioned crash.

Since I don't have verification yet whether it's fixed or not, I'll leave it running over night and see if it appears again, but initial test shows that it should be fixed, so the patch can be merged to SVN soon.


On other news, we'r planning on introducing Hydranode DevCenter, which will include wiki, bug/feature/patch-tracker and svn-browser, designed to give both developers and users a quick and easy overview of the development, and ease the participation in the development process.

I'm also considering creating daily-snapshots section (generated manually, not automatically), to further encourage people (yes, that means you, dear blog reader) to help in the development process.

"Given enough eyeballs, all bugs are shallow." - Linus' Law

Madcat, ZzZz

having a working import function would attract more users ( thus more eyeballs ), starting downloads from scratch isnt fun
will you be using getsockopt, setsockopt to mark traffic as bulk using the tos field?
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?