What to do when you find a bug in a published library?

22 Dec 2010

I found a small bug in the library I have been using to access an ADXL345 through SPI (the details of the bug are at the bottom of this message; the specifics are not important to my question here).

I'm wondering what the best thing to do about this bug is. It seems like the library was created and published by Aaron Berk, then modified and re-published by Jose R Padron. Certainly, I can fix the bug and republish it myself, but there doesn't seem to be a way to let Aaron and Jose know, so they can fix it and publish a new version, nor a way to warn others who are using the libraries from either of them.

Am I missing something? This wiki-style site doesn't seem to let me make comments on other people's code, and doesn't seem to allow real 'versioning' or 'revisions', even though it has the concept of 'Revision history' for each library by each person. It seems like it's going to result in an explosion of different version of libraries from different people, and no way for a new user to know which one is reliable/stable.


PS - The specific bug in the ADXL345 library is:

Function setFifoControl incorrectly attempts to set the value of the ADXL345_FIFO_STATUS register, instead of ADXL345_FIFO_CTL. Since ADXL345_FIFO_STATUS is a read-only register, the only effect is that ADXL345_FIFO_CTL remains at its previous value (which is 0x00 after reset).

22 Dec 2010

Hi Owen,

At the moment, we're using the distributed version control model, where you can fork someones work and republish it yourself. This means there is no central repository, and each user has their own projects. We're also currently experimenting with git as the underlying version control system, so we can make the actual versioning even better.

However, this does have the downside you suggest. At the moment, I'd recommend making a fix and messaging the original author (just go to their profile page). You can then ask them to incorporate the fix, or failing that update the wiki page to point to your fixed version too.

I do think some form of central repository might be interesting, as would groups to allow collaboration; we'll explore this more when we've got git integrated. But for now, just post a fix, request a pull from the original author, and update the wiki.