Slashdot Mirror


Bounds Checking for Open Source Code?

roarl asks: "Is anyone working on an Open Source bounds checking system? (A system that checks a program at runtime for array out of bounds access, reading uninitialized memory, memory leaks and so on). I've been using BoundsChecker for some time and believe me, there are situations where you know you are going to spend hours debugging unless you let BoundsChecker sort it out for you. But it annoys me that I have to transfer (and sometimes port) the buggy program to Windows each time. I'd much rather stay in Linux. Insure works on Linux. I haven't tried Insure for some time, but last time I tried I wasn't especially impressed. Purify seems still not to support Linux, but on other Unix platforms it works great. The problem with all of these products is that they are so da*n expensive. So it makes me wonder, are all Open Source programmers doing without them? If so, what can we expect of the quality of Open Source developed programs? If not, is there a free alternative?"

6 of 90 comments (clear)

  1. A general case by big_hairy_mama · · Score: 5, Interesting

    Isn't bounds checking just a specialized case for checking any type of access to uninitialized memory? There are several tools that provide replacements for malloc() that can track *all* memory allocation, and some, like Valgrind, provide almost a virtual machine that tracks basically everything your program does. Any time you read, write, or allocate memory, Valgrind will track it, and tell you if it is in error. Like I said, array bounds checking is just a special case of this.

  2. memprof? by grek · · Score: 2, Interesting

    How about memprof?

  3. Have you looked into Immunix and StackGuard? by mikehoskins · · Score: 2, Interesting
    See http://www.immunix.org/


    While it may not be EXACTLY what you want, it may be MORE....

  4. Insure++ by vipw · · Score: 3, Interesting

    Insure++ is heavenly, I don't know how long it's been since you've used it, but it detects almost all errors. I think most open source people who use it have their company buy it for them though; it is very expensive. It does very good bounds checking for both reading and writing, but it's real amazing help is in tracking down bad or dangling pointers.

    It also does very detailed tracking of memory leaks, but can get a little confused when you store the last referencing pointer in a hashtable.

    I think other than its somewhat clunky UI, price is the big killer. it takes a pretty fast machine to be able to use it much and it has a large up front cost, plus maintainence(upgrades and support) fee. It's really too bad they don't have a program in place with someone like sourceforge to let people use Insure++ on the test machines because that would not only be great advertising for them, but also could really help the open source developers too.

  5. Re:A simple answer to a simple question... by bsartist · · Score: 2, Interesting

    I don't really see how the parent post is flamebait. It's a fair answer to the question that was asked. The write-up asks whether OSS developers are simply going without automated bounds checking. The answer is yes, many people are doing exactly that, by relying on interpreted languages that don't require such in-depth memory management.

    Of course, doing so doesn't do away with the problem entirely, it simply moves the problem up a level - how does one handle bounds checking when debugging a language interpreter?

    --
    Lost: Sig, white with black letters. No collar. Reward if found!
  6. Re:Use scripting and VM languages, where possible. by gerardrj · · Score: 3, Interesting

    Of course with PERL you could have the best of both worlds:

    Develop in PERL with the flexibilty of the interpeter and all the garbage collection and neato stuff built-in.

    When you hit a "stable" release version, use the O module to compule the code. either to Perl byte code for faster loading, or to one of two versions of C code. One just spits out calls to the perl/system libraries, the other is standard C code.

    --
    Article X: The powers not delegated... by the Constitution...are reserved...to the people