Slashdot Mirror


Valgrind 1.0.0 Released

Anonymous Lazy Boy writes "Yesterday saw the official release of Valgrind 1.0.0. Valgrind is a C/C++ programmer's dream come true: effortless memory allocation checking, uninitialized memory access, leaks etc. Purify for Linux has arrived, only better: contrary to its commercial (non-Linux) sibling, checking is performed directly on the executable, no re-linking necessary. The technology behind Valgrind is highly fascinating and explained down to the very gory details in the documentation."

295 comments

  1. What's the fun in that? by G0SP0DAR · · Score: 0, Redundant

    This may be a practical tool in some respects, but I would not have so much respect for someone who depended on that to have any working code. As the old saying goes, "real programmers read core dumps."

    --


    Calm down, it's *only* ones and zeroes.
    1. Re:What's the fun in that? by MisterBlister · · Score: 2
      This may be a practical tool in some respects, but I would not have so much respect for someone who depended on that to have any working code. As the old saying goes, "real programmers read core dumps."

      Are you trolling? Or stupid? Or have you never used Purify? I've yet to meet a developer who used Purify (or in some cases BoundsChecker or similar tools, though IMO Purify is hands down the best if you can afford it) that decided it wasn't really helpful and then stopped using it.

      These tools give you SO MUCH more than just simple stack tracing after a crash. Foolish is the developer who ignores their benefits.

    2. Re:What's the fun in that? by superpeach · · Score: 2, Insightful

      Good programmers will not depend on something like this to get their code working, but it will still be a great tool for them to make sure they didnt mess up somewhere in the last 9hours of solid coding. Its probably kind of like wearing seatbelts, you dont need them to be able to drive but if something goes wrong they come in quite handy.

    3. Re:What's the fun in that? by mce · · Score: 1

      Not only that. There aren't enough good programers to go around (I'll admit that my criteria for this label are extremely stringent, but still). So we need the average ones. And those need a lot of support.

      Besides, I've seen Purify detect errors in code written by the best programer I've ever met. This guy is way beyond what most fellow programers can imagine both in terms of architecture/design and in terms of attention do detail in implementation. But just like the rest of us he's not infallible.

    4. Re:What's the fun in that? by Greg+Lindahl · · Score: 3, Funny


      I am neither trolling nor stupid, and I don't find Purify that useful. I am also not as insulting to people who don't agree with me.

      In the 60's, we programmed in Fortran, and debugged with PRINT statements.

      In the 70's, we programmed in Pascal, and debugged with WRITE statements.

      In the 80's, we programmed in C, and debugged with printf statements.

      In the 90's, we programmed in C++, and debugged with >>.

    5. Re:What's the fun in that? by MisterBlister · · Score: 4, Funny
      In the 80's, we programmed in C, and debugged with printf statements. In the 90's, we programmed in C++, and debugged with >>.

      So you *are* stupid after all!

    6. Re:What's the fun in that? by Anonymous Coward · · Score: 0


      Eh?

      You were reading from standard in to debug your errors? ... perhaps you mean "" ? ;-)

    7. Re:What's the fun in that? by Anonymous Coward · · Score: 2, Interesting

      So, basically, you are saying that you work in the most inefficent way possible because it makes you more manly. I tire of people who will try new tools and techniques because it isn't the way our forefathers did it. Bottom line: I can find and fix defects faster with a debuggers and such than with prinln/>>/printf etc. Hence, the reason we call it a "Poor Man's Debugger." As an engineer, you should always be looking to improve the efficency with which you work. End of discussion.

      Whether or not you like Purify and its ilk are inconsequential, but your refusal to open your mind to new methods and techniques are what repulses people. Attitudes like yours create COBOL and FORTRAN system maintainers -- not true software engineers.

    8. Re:What's the fun in that? by iabervon · · Score: 2

      Read the core dump? Ha! Good programmers know what's wrong from when the segfault occured.

      But if you're going to use tools, having a tool that tells you when a value gets written somewhere wrong is far better than one that tells you what was going on when the program actually crashed.

      This is actually vital for bugs where an uninitialized value is assumed to be zero, and it always is zero in your tests, but...

    9. Re:What's the fun in that? by nr · · Score: 1

      True, the only things I need and use is gcc, vi and make, but gdb and ddd comes handy sometimes then you have to track down some nasty bug that causes coredumps. Highlevel debug tools is good, sometime in the future they may help you.

      vi and gcc are my two top favorite applications that I love to use.

    10. Re:What's the fun in that? by Anonymous Coward · · Score: 0

      Current colleague argues along the lines of the attitude you attack.
      How do you deal with someone who claims to despise Unix/Linux because 'the shell commands represent a stream of consciousness, not a design', yet hates GUIs, because they don't make anything easier for all the resources consumed.
      Dude uses a character-mode DOS application from the 286 era to do as much as possible--hates long file names.
      While he is revered for knowing a lot of stuff (I've plucked a few algorithms from his brain, admittedly) he doesn't appear to have done anything more serious than an oversized script.
      How, I ask rhetorically, do you seriously undertake any project of size without decent tools?

    11. Re:What's the fun in that? by unoengborg · · Score: 2, Insightful

      You mean just like real programmers don't use, editors
      but write the code directly to the compiler input stream. They don't need debugging tools either.

      --
      God is REAL! Unless explicitly declared INTEGER
    12. Re:What's the fun in that? by Anonymous Coward · · Score: 0

      Congratulations, you've been trolled.

      Spit the hook out and go back to reading the sensible posts; they'll hurt less.

    13. Re:What's the fun in that? by mcfiddish · · Score: 2

      What about libraries that are doing all kinds of memory allocation behind the scenes? I'll be jiggered if I know what the hell XAlloc-this and XFree-that are doing.

      Using valgrind, I've found several memory leaks in my code using the libX11 and the FreeType libraries that strictly were my fault, but were counterintuitive and I never would have found them solely reading the documentation and using print statements.

      I'm thrilled to have a tool like valgrind on linux, finally. Thanks Julian!

    14. Re:What's the fun in that? by stekman · · Score: 1

      Real programmers does not use compilers, they program using small magnets directly on the harddisk surface. :-)

    15. Re:What's the fun in that? by Guillaume+Laurent · · Score: 1

      > In the 90's, we programmed in C++, and debugged with >>.

      If you debug C++ with '>>', it's no wonder you have problems. Try '<<' next time. Works a lot better when applied to std::cout.

    16. Re:What's the fun in that? by fredrik70 · · Score: 1

      printf's and such are not all bad. Sometimes you get errors that only pop up if running at full speed, not stepping through the code. I usually use the good old fprintf() and/or cerr in order to track it down.
      But true, debuggers and tools such as Boundchecker does help shitloads when hunting down some stuff.

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    17. Re:What's the fun in that? by ajs · · Score: 2

      Debugging problems that you're aware of is one thing, and yes I just print status messages to find that kind of problem most of the time too. Memory checkers are more useful for finding the kinds of bugs that you don't know are there. It's a sanity check, if you will. If you run one, and it doesn't find anything, all the better!

    18. Re:What's the fun in that? by Greg+Lindahl · · Score: 2


      I said nothing of the sort. I have tried many debuggers, and the reason that I debug with print statements is that it works. I do a lot of parallel and distributed programming; I don't make a lot of elementary mistakes when I program.

      Please stop jumping to conclusions so quickly.

    19. Re:What's the fun in that? by G0SP0DAR · · Score: 1

      Not using debugging tools is only stupid when done on someone else's time. Dehumanization may not be an issue for them. This won't even matter when computers can program themselves. However, letting the computer do everything else for you is no way to impress your friends. It's called taking unnecessary risks. If you have nothing to lose, then why the hell not? If you want the same shock value as code proofed with Valgrind, try impressing a 1337 group of web designers using MS Frontpage. Never going to happen. And sometimes, doing things the hard way is the only good way to get things done.

      --


      Calm down, it's *only* ones and zeroes.
  2. Title confusion by davidsansome · · Score: 0

    Did anybody else read that as "Viagra"? Might have something to do with the poll...

    --
    -- Wibble
    1. Re:Title confusion by Soul-Burn666 · · Score: 1

      Nope, sorry!

      But I guess that's what happens when you only develop software and not see girls...

      --
      ^_^
  3. wow, top ten by snitman · · Score: 1

    sorry, that was off topic, but this C++ this is happy news for me

  4. Valgrid is not as complete as Purify by Anonymous Coward · · Score: 0

    Well, Valgrid doesn't handle UMCs, and it does have a lot of shortcomings, like cleaning up MMX code etc.

    Calling it a Purify-killer at this point, only shows that you have never used Purify.

    1. Re:Valgrid is not as complete as Purify by MisterBlister · · Score: 2
      Agreed. I use Purify constantly for my day job. I took a look at this hoping to find something nearly as good as Purify (since they advertise it as being BETTER!) and free, but there's a long long list of ways in which it is vastly inferior to Purify right now.

      Beware of gratiutious hype.

      And, btw, Purify (never used it under Linux so maybe it is different there) can also work on executables (and DLLs/SOs, etc) without a relinking. When's the last time the person who posted used Purify? 1996?

    2. Re:Valgrid is not as complete as Purify by mce · · Score: 2, Interesting

      The bad thing about Purify is that there ain't no Linux version.

      I have used Purify ever since it was first put onto the market by Pure Software about a decade ago. But nowadays, Linux is becoming our real development platform, so if Rational ain't careful: exit Purify. Yes, it's sad, but I've told them often enough that Linux support is what they should bring me, not yet another rewrite of their licensing scheme.

    3. Re:Valgrid is not as complete as Purify by jelle · · Score: 4, Insightful

      "but there's a long long list of ways in which it is vastly inferior to Purify right now"

      How about showing us that list?

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
    4. Re:Valgrid is not as complete as Purify by Polo · · Score: 2

      Especially since purify doesn't run on linux...

    5. Re:Valgrid is not as complete as Purify by XaXXon · · Score: 2

      And, btw, Purify (never used it under Linux so maybe it is different there) can also work on executables (and DLLs/SOs, etc) without a relinking.

      You wanna know why you've never used Purify under Linux? Cuz it's not available. AFAIK, no Rational tools are available for Linux. When I was looking for Linux tools at my previous job, the only memory checker available for Linux was insure++. I also found that there were no commercial profilers available for Linux. gprof just doesn't cut the mustard, especially in multithreaded apps, and Rational's Quantify wasn't available for Linux. When I called Rational to ask if they planned on supporting Linux, they said "Maybe sometime in the future", but when I continued questioning them, they said they had no immediate plans to start working on Linux versions of any of their software.

      So, while Valgrind may not be as complete as Purify (I don't know if it is or not), it's a helluva lot cheaper than insure++ (~$4K license -- well worth it if it's not your money), and better than any other Free software I've seen.

    6. Re:Valgrid is not as complete as Purify by Pauly · · Score: 4, Interesting
      Especially since purify doesn't run on linux...

      Excellent point. It's also another reason why I've found Parasoft's Insure++ to be superior to Purify.

      I'm sincerely looking forward to checking out Valgrind. Can someone post a feature comparison of these three?

    7. Re:Valgrid is not as complete as Purify by mce · · Score: 3, Informative
      When I called Rational to ask if they planned on supporting Linux, they said "Maybe sometime in the future", but when I continued questioning them, they said they had no immediate plans to start working on Linux versions of any of their software.

      Franckly, I have the impression that Rational regard Purify and Quantify as cash cows that should not be touched unless absolutely required. All they ever did since they bought them was:

      • implement a Windows version (there's more cash at hand in that world);
      • change the licensing scheme to be ever more annoying;
      • fix minor annoyances after HP or Sun released new compiler versions;
      • finally add gcc support for version 2.95 when 3.0 had already been released for some time.

      Other than the gcc 2.95 thing, I have seen no real improvements in years (I don't use Windows). Over the years, we forked over a lot of money for "support", though.

      It's a great tool, but I'm not impressed with the company behind it.

    8. Re:Valgrid is not as complete as Purify by leob · · Score: 3, Informative

      There are two important features of Purify that are most notably absent in valgrind:
      - the ability to specify user's memory allocators/deallocators (it is mentioned in the documentation, though)
      - the ability to detect array bound violations (Purify's ABR/ABW).

      You decide which of the two is more important for you.

    9. Re:Valgrid is not as complete as Purify by Citizen+of+Earth · · Score: 3, Interesting

      the ability to detect array bound violations (Purify's ABR/ABW)

      Practically speaking, I think that it frequently does. It allocates memory blocks in such a way that writing beyond the end of an array (or before the start) is detected as a bad-memory access, so it will catch array-bounds problems for dynamically-allocated 1D arrays and frequently n-D arrays.

    10. Re:Valgrid is not as complete as Purify by jelle · · Score: 3, Informative

      IIRC purify also doesn't guarantee to catch all oob accesses, so they probably use a similar technique.

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
    11. Re:Valgrid is not as complete as Purify by Anonymous Coward · · Score: 0

      Yeah, but Valgrind runs of NOTHING BUT LINUX, which makes it bloody useless.

  5. Any reviews? by ergo98 · · Score: 5, Interesting

    One thing I've found with automated QA products is that usually they have critical faults that prevent them from being realistically useful (for instance many of them grind to a halt or give false positives in multithreaded apps). How's this product for real world use? (And no this isn't a "Read the Article!" question...the article is like a press release and hence doesn't answer my question).

    1. Re:Any reviews? by Charles+Kerr · · Score: 5, Informative
      I've been using Valgrind on Pan, which is multithreaded, and it works fine. Maybe given more time I'll find features that I miss from Purify, but for now I'm very happy.

      Things I like better in Valgrind:

      • Valgrind works on Linux.
      • Valgrind doesn't require instrumenting each object file and library at build time. (This is a biggie)
      • Valgrind's run-time options are more flexible.
      • Valgrind works with both gcc 2 and 3.
      • Valgrind seems to run faster than Purify. (Different hardware and OSes, so this is a guess.)
      • Valgrind doesn't have a Motif GUI. ;)
      • Valgrind doesn't have an insane, broken license manager.
      • Valgrind's technical support is better. (Yes, I've dealt with both.)
      • Valgrind doesn't cost $2,364 per seat.

      Things I like better in Purify:

      • Purify can handle static libraries.
      • Purify makes it easier to disable errors/warnings from libraries out of your scope.
      • Valgrind doesn't work on Solaris, so I'm stuck with Purify for my day job. :)
    2. Re:Any reviews? by cant_get_a_good_nick · · Score: 1

      Valgrind doesn't work on Solaris, so I'm stuck with Purify for my day job.

      Is it possible to have your code portable to both OSes so you can run the tool, or will the higher ups feel this isn't a workable solution. I obviously have no idea of what you're doing, nor the effort of porting, just an idea to throw out. You might be able to say that you save debug time, and get a Linux version of their software in the process.

    3. Re:Any reviews? by Anonymous Coward · · Score: 0

      From the manual:

      > Programs run 25 to 50 times slower, and take a
      > lot more memory, than they usually would.

      If you're trying to fix something with a short runtime it's usable, but if you're trying to work on something that's a minute of reasonably intense computation in to a program, you'll expect to wait 25 to 50 minutes for your debug cycle. If it's taking you an hour per debug cycle without Valgrind, you can probably forget it:)

    4. Re:Any reviews? by Anonymous Coward · · Score: 0

      If you're at the point where you're using a tool like this to debug code, then you probably would want to do that on the target platform.

    5. Re:Any reviews? by Anonymous Coward · · Score: 1, Informative

      valgrind seems faster? bullshit! It's implemented as an x86 emulator (*cough* bochs *cough*). It slows down code by 20-50x.

    6. Re:Any reviews? by Kiwi · · Score: 2
      We've been using Valgrind to find memory leaks in my open source project; it caught a few subtle memory leaks which we didn't catch in our six months of testing by hand.

      I've been very pleased with it.

      I can not comment on how easy it is to use because other developers on the team have been using it instead of myself.

      - Sam

      --

      The secret to enjoying Slashdot is to realize that it should not be taken too seriously.

    7. Re:Any reviews? by Green+Light · · Score: 1

      Perhaps he does not even have a Linux box at work?

      --
      "Send an Instant Karma to me" - Yes
    8. Re:Any reviews? by Charles+Kerr · · Score: 5, Interesting
      On a Pentium 450 running Limbo, I can start up Pan 0.12.91 with valgrind --num-callers=16 --leak-check=yes --leak-resolution=med in one minute, nine seconds. On an otherwise-idle Sparc Ultra 10 running Solaris 7, it takes Pan built with "purify -chain-length=7 -cache-dir=/tmp -always-use-cache-dir=yes" more than 15 minutes to start up, with the CPU pegged at 100% the entire time.

      If there's a secret "Don't Run Slow" switch to Purify, let me know what it is.

    9. Re:Any reviews? by Citizen+of+Earth · · Score: 2

      Things I like better in Valgrind... Things I like better in Purify

      I've used Valgrind and Purify before and I find Valgrind much more useful. The big thing for me is that it runs on Linux, which is what I use for development at the office. This is the death of Purify for me, because I can get much higher performance Linux boxes than Solaris boxes for a reasonable price. The additional price of Purify to me is just adding insult to injury.

      I'm not sure what you by "Purify can handle static libraries" because I use static libraries with Valgrind all the time.

      The only thing that concerns me about Valgrind is the strange way that it tracks uninitialized varliable references: it only checks values when they are used for an index or a branch (the last time I read the documentation). Apparently it restricts to this case because people may copy around values or arrays that are uninitialized. I certainly don't do this. And I do really want to know when an uninitialized variable is first read.

    10. Re:Any reviews? by Anonymous Coward · · Score: 0
      Were you able to contact him ?

      I wish the project started moving too. Last thing I did on Valgrind was to get the CVS version and fail to compile everything cleanly without destroying my CVS repository.

      I have left it aside since then and because nothing reminds me to continue I never think about trying again. If the project was somewhat active I could get me to work on it a bit more, even join the team since I need Valgrind.

    11. Re:Any reviews? by Anonymous Coward · · Score: 0

      Well, suppose you have this :

      struct foo {
      int a;
      short b;
      };

      struct foo foo1;
      struct foo foo2;

      foo2.a = 1;
      foo2.b = 2;

      foo1 = foo2;

      And well, you WILL read two bytes of uninitialized memory there.... And well, THIS you do all the time in your program (and this is all explained in the docs anyway).

    12. Re:Any reviews? by Mark+J+Tilford · · Score: 1

      According to the article, compilers will pad out the size of structs to be a multiple of the word size. When that's done, copying one padded struct to another will cause the compiler to put in code for uninitialized reads into the end product.

      --
      -----------
      100% pure freak
    13. Re:Any reviews? by Anonymous Coward · · Score: 0

      better read your parent-thread:
      * Valgrind doesn't work on Solaris, so I'm stuck with Purify for my day job. :)

    14. Re:Any reviews? by Sanga · · Score: 2, Informative

      # Purify makes it easier to disable errors/warnings from libraries out of your scope.

      Details about Valgrind suppressions at:
      http://developer.kde.org/~sewardj/docs/manual .html #suppfiles

  6. sweet, better debuggers == better code by laymil · · Score: 1

    the better the debugger, the more errors its gonna catch. hopefully it'll be easier for people to catch and fix memory leaks now.

    sigh...the only thing is...i wish it were for windows...thats where i have problems with people writing programs with memory leaks (at least moreso than on my linux boxes)

    1. Re:sweet, better debuggers == better code by Ataru · · Score: 1

      Well, I have a clue, and I almost never have memory leaks. Some of my colleagues are not so fortunate. I'm a bit of a fan of garbage collection because it removes the problem (almost() completely. But will that make them better programmers? Probably not. Will it matter? Well, they will have no memory leaks I don't know. Discuss?

    2. Re:sweet, better debuggers == better code by Anonymous Coward · · Score: 0

      Memory leaks are more critical in embedded products and Linux is used in quite a few.

  7. If you're worried about threading/memory bugs by adam_megacz · · Score: 1, Redundant


    You could write your code in Java (shuder!), and then use the Java frontend to GCC to compile it down to a blazingly fast 100% native-code binary. And you can do it all without ever using non-free software (unlike Sun's compilers/JVMs).

    1. Re:If you're worried about threading/memory bugs by Anonymous Coward · · Score: 0

      Except the GNU version of Java has about 1/10 the features and twice the bugs of the Sun version because they're still years behind in implementing. Which is why almost everyone uses the free as in beer Sun or free as in beer IBM tools, compilers, and VMs.

    2. Re:If you're worried about threading/memory bugs by Anonymous Coward · · Score: 0

      bah! why would you shuder at Java, it obviously has its advantages especially in the memory management side of things.

    3. Re:If you're worried about threading/memory bugs by balthan · · Score: 1

      If you were going to do something like that, wouldn't it be easier to use Eiffel.

    4. Re:If you're worried about threading/memory bugs by Anonymous Coward · · Score: 0

      you obviously have no idea what you're talking about since compiling java code to object code using gcj does not produce "blazingly fast" code. bullshit check, 1, 2, bullshit check..

    5. Re:If you're worried about threading/memory bugs by adam_megacz · · Score: 5, Funny

      you obviously have no idea what you're talking about

      $ grep Megacz /usr/src/gcc-3.1/MAINTAINERS

      Adam Megacz adam@xwt.org

      Yeah, I probably know absolutely nothing about gcj...

    6. Re:If you're worried about threading/memory bugs by Anonymous Coward · · Score: 0

      This has been one of the best flames I've seen today. Kudos, and continue the good work w/ gcc. =)

    7. Re:If you're worried about threading/memory bugs by 10Ghz · · Score: 3, Funny

      0wn3d!

      --
      Lesbian Nazi Hookers Abducted by UFOs and Forced Into Weight Loss Programs - -all next week on Town Talk.
    8. Re:If you're worried about threading/memory bugs by affenmann · · Score: 2

      If you're worried about threading/memory bugs, you rather want to compile ML or HASKELL to a blazingly fast 100% native-code binary, without ever using non-free software.

      Java's type system still allows wrong type casts, which can only be checked at runtime, and this gives essentially memory bugs. I wish Java had a better type system with proper polymorphism (like Generic Java) instead of these ugly casts to Object and back...

  8. Re:Strangeness by SpatchMonkey · · Score: 0

    You mean like this program?

  9. An excellent tool by alriddoch · · Score: 5, Interesting

    Valgrind really is an amazing bit of software. Working on large application which use many different libraries it becomes harder and harder to work out where those bugs are, and all the free tools I have tried so far have done a very poor job of finding them. I have now been using valgrind for several months, and got 1.0 straight from the author by mail having reported a few bugs in earlier versions. It speeds up finding those hard to reproduce bugs, and often shows up memory errors which you didn't even know were there. It is also excellent for detecting memory leaks as it knows the difference between memory that has been genuinly leaked, and memory which is not freed, but still has a reference to it stored when the program exits. All the software I work on is now much more robust than it was a few months ago, and much of this I can put down to valgrind being available. This is the only free tool that comes close to the commercial tools like Purify, and in many ways it is superior to some of the expensive high end tools. The author is extremely responsive and helpful, and has been developing valgrind full time self funded.

    1. Re:An excellent tool by soulcuttr · · Score: 1

      I'm not sure why, but I find it amusing to picture the author trying to find bugs in Valgrind, actually using Valgrind.

      Perhaps it shouldn't seem as funny to me in days when Subversion is self-hosting, and GCC compiles itself.

      -Sou|cuttr

    2. Re:An excellent tool by Anonymous Coward · · Score: 0

      Valgrind is reinventing the wheel. There already exists the tool Checker GCC which does the exact same thing.

    3. Re:An excellent tool by sir99 · · Score: 1

      Valgrind doesn't require you to recompile/relink your code. Also, Valgrind allows you to do extra runtime checking on specified areas of memory, which I don't think checkergcc provides.

      --
      The ocean parts and the meteors come down
      Laid out in amber, baby.
  10. Valgrind by jj666 · · Score: 1

    I bet you can't say that backwards ;o)

    --
    [JJ]
    "Insert Dead Smart n Clever Sig Here So I Look Brainy"
    1. Re:Valgrind by Nighttime · · Score: 1

      What's so funny about dnirglaV?

      --
      I've got a fever and the only prescription is more COBOL.
  11. this rocks run your desktop apps by johnjones · · Score: 0, Offtopic

    Valgrind rocks

    companys should employ this man (he did work for MS research labs here in cambridge ;-)

    I found bugs in GDB because of valgrind so hey debug a debugger .....

    also lanch your GNOME or KDE app and report those memory leaks

    also has Bzip2 on the CV

    respect

    regards

    John Jones

    p.s. Julian I owe you a beer contact me at work

    1. Re:this rocks run your desktop apps by jelle · · Score: 1, Offtopic

      "companys should employ this man"

      I know my company will be employing this on every project I work on ;-))

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
    2. Re:this rocks run your desktop apps by Anonymous Coward · · Score: 0
      Yeah. Anybody else like his using

      instead of a simple "."? I can almost understand the people that refuse to use any capitalization whatsoever, but putting every single sentence on a seperate line? WHY?!??

      Too much programming, I guess. I should be glad he didn't end everything with a;

    3. Re:this rocks run your desktop apps by Anonymous Coward · · Score: 0

      earth to asswhole, some applications intentionally do not reclaim memory. some static objects are ok not to delete, and will show up as memeory leaks in debuggers. lots of guis have objects that are never freed from the heap, since they live for the lifecycle of the app. Like the buttons, etc. so I encourage the naive to waste the kde/gnome app developers time by running their app through some tool you don't understand and sending them the output.

    4. Re:this rocks run your desktop apps by Anonymous Coward · · Score: 0

      How can an offer of beer ever be off-topic?

  12. Wow! by jelle · · Score: 2

    I've been waiting for this. I've seen the malloc debuggers and the like (electric-fence, gccchecker, etc), but they're all incomplete, have problems with C++ code, or are just for allocated memory ('new'-ed objects, malloc()-ed data, etc), not for regular vairables: statics, local variables, etc.

    But valgrind seems to be just right I gave it a quick tryout and it is looking good!

    Wow.

    apt-get install valgrind.

    And all we need now is a gvalgrind, and/or a kvalgrind gui interface just like purify has and I'm all happy.

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.
  13. Great! by Anonymous Coward · · Score: 0

    Maybe now it'll actually be possible to plug up those damn memory leaks.

  14. Re:Strangeness by SpatchMonkey · · Score: 0, Troll

    Wow, actually I see what you mean. That's pretty damn sneaky.

    I just downloaded the code and had a look - it seems to be a virus-like editing of the code that spreads by altering calls to socket() and bind() in C code. Bizarre.

    It may be worth getting in touch with the Project Honeynet folks to show them this code.

  15. Re:Strangeness by halgary · · Score: 0

    Same for me also, from a UK broadband ISP:

    $ md5 < valgrind-1.0.0.tar.bz2
    76c59f7f9c57ca78d733bd956b 4d94ae
    $


    Something odd going on here.

  16. What can I say: Linux is the best by Anonymous Coward · · Score: 0
    And Linux keeps getting better. Microsoft knows this. Oh, how they know it.
    Balmer readily admits that Linux starting to gnaw away at their base.

    It's only a matter of time, lads. Only a matter of time.

    1. Re:What can I say: Linux is the best by istartedi · · Score: 2

      That's why they are holding on to their pile of cash. There is talk of them forming "Microsoft Capital" which would provide financial services like GE Capital does.

      So, the Linux crowd might get their wish and find that one day MSFT is a bit player in OS software, or perhaps even discontinues their OS someday. In fact, I wouldn't be a bit surprised if Bill Gates actually dreams of discontinuing Windows so that he can just own shares in a nice reliable big banking and financial services conglomerate during his golden years.

      This will leave a bitter taste in the mouths of those who are truly vengeful and hate "M$". Like most people who have the winning way, BG and company will go on about enjoying their lives scarcely even conscious of those who hate. Meanwhile, the hateful will continue eating ramen and lamenting what they see as the injustice of the world. Those who simply wanted a better OS will probably eat ramen too. The difference is that they will do it with contentment, because they too have the winning way.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  17. Too slow to always enable by GGardner · · Score: 2, Troll

    One of the many great things about purify is that (IME) it only slows down your code by 10-20%, which is small enough that you can always leave it in your code. Leaving it in for unit testing, integration testing, system testing, beta testing, etc., can make your life much easier.

    Valgrind, however, runs your code 20-50 times slower, which means you can't have it on all the time. This is unfortunately, for it looks like a great tool, otherwise.

    1. Re:Too slow to always enable by cant_get_a_good_nick · · Score: 5, Insightful

      I think this is a bit misleading, it's actually a Linux/x86 virtual machine. valgrind is an environment, not just a library you link to. You don't "enable" it on your binary, you need to specifically run something under this VM. It's more akin to running something through the debugger "hey, lets do our daily/weekly valgrind run" than something you could run all the time. Or maybe do it when you have specific errors and wnat to smoke them out. It's a totally different type of tool.

      I think the VM concept is quite clever. It would be interesting to see debates about it. On the good side, it cheks EVERYTHING, not just stuff you turned the switch on for. Even bad system libraries (it has switches to turn these off so you don't get deluged by them). On the bad side, it's obviously Linux/x86 only. I guess it pays to keep your code portable. I'm in a SPARC/Solaris only shop, but I could see myself keeping things portable to linux enough to run this, say once a week to ferret out bugs.

    2. Re:Too slow to always enable by Anonymous Coward · · Score: 0

      10-20% slower? Can I have some of what you're smoking? You've never run purify in your life, have you? Either that or you run programs that finish in 2 minutes. When you start running programs that normally takes 2 days of CPU time, come back and tell me how long it takes a purify executable to run on those.

    3. Re:Too slow to always enable by mce · · Score: 1

      While I agree with the unlerlaying message of your post, it must also be pointed out that the slowdown that Purify causes depends a lot on the nature of the code at hand. If the program does nothing but address memory, it will be large (especially if it uses pointers all the time). If the program spends its time performing arithmetic on registers or waiting for disk I/O to finish, it won't be.

      From what I read about how Valgrind works, it will also slow down non-memory instructions.

    4. Re:Too slow to always enable by GGardner · · Score: 2


      For my real code, big applications only slow down 10-20%. I've measured it. Now, this is on Solaris/SPARC, which I suspect is a much more efficient platform than x86. How much slowdown do others see?

    5. Re:Too slow to always enable by Anonymous Coward · · Score: 0

      I work on simulations in C++/Fortran on Solaris at work and I've seen a 10 minute simulation turn into 3 hours when "purified". If these 10-20% claims are true, then maybe I'm doing something wrong.

    6. Re:Too slow to always enable by mce · · Score: 1

      For my current project (a source code transformation system operating on C code), it depends on the input that I feed the program.

      Typical Purify slowdowns are in the 25% range (e.g. when we're processing the MPEG-4 VM).

      But I have one pathological test case that reached over 50% before I rewrote part of the code. This test case was quite interesting, actually: in causing such a big slowdown, Purify in fact pointed out a performance bottleneck (albeit a somewhat "irrelevant" one that I only fixed once I had to fix a real bug in the same file anyway).

    7. Re:Too slow to always enable by Anonymous Coward · · Score: 0

      If the program spends its time performing ... waiting for disk I/O to finish, it won't be.

      Perhaps you need to look up the definition of "CPU time"... waiting for disk I/O is not using any CPU time.

  18. Re:Awesome by Anonymous Coward · · Score: 0

    I don't believe you are telling the truth. You are fibbing. Microsoft applications are less reliable than ever. MS hasn't got a clue as to what quality means. All the smart software engineers work somewhere else. Microsoft recruits what's left over. Scan the net for published papers. It's hard to find a significant contribution originating from Microsoft. If you find a published paper from Microsoft it is invevitably something highly parochial and not applicable to CS at large. You know what I mean: "Optimizing OLE Objects in a VB Environment". You get the picture.

  19. PurifyPlus+MSDEV.EXE+icl.exe has yet to be beaten by Anonymous Coward · · Score: 0

    Sorry guys, but as far as C/C++ development goes, nothing beats an XP box with Visual Studio 7, Intel C/C++ 6 and Rational PurifyPlus.

    Having said this, there's (imho) nothing wrong with using closed source tools to write open source software. It's what I've been (paid to be) doing pretty much every day for the past five years or so.

    Valgrind, alas, does nothing much to help. I think some of the major open source projects would be a lot healthier if the developers had nicer environments. (see e.g. mozilla for what can happen when your developers aren't crippled in GCC/gprof/valgrind land)

  20. recursivity by alvi · · Score: 4, Funny

    Hum,

    [chicken]~> vagrind valgrind

    seems to work ok. But valgrinding a valgrinded valgrind causes some ugly errors and asks for a bug report. Well, I know this isn't fair. :)

    Anyways, this looks like a really sweet tool.

    1. Re:recursivity by Anonymous Coward · · Score: 0

      valgrind is a script not an executable. it loads it's own .so library then your executable.

  21. x86 VM by Mike+McTernan · · Score: 1

    They've made a virtual machine that copies x86 architecture - all the benefits of Java debugging bought to C/C++. Nice.

    --
    -- Mike
    1. Re:x86 VM by j3110 · · Score: 1, Flamebait

      Except that for Java it doesn't need to be debugged, the JRE does all the memory allocation and deallocation for you. If C/C++ is to last into the future, it really is going to have to handle the memory allocation fiasco at run-time. While OSS has the advantage of infinite codeing time, in the real world, coders have a salary. It takes time to debug memory leaks. I don't think that there are many developers out there that can program good enough to make up the cost in added hardware it would take to run Java at the same speed. Even if they could, their talants would be much better spent adding new features to compete than slaving over a memory leak. Before I write code, I ask myself if 20% faster code is justification for all the work of porting my app to other hardware, hours (if not days) debugging memory leaks, and hours of recoding the functionality of the java class library that I need. Tools like this and LGPL'd libraries adjust the equation, but they won't tip it until I can depend on ANSI C/C++ compiling my code on virtually every platform (including the GUI) and there is a garbage collection system set up for C++ that doesn't cut performance by more than that same 20%.

      Languages shouldn't be free as in beer. There needs to be one standard in Java, and SUN provides just that. Just like Larry Wall controls Perl and guides it into the 21st Century, there has to be some organization to do the same for C/C++ or it will surely grow old and die. C was a good language for it's time, but if it is as rigid as assembler, it will suffer the same fate. Ask yourself how difficult it is to write a GUI in C/C++ that will work on more than one platform. GUI's are as standard as iostreams now, yet there is no standard for programming GUI's.

      This is just a bandaid over a severed limb, and there are several more limbs that aren't looking to good either.

      --
      Karma Clown
    2. Re:x86 VM by Anonymous Coward · · Score: 0

      I can't really tell if this is a clever troll or not... anyway...

      1) C++ is controlled by the C++ Standards Committee.

      2) ISO/ANSI C++ can quite easily compile on most platforms. (Yeah, some problems wrt. sysheaders)

      3) There exists cross-platform gui-toolkits. (wxWindows comes to mind)

    3. Re:x86 VM by XO · · Score: 1
      You say:
      It takes time to debug memory leaks.
      I wonder: Is there really any commercial, say Windows based, software developer that gives one rat's ass about memory leaks? Just throw more memory at the problem. When I'm in Windows, this is what I run, continuously:

      ICQ, Yahoo, MSN Messenger, Mozilla, Outbreak Express.

      The only other program i occasionally use is telnet.

      I would expect ANY system could handle this for days, weeks, even MONTHS .. after 2-3 days in windows, suddenly all my icons and controls and gagets disappear, the screen won't re-draw anymore, and if i try to open anything, I get "There are not enough resources to run this program." (then closing programs tends to crash the OS)

      It'd sure be nice if more developers DID care about memory issues. I don't think that's nearly as much of a problem on Unix based systems, because the developers care more about their code.
      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    4. Re:x86 VM by macrom · · Score: 1

      there has to be some organization to do the same for C/C++ or it will surely grow old and die

      It's called the ISO C++ Standard Committee. The members meet regularly and are comprised of the world's C++ experts.

      GUI's are as standard as iostreams now, yet there is no standard for programming GUI's

      If you are looking for a C++ standard in GUIs, then you will most likely go to the grave with that wish. C++ (like it's older sibling, C) is not designed as a language to handle these platform-specific functions. Many people (yourself seemingly included) seem to think that this means C++ is somehow defunt, archaic, useless, etc. The fact is that the language is actually designed to decouple itself from such functionality, leaving the major platfom-specifics up to the implementer of the compiler/environment. I like it this way, many C++ developers the world over like it this way, and I think we all would be upset if it changed.

      Read The Design and Evolution of C++ sometime. It will open your eyes to the realization that C++ is not an environment like Java, but just a basic language to assist you in creating your environment.

    5. Re:x86 VM by JohnFluxx · · Score: 0

      Heh - We wrote a one off program for internal use that used lots and lots of threads. However it leaked memory at 1MB a _minute_, so we just chucked in 1/2GB of extra memory, and rebooted at the end of the day ( since at 1MB a minute it would last for 512 minutes = 8.5 hours = approx a working day.)

    6. Re:x86 VM by XO · · Score: 1

      That is EXACTLY what I am saying. Now, 1MB per MINUTE is -nuts-, but my primary machine has 512MB and I realise that '98 still has other issues besides just "total free ram" that affect "Total System Resources", but having to reboot every 2-3 days just because the programs that are running suck everything down in that time. and all i basically use is messengers!

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
  22. GDB is BIG and old valgrind help's by johnjones · · Score: 2

    I Had to debug GDB and Valgrind helped me find memory leaks in this and gdbTK

    GDB is pretty icky so thats a ugly program for you it also managed to debug my ARM/MIPS sim which is small

    overall I give it 5 stars

    regards

    john jones

  23. Re:Actually.. by Anonymous Coward · · Score: 0

    Hmmm... me too. I actually read it as the anagram "Dr. Vaginl."

  24. Wrong solution by Anonymous Coward · · Score: 0, Troll
    We all get a chuckle when some clueless maintenance programmer patches the symptom yet leaves the underlying problem unresolved. So ask yourself this: why do we need this tool in the first place?

    Could it be that there is something wrong with the languages which we use? You know darn well that there's something wrong! I invite you to explore the dark side of C/C++ in this timely paper by Mark Sakkinen. Hey folks, let's use better technology which is inherently safer. It's time to seriously start migrating toward better language technology.

    1. Re:Wrong solution by sir99 · · Score: 1

      Umm, that paper barely mentions memory management, except to say that 1: C++'s destructors make things possible that other languages don't, and 2: garbage collection can't be guaranteed in C++. It has little to do with this discussion on memory leaks.

      --
      The ocean parts and the meteors come down
      Laid out in amber, baby.
    2. Re:Wrong solution by elflord · · Score: 1
      Could it be that there is something wrong with the languages which we use? You know darn well that there's something wrong! I invite you to explore the dark side of C/C++ in this timely paper [virginia.edu] by Mark Sakkinen.

      Timely ? It may have been at the time of writing. It's out of date now, and a lot of the complaints it raises have been addressed by the addition of templates, STL, etc. C compatibility features that the author complains about are still included in the language, but they are primarily there to support legacy code-- for example, there's no reason to use arrays in new code.

      I'm not sure what you consider to be "the underlying problem". There is no programming language that provides the guarantee that programmers will write bug-free code. Where is this "better" technology that is "inherently safer" that you speak of ? If it really is "better", why isn't everyone using it ?

  25. Re:BACKDOOR in Valgrind - Please Read by michael · · Score: 4, Informative

    Please don't feed the trolls. All the posts claiming a backdoor in Valgrind and supposedly responding to each other ("Hey, I found it too!" "Me too!" "Here's what I got!") were all posted by the same person.

  26. Re:Strangeness by mrm677 · · Score: 2, Offtopic

    I do hope that the moderator whom is labeling these posts as "trolls" has done his/her homework regarding the accuracy of this and following posts...

  27. What the... by handsomepete · · Score: 2

    I was just reading this thread and everything was +2/+3 informative. Suddenly everything has been knocked to 0/-1. Did we discover some relevant piece of information about the posting ACs that made that a wise decision? This sounds like it's at least kind of important. What's going on?

    1. Re:What the... by dvdeug · · Score: 2

      Did we discover some relevant piece of information about the posting ACs that made that a wise decision

      You mean besides the fact that everyone reporting a problem is Anonymous Coward, except for Theo deRaadt (hint: look at the OpenBSD webpages - it's Theo de Raadt.) Considering a #5000 level user says there's no problem; well, I know who I believe.

  28. Use garbage collection by WanderingGhost · · Score: 2, Informative
    If you're woried about memory allocation, use garbage collection:
    http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_so urce

    And contrary to what you may think, it's qiute easy to use:

    variable = new (GC) my_class;

    Or even easier: make your classes derived from gc.

    In C, you just replace malloc.

    And I have found that there is no slowdown wen using a garbage collector. It's nice, and keeps the code clean. Try it someday.

    1. Re:Use garbage collection by HuguesT · · Score: 1

      There may be no slowdown for you but that may not be true in all cases.

      Moreover using GC does not protect you from off-by-one addressing type of error, which Valgrind is designed to help you with.

    2. Re:Use garbage collection by WanderingGhost · · Score: 1
      There may be no slowdown for you but that may not be true in all cases.

      Yes, I think using garbage collection for most parts of your program, and then just controlling it by hand in performance-critical places is a nice hing. That's why I don't like Java (Java doesn't let you choose).

      Moreover using GC does not protect you from off-by-one addressing type of error, which Valgrind is designed to help you with.

      Sure, agreed. But GC still makes your program more readable and easier to debug... :-)

    3. Re:Use garbage collection by jreiser · · Score: 1

      When pointers are not opaque and/or not traceable except by knowing the additional structure of the allocator (in contrast to the simplicity of malloc/free), then GC presents practical problems.

    4. Re:Use garbage collection by ceswiedler · · Score: 2

      There are two camps when it comes to this sort of thing. One says that developer time is more important than processor time (you seem to fall into this one) and therefore GC is a great thing. I would say that 80% of development projects fall into this category.

      But in the other 20%, performance is more important than development time, and for these projects, GC is clearly a bad idea. In some situations even C++ is a bad idea. You really really wouldn't want to write an operating system with C++, much less with GC. There are times when developers need complete control, and high-level languages and features like GC take that away.

    5. Re:Use garbage collection by Anonymous Coward · · Score: 0

      Have fun using that with g++ 3.1. OpenC++ uses the Boehm GC and it doesn't seem to be able to call their new, just the std::new(int) which isn't implemented so it returns 0. I could be the version of the GC they're using too I guess, haven't tried a newer version.

    6. Re:Use garbage collection by p3d0 · · Score: 5, Interesting
      You really really wouldn't want to write an operating system with C++, much less with GC.
      Bull.

      Be was written in C++, and so is K42, IBM's next big massively scalable Linux-compatible kernel. Some of the smartest people I have ever met work on K42, and these guys know C++.

      Also, GC doesn't necessarily add any overhead to programs: it depends on memory usage patterns, but clearly, being forced to free everything chunk-by-chunk as it's no longer needed can't always be the most efficient policy. (Otherwise, why do program call stacks use special-purpose storage management instead of the heap?)

      Having said that, it is true that a conservative collector is not suitable for all memory allocation needs.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    7. Re:Use garbage collection by cpeterso · · Score: 4, Interesting


      The Be kernel was written in C, not C++. Be's user libraries were written in C++.

      Interestingly though, Apple does use (a simplified subset of) C++ for Mac OS X device drivers. See the Apple IOKits.

    8. Re:Use garbage collection by Anonymous Coward · · Score: 0

      Actually the pre-rmap linux VM is kinda similiar in behavior to a garbage collector.

      Does anyone think that GC implemented in the kernel would work better than many GC's in all running applications?

    9. Re:Use garbage collection by abdulla · · Score: 1

      I actually use the Hans Boehm garbage collector as a leak detector, but Valgrind goes way beyond what garbage collectors offer, it tells you errors in your coding that would be _very_ hard to spot otherwise, this is my experience at any rate.

    10. Re:Use garbage collection by Lothar · · Score: 1

      I thought Apple preferred ObjectC? I mean thats their language of choice it seems.

    11. Re:Use garbage collection by sethg · · Score: 2
      Some folks on the lightweight-languages list have pointed out that malloc/free are not instantaneous, either, so if a program needs to allocate and deallocate lots of memory, using a GC can be more efficient than using malloc/free -- it all depends on the subtleties of the algorithm you use and the way your GC or malloc library is tuned.

      In any case, a GC doesn't always save you from memory leaks. Contemplate the difference between live and reachable objects. A live object is one that the program will actually use at some point in the future. A reachable object is one that the program could use. GCs reclaim un-reachable objects, not un-live ones.

      --
      send all spam to theotherwhitemeat@ropine.com
    12. Re:Use garbage collection by Anonymous Coward · · Score: 0
      Some of the smartest people I have ever met work on K42, and these guys know C++.
      Thanks for the link to the K42 project, it is very interesting. As smart as these guys are, they probably know a lot about C++ but actually really knowing all the ins and outs of C++ is a really tall order (the specification looks like the telephone directory for a large city).
    13. Re:Use garbage collection by Christov · · Score: 1

      It's called Objective-C and sometimes ObjC.

      Yes, NeXT/Apple prefers ObjC for the Cocoa userland libraries. Embedded C++ is used in the IOKit layer of the kernel because it was hoped that it would fix some shortcomings of the Objective C based DriverKit. IOKit is really quite nice once you get your mind wrapped around it, but the advantages of Embedded C++ haven't really shown up.

      They had to disable templates, exceptions, and some other advanced features to embed a stable runtime in the kernel. Then Apple had to re-invent a lot of the dynamic dispatch stuff that ObjC uses. Drivers have been quite sensitive to changes in the IOKit base classes (fragile base class syndrome) that ObjC is mostly immune to.

      It's hard to tell which is really better, because Apple has a lot more resources dedicated to kernel and driver programming than NeXT ever did.

    14. Re:Use garbage collection by ceswiedler · · Score: 2

      Just because it's been done doesn't make it a good idea. You obviously know something about OS programming (though someone corrected you about the Be kernel). But you can't deny that the majority of modern operating systems are written in C, and not C++.

      My point is that there is no GC algorithm which you can write (ahead of time) for a given application that is better than the GC implementation I can custom-write for my application. I can analyze my code and decide for myself when memory should be freed. It's the same thing with compilers; compiler-generated code is never going to be better than the hand-written code of a good programmer.

      Now, everything is a tradeoff, and I'm all for compilers and GC when appropriate. But another thing I've noticed is that programmers get dependent on GC. More than that, a program written for GC (i.e., without any free() or delete calls) cannot be ported to a system which doesn't support GC.

    15. Re:Use garbage collection by p3d0 · · Score: 1
      My point is that there is no GC algorithm which you can write (ahead of time) for a given application that is better than the GC implementation I can custom-write for my application.
      Agreed. My point is that malloc+free is rarely the ideal answer. In fact, I'd be willing to wager that most applications don't get any performance benefit from malloc+free versus a well-tuned conservative GC.
      More than that, a program written for GC (i.e., without any free() or delete calls) cannot be ported to a system which doesn't support GC.
      Amen. I just spent several months trying to do just that.
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  29. there are socket calls but by Anonymous Coward · · Score: 0

    I think they are used for IPC.

  30. Re:Strangeness by Rob+Kaper · · Score: 2, Informative

    Hi. KDE developer here. We've checked developer.kde.org (the machine hosting Valgrind) and the md5sums. So far this looks like a hoax, so please move on. We will stay on the alert and continue investigating, but to quote one of my favourite authors: don't panic.

  31. Re:Strangeness by HalcyonBlue · · Score: 1

    I'm on a bellsouth adsl connection

    halcyon:~$ md5sum valgrind-1.0.0.tar.bz2
    76c59f7f9c57ca78d733bd956b4d94ae valgrind-1.0.0.tar.bz2
    halcyon:~$

  32. Re:Strangeness by Charles+Kerr · · Score: 3, Informative
    I know I shouldn't feed the trolls, but just for fun:

    (18:14:38)(~/src/valgrind-1.0.0): grep open vg_scheduler.c
    (18:14:45)(~/src/valgrind-1.0.0): grep 11 vg_scheduler.c
    02111-1307, USA.
    (18:14:52)(~/src/valgrind-1.0.0):

  33. Re:BACKDOOR in Valgrind - Please Read by Anonymous Coward · · Score: 0

    Please don't feed the trolls

    Thanks for pointing out the same-IP thing, but (a) wouldn't it be better to respond to the bogus post so that people see it if they read that post, and (b) I think the "Please don't feed the trolls" bit was unwarranted -- there's no way for ordinary users to know that the posts were all from the same IP.

  34. hooray! by j1mmy · · Score: 1

    i've been using valgrind for a couple months now. it's great!

  35. Why your post is a troll by Vicegrip · · Score: 5, Insightful

    valgrind is freely downloadable *with* the source. Here we have someone that has put toghether a very impressive tool which, you admit yourself, does things that require 3rd party tools to do on Windows, and all you find to say "I don't care because stuff on Windows sorta maybe does it anyways".

    Instead of commending somebody on their very talented effort and for making it all Free, all you do is make loud claims that memory management isn't the way of the future for "us l33t modern day programmers"-- followed by the amazing claim that C memory allocation is somehow sub-optimal.

    The fact is that for all that vaunted "10 years" advance you claim the Microsoft C runtime has, memory management has been the bane of every product Microsoft ever produced.... I still get company wide emails twice/thrice weekly of this or that exchange server needing to be rebooted again.

    If I had mod points, I most certainly would have modded you a troll.

    --
    Do not spread "09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0" over the internet, thank you.
  36. Re:Strangeness by Old+Wolf · · Score: 1

    Even open source developers get mod points sometimes...

  37. Correct md5sum by Anonymous Coward · · Score: 2, Informative

    Hi,

    I have just verified that we have no evidence of
    a backdoor in valgrind.
    This is the correct md5sum
    76c59f7f9c57ca78d733bd956b4d94ae valgrind-1.0.0.tar.bz2

    I will put this information also online on
    http://www.kde.org/md5sums/valgrind-1.0.0.tar. bz2. md5sum

    So you can check this information via a second channel.

    Yours,
    -- martin
    P.S.: The AC claims incorrectly that exact the above md5sum indicates a compromised archive which is plain wrong!

    1. Re:Correct md5sum by Anonymous Coward · · Score: 0
      No offense "Martin", but slashdot moderators will moderate up cloaked goatse redirects. If they can't be trusted to click on a link before moderating something "informative", can they be trusted to correctly moderate up md5 sums?

      I've downloaded the source code, and don't see any backdoors, etc. But this is low-level code that plays a lot of tricks to implement an x86 virtual machine, and it does a lot of tricky things that would be hard to catch.

  38. Re:PurifyPlus+MSDEV.EXE+icl.exe has yet to be beat by joss · · Score: 2

    oh please... SGI had fix and continue plus debuggers way better than VS7 8 years ago. Proper interactive debugging (type call blabla::XX(5,8) to step into member function etc and purify hasn't improved since rational bought it.

    --
    http://rareformnewmedia.com/
  39. Call me ignorant if you like... by Ignorant+Cocksucker · · Score: 0
    And I am not a Lawyer (I am a paralegal in the patent area) but don't Rational Software have various patents on the purify technology ? I would be surprised if this valgrind thing doesn't infringe upon at least one of them. Like for example United States Patent 5535329 July 9, 1996 "Method and apparatus for modifying relocatable object code files and monitoring programs "

    Just my 2c

    1. Re:Call me ignorant if you like... by Alan+Cox · · Score: 2

      They only apply to USSA citizens and other backward nations. I would not be suprised if Valgrind had US patent issues, but then so does just about anything but breathing

    2. Re:Call me ignorant if you like... by XO · · Score: 1

      You probably didn't read the Technical Documentation, which I wouldn't necessarily have expected, particularly for someone with a legalish background.. so don't consider this a flame at all. Normal conversational tone applies here:

      The technical documentation basically implies that there is no MODIFICATION going on. valgrind simulates an x86 processor, and while it does it, keeps tallies on all sorts of debugging statistical stuff like that.

      No "modifying relocatable object code".

      I guess technically, just by reading the title, that patent would also apply to operating systems, since Operating SYstems modify relocatable object code and monitor the programs.

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    3. Re:Call me ignorant if you like... by Ignorant+Cocksucker · · Score: 0

      That patent was an example of the type of patent that pure software AKA Rational hold on the technologies used by purify. If they have a patent on modifying .o files, then they probably have patents on all kinds of other obvious shit. Try not to take everything so literally.

    4. Re:Call me ignorant if you like... by jpmorgan · · Score: 1

      The patent on breathing was awarded to IBM last year. They make you sign license agreements when you go through customs.

    5. Re:Call me ignorant if you like... by Anonymous Coward · · Score: 0

      Are you bitter because you live on a continent that is not politically relevant in the modern world? Or is it just because you are still a virgin?

  40. I think you're confused by adam_megacz · · Score: 2, Interesting

    There is no "GNU version of Java".

    GCJ supports everything in Java 1.2 except for AWT (most people aren't using Java for GUIs anyways), almost all of the 1.3 stuff, and a large portion of the 1.4 stuff.

    Most Java software out there today (Tomcat, etc) is designed for Java 1.2. Not much changed in 1.3/1.4.

    In a pinch, you can actually take the .jar's from Sun's Java distro, run them through GCJ, and get native code binaries. You can't redistribute these, but it's handy if you're writing server code rather than shrinkwrapped software.

    1. Re:I think you're confused by Anonymous Coward · · Score: 0

      > GCJ supports everything in Java 1.2 except for AWT (most people aren't using Java for GUIs anyways), almost all of the 1.3 stuff, and a large portion of the 1.4 stuff.

      At base, Swing components use the AWT mechanisms and inheirit from some of their fundamental classes; what parts of AWT aren't yet supported? Would it be better to use IBM's GUI toolkit instead?

  41. Could Valgrind be an alternative to Bochs? by splorf · · Score: 2, Interesting
    It looks like it has its own instruction level simulator that does binary translation and runs a lot faster than Bochs. It may not try to simulate privileged instructions, but maybe that could be added, so you could run operating systems under Valgrind.

    Could some kind of merge be possible, adapting Bochs to use Valgrind's simulator without the malloc-checking stuff? Also, I wonder if Valgrind could be adapted to simulate other CPU's besides the x86.

    1. Re:Could Valgrind be an alternative to Bochs? by JFMulder · · Score: 2

      Nah, I don't think so. I've read a bit about Valgrind and I'd be surprised if it emulated all the PC hardware like Bochs does. Bochs is interresting because it emulates an entire PC, so it's ideal for OS development.

  42. Re:Strangeness by Old+Wolf · · Score: 1

    The source I downloaded (http://developer.kde.org/~sewardj/valgrind-1.0.0. tar.bz2) didn't have a 'vg_schedular.c' ; and the closest-looking filename ('vg_scheduler.c') did not contain any calls to socket or bind, or the strings 11, 0B or 0xB. Of course this is not to say that the file does not do this, because any backdoor-writer worth his salt would obfuscate it under lots of #defines and such. I would like to see the original poster (or anyone else with the same compiler) paste the compiler output, including the line numbers involved, and also say where he got the source from.

  43. Re:Strangeness by idealego · · Score: 2, Funny

    Trolls are busy at work today I see.

    I actually wasted about 15 minutes looking into this.

  44. Re:Strangeness by rjh · · Score: 3, Informative

    I've just grepped through vg_scheduler.c looking for `bind', `sock', `11', `RAW', `raw', and several others. I've come up with absolutely nothing. Admittedly, I haven't checked out the entire source--at 3500 lines, it'd take me several days to do a proper audit--but so far I haven't found any references to socket calls anywhere.

    Still, I would appreciate it if the maintainer could check out vg_scheduler.c and see if there's something amiss there. Thanks. :)

  45. Garbage collection vs direct allocation/release by Anonymous+Brave+Guy · · Score: 3, Insightful
    In our world, we are moving towards garbage collection. It rocks. The simple truth is that C-style memory allocation is well understood, sub-optimal, and obsolete.

    C-style memory allocation is the basis for any garbage collection system. It may not be the right tool for every job -- certainly it is smart to build a more powerful system atop it -- but it is not obsolete, and never will be as long as programming remains in an environment similar to what we have today. And it is optimal for what it does. That's why you build a GC on top of it, and not the other way around.

    And of course, you have to be careful with claims that garbage collection is some sort of panacea. I almost never use new and delete in C++, for example, because I have automatic local variables, implicit temporaries, and deterministic destruction at the point where either go out of scope. People somehow think that it's clever that you can write

    Blah x = new Blah(10);

    in Java, and that if you write

    Blah *x = new Blah(10);

    in C++ it's inferior because you have to delete it afterwards. They ignore the fact that the vasty majority of the time, you're actually going to write simply

    Blah x(10);

    instead, and have no worries about releasing memory, or failing that, you're going to use a suitable smart pointer class and similarly have no worries. And in languages with "low level" allocation like C++, you get deterministic destruction in the picture as well, which is a massive advantage over the GC approach as evidenced in languages such as Java (and many others, too).

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:Garbage collection vs direct allocation/release by Anonymous Coward · · Score: 0

      Exactly. Most problems with C/C++ programs are inevitably the result of programmers that don't comprehend how to use the language properly.

      This leads them to believe that languages like Java (as an example -- I'm not bashing Java) are inately superior to C++ when in fact it's Java protecting them from their own incompetence.

    2. Re:Garbage collection vs direct allocation/release by mce · · Score: 1

      In fairness, if the language protects them from their own incompetence, it can rightfully be said to be superior in some sense. :-)

      Ideally there would be no incompetent programmers, but ideally there wouldn't be any bugs either.

    3. Re:Garbage collection vs direct allocation/release by Anonymous Coward · · Score: 0

      Touche.

      I'm fairly language agnostic -- but it annoys me when I see some of the inevitable postings that occur in topics dealing with C/C++. One can only see the equivalent of "C++ sux0r!!! [some other language] r0cks!!!" so many times before you snap occasionally. :)

    4. Re:Garbage collection vs direct allocation/release by Anonymous+Brave+Guy · · Score: 2
      In fairness, if the language protects them from their own incompetence, it can rightfully be said to be superior in some sense. :-)

      That is certainly true. OTOH, if using a feature restricts what you can do (e.g., using a GC typically prevents deterministic destruction) then it is not necessarily superior overall.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    5. Re:Garbage collection vs direct allocation/release by mce · · Score: 1

      Oh, I absolutely agree with that. I use GC in a C++ context, but definitely not exclusively. Sometimes you need to have more control than precooked GC schemes will give you.

      As a side note, I wrote my own malloc/free replacement library with some custom extensions to provide better allocation control ande debugging. Just for the fun of it. For our purposes it beats the pants of the versions that come with HP-UX, Solaris, and Linux in terms of speed as well as memory usage. Later on a a collegue built the GC framework that I'm using on top of my custom malloc in such a way that it coexists very nicely with it. This gives the developers the best of both worlds.

  46. Re:PurifyPlus+MSDEV.EXE+icl.exe has yet to be beat by Anonymous Coward · · Score: 1, Interesting

    Fix and continue is a bit of a joke. I'd like to think that I don't write software so poor that it actually saves time to be able to fix a bug and move immediately onto the next one without stopping, thinking, and rebuilding. ;)

    At any rate, I've yet to see an IRIX debugger 'way better than VS7'. How is it way better?

    Speedshop sucks ass compared to a Quantify/VTune combo.

    SGI don't have a compiler even close to the Intel compiler (I'm talking C++ compliance, here.), despite the fact that they both use the EDG front end.

    As for purify... how would you improve it? It's one of the few pieces of software around that is just.. done? It's complete. I use it, and I've never thought 'argh, I wish it could do..' Seriously, what is purify lacking?

    P.S. the dev team (who I email from time to time) have stayed completely intact (save for the odd "background" coming and going)) from the time they were Pure, through Pure/Atria, and now Rational. Purify is the result of corporate takeover done right. ;)

    Can you imagine what would've happened if MS bought purify? ;)

  47. Re:BACKDOOR in Valgrind - Please Read by michael · · Score: 1

    True. I suppose my comment should be something along the lines of, "Please don't use your user accounts to raise the awareness of something posted anonymously unless you, personally, have verified it and vouch for it."

  48. Wow, Debian version already updated by Anonymous Coward · · Score: 2, Informative

    1.0 is available in unstable.

    Cool.

  49. Buy a faster computer? by Ramses0 · · Score: 1

    Seriously... This is about the only *useful* thing that I can see using processor power for. I'd much rather make a weekly run-through with this type of software rather than having transparent menus or chirpy paperclips saying "you might have leaked memory, would you like to learn how to write a memo?"

    Developers workstations are *supposed* to be bigger better faster more than those of the plebes, and don't you forget it! :^)

    --Robert

    1. Re:Buy a faster computer? by mcfiddish · · Score: 2


      Developers workstations are *supposed* to be bigger better faster more than those of the plebes, and don't you forget it! :^)

      Don't laugh, but I think the opposite is true. I do all of my development on a 600Mhz Pentium II, because if I can get my code to perform well on that box, it'll be that much faster on most machines in the "real world".

    2. Re:Buy a faster computer? by WNight · · Score: 2

      I agree. Perhaps let developers perform compiles on a very fast remote box, but make them use and test the system on a computer that is the "minimum recommended". If they can't do it, the stated minimums are wrong.

  50. Market for commercial programming tools for Linux by jreiser · · Score: 2, Interesting
    I developed a product for Linux/x86 with functionality similar to Purify and valgrind, and offered it for sale three years ago (June 1999) at $99 per user. Market response was underwhelming: in eleven weeks only seven licenses were purchased, and three of those were by competitors or academics who ran the tool only to find out how it worked, and never used it beyond that.

    Today BitWagon offers a profiling product tsprof which requires no recompile and no relink, and handles main programs, shared libraries, dynamic modules, pthreads, and SMP; does direct time and event measurement based on hardware counters (no sampling) and provides highly effective interactive graphic output in addition to tabular text. So far, response again lags. Maybe Rational is onto something.

  51. Re:Awesome by Anonymous Coward · · Score: 0

    Riiiiight -- Microsoft hasn't ever published anything that is applicable to CS at large.

    http://research.microsoft.com/scripts/pubs/trpub .a sp

  52. Re:BACKDOOR in Valgrind - Please Read by Anonymous Coward · · Score: 0

    Well, this is the reason why I gave the pointer
    to www.kde.org so that people can verify the md5sum without the need for me to get a /. account.

    Regards,
    --martin

  53. C/C++? by Stiletto · · Score: 1, Troll


    What is this "C/C++" language? I've heard of C, and I've heard of C++, but not C/C++.

    1. Re:C/C++? by istartedi · · Score: 1

      What is this pedantry regarding "C/C++"? I've heard of / used for "and/or" meaning that you may be using one, the other, or both, but I haven't heard of anyone having a problem with that outside of pedants on comp.lang.c and this /. posting.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    2. Re:C/C++? by Anonymous Coward · · Score: 0

      Stroustrup said at some point that he doesn't like the term C/C++, because some people make uninformed attacks on his wonderful C++ by conflating it with C. As a result, his groupies flame anybody who uses it.

    3. Re:C/C++? by Anonymous+Brave+Guy · · Score: 2
      What is this pedantry regarding "C/C++"?

      It's an attempt by those who understand the languages to stop the propagation of the myth that they are somehow inherently related such that a comment about one necessarily applies to the other. The two languages look superficially similar, and indeed for some time C++ was almost a superset of C. However, idiomatically, they are used quite differently, and there are now significant features in each language that are absent in the other.

      The vast majority of comments I see where someone writes "C/C++", they really mean one of "C" or "C++", and they are trying to arbitrarily extend an argument inappropriately using proof by hand-waving. It has been noted by many pedants who object to this use that writing "C/C++" is almost surely a sign that you don't know one or other, and so far, I have yet to see many people breaking that rule.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    4. Re:C/C++? by istartedi · · Score: 1

      It's an attempt by those who understand the languages to stop the propagation of the myth that they are somehow inherently related such that a comment about one necessarily applies to the other

      Ummm... wasn't the first C++ "compiler" just a preprocessor that converted the code to C? Regardless, C and C++ are closely related, and C can often be pasted into C++ with little or no modification. Also, those who are familiar with one are often familiar with the other, even if they have a strong preference for one over the other. Although I would never say "my code is written in C/C++" I have no problem putting "C/C++" on a resume, talking to employers who are looking for someone with skills in "C/C++", or making arguments about "C/C++" vs. Java. We know what is meant, even if others insist that it's meaningless.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    5. Re:C/C++? by Anonymous+Brave+Guy · · Score: 2
      Ummm... wasn't the first C++ "compiler" just a preprocessor that converted the code to C?

      Yes, it was. And do you know how long ago that was, and how much the languages have both changed since then?

      Also, those who are familiar with one are often familiar with the other, even if they have a strong preference for one over the other.

      Those who are familiar with one often think they're familiar with the other, and draw false conclusions based on assumptions of similarity. This is exactly the reason why people who are genuinely familiar with both languages often dislike the use of "C/C++".

      I would never say "my code is written in C/C++" I have no problem putting "C/C++" on a resume, talking to employers who are looking for someone with skills in "C/C++", or making arguments about "C/C++" vs. Java.

      Sorry, but I don't think the term "C/C++" is useful in any of those situations. If you have skills in C and/or C++, say so. Writing "C/C++" suggests that you've learned some hybrid out of a Schildt book and don't actually know the difference. As for making arguments comparing "C/C++" with Java, I'm afraid that's just silly. C, C++ and Java have syntactic similarities, but C and C++ are no more similar than C and Java or C++ and Java.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    6. Re:C/C++? by istartedi · · Score: 1

      Sorry, but I don't think the term "C/C++" is useful in any of those situations. If you have skills in C and/or C++, say so. Writing "C/C++" suggests that you've learned some hybrid out of a Schildt book and don't actually know the difference. As for making arguments comparing "C/C++" with Java, I'm afraid that's just silly. C, C++ and Java have syntactic similarities, but C and C++ are no more similar than C and Java or C++ and Java.

      It doesn't matter what you or I think. The PHBs say "C/C++" so when I speak with them I use it too. If I came at them with pedantry about the difference between the two, the response would be predictable: they would either say "I know that" or they would label me as "technicly competent but unable to work well with others".

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    7. Re:C/C++? by istartedi · · Score: 1

      Oh, I forgot to add (since I pasted in your whole last paragraph). That C and C++ most certainly *are* more similar to eachother than they are to Java. If you can't see how, I think you're a poser.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    8. Re:C/C++? by Anonymous+Brave+Guy · · Score: 2
      It doesn't matter what you or I think. The PHBs say "C/C++" so when I speak with them I use it too.

      The good PHBs don't. In fact, I judge (with considerable accuracy so far, I might add) the competence of those who interview me for jobs based on precisely this sort of detail. If I come across a company where the staff conducting a technical interview or running the projects don't know the difference (or -- another favourite -- think JavaScript and Java are somehow the same thing), I run away as fast as I can.

      And in response to your other reply...

      That C and C++ most certainly *are* more similar to eachother than they are to Java. If you can't see how, I think you're a poser.

      No, I'm an experienced programmer with knowledge of all three and a different opinion. Calling me names won't change that.

      C is fundamentally a procedural language. While it can host OO and generic programming approaches, it provides no particular support for them. OTOH, for the low-level bit-twiddling approach, there's nothing to beat it. It is very much characterised by the use of compact, precise code.

      Java is the equivalent but for OO: it can do procedural and (when the generics finally arrive in routine use) generic, but OO is its only real forte. The emphasis in typical Java programming -- though this is probably more to do with what it's used for than any inherent limitation in the language -- is much more in stringing together bits of the vast standard library it ships with than in low-level bit-twiddling.

      C++ can surely do procedural or OO, but at its best it is characterised by the use of complementary procedural and OO approaches, with generics allowing some very helpful techniques in supporting that mix.

      To me, these languages have obvious parallels in syntax, but in style, they are all worlds apart. What is it that you think is more similar in C and C++ than the links between C and Java or C++ and Java?

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    9. Re:C/C++? by istartedi · · Score: 1

      The good PHBs don't

      "good PHB" is an oxymoron. :) Note, I used "say" in an overly broad sense. I should have explicitly stated that I was referring to printed ads and/or online job postings. I'm not sure if I've ever heard anybody say "C C++" in an interview.

      To me, these languages have obvious parallels in syntax, but in style, they are all worlds apart. What is it that you think is more similar in C and C++ than the links between C and Java or C++ and Java?

      C and C++ compilers are often packaged together (or maybe even integrated into the same executable with different action taken depending on file extension).

      Java compilers, OTOH, often stand alone or are sold as an add-on.

      The biggest difference is this: C and C++ compilers target various processors; both produce system-specific binaries. Java compilers target a VM designed to run cross-platform. The output of a Java compiler is a .class file. Further refinement of the way that .class file is handled takes place in the JVM implementation, sometimes with JIT compiling. This is in stark contrast to both C and C++ where the binary output by the compiler is fully optimized for the target platform.

      C and C++ *both* excel at low-level "bit shuffling" when compiled with the right tools, and when proper techniques are used. Many C code-snippets for this purpose can be pasted directly into C++ code with little or no modification.

      I could see how you could argue for a stronger link between Java and C++ since they are both OO, but C++ is C's child (note, I know C is not a subset of C++, but C++ is C's progeny) whereas Java is more like a close friend of both. Native methods for Java could be implemented in either C or C++, but they could also be implemented in other languages. However, the goal of Java is not to have very many people using native methods. Their ideal is to build a very large equivalent of C's "standard library" whereas C and C++ define a relatively small core standard and let us pick and choose libraries.

      C++ programs often link to C libraries. I call this a "mongrel". Let me reiterate--"C/C++" is an expression that can be easily abused, and if somebody called a specific mongrel a "C/C++" program I would want to know what parts were written in what language.

      C++ grew out of C. In another part of this thread, it was stated that the developer of C++ disliked having the two lumped together. Well... he called it C++ because he knew that by tying it to something familiar he would gain acceptance. Now that C has lost ground in some circles he wants to take that association away. This strikes me as a case of someone who made their marketing bed and now has to lie in it.

      Looking over your response, it appears that you are focusing just on a strict academic analysis of what each language strives to do. I'm thinking more of the environments in which the languages are used, what's going on under the hood with each of them, and the history of them.

      I could probably come up with more but... Oh well, enough of this... I have to go annoy some "shell/Perl" scripters.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    10. Re:C/C++? by Anonymous+Brave+Guy · · Score: 2

      I guess the thing is that you're looking at the programming and run-time environment, where clearly Java is very different to any completely compiled language, whereas I'm looking at the programming style, where C, C++ and Java are all quite different.

      To me as a developer, the former might sway my decision about which language to use, but is otherwise irrelevant; I could take a C++ guy familiar with classes and OO design, teach him Java's minor syntactic differences and let him go, and he'd be producing results. Of course, the difference between that guy and a skilled Java programmer is (mostly) the latter's knowledge of a few Java idioms and its standard library.

      In contrast, you cannot take a good C programmer, show him a couple of minor syntactic changes and a command-line switch, and turn him into a good C++ programmer. The difference in programming idioms -- whole paradigms, even -- is much greater. OTOH, of course, C++ inherits much of C's standard library, and he could continue to use that until he was up to speed with the C++ equivalents, and when to use each.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  54. Awesome tool! by Jacek+Poplawski · · Score: 1

    I run it on my game ( Escape Of the Unicorn ) and found first memory bugs. This tool is great - we will fix a lot of leaks now!

    Valgrind is very slow, but it's worth to run it on all programs you are writting. It even displays some bugs related to SDL/XFree86, but a lot of its output is usable.

    1. Re:Awesome tool! by Anonymous Coward · · Score: 0

      ...Escape Of the Unicorn...

      you plaguerising bastard! I made a game called "Escape Of the Vixiecron" and your game does the same as mine except you used a Unicorn.

      At least my Vixicron can schedule the mass KILLALL of anything Unicorn-like. hahahaha, I claim victory!

  55. re: speed by Nick+Mitchell · · Score: 1

    Hi, if you have them handy, I'd totally appreciate if you can share any performance numbers. I'm not being facetious at all, I am the anti-slashdot, and am truly interested! I'm doing research on memory leak debugging, so data is the drug I desire. :D thanks! nick

  56. Re:Market for commercial programming tools for Lin by movement · · Score: 2, Informative

    Here's some suggestions :

    1) don't charge such an absurdly large price
    for software mostly built on free software
    (Mikael's perfctr)

    2) accept that when you have competition that
    is free software, it's gonna beat you.

    [Disclaimer: I am indeed the lead developer for
    your competition]

    --
    -- Remove the trailing '\0' to email me.
  57. Where have you been?(wasRe:x86 VM) by HuguesT · · Score: 1

    OK,so you're a Java programmer, fine, continue to use it, no worries there.

    Reasons for using C/C++ include complete control over execution, deterministic behaviour of application and raw speed. For memory allocation in C++ malloc() is no longer necessary, use , , etc. The reason why C++ does not have a standard garbage collector is that the ISO committee thought that adding one would hamper performances too much for little return.

    FYI C and C++ actually have an ISO/ANSI standard, so does C, unlike Java. The last revision of C was in 1999 and it includes variable length array (VLAs). Personally I will not touch Java for anything important until it is standardised.

    You are right about a standard GUI though, that would be nice. However existing GUIs aren't `standard'. The difference in the way of thinking and in general appearance between, say, MacOS/X and Windows is still big. Sure they both have buttons, dialogs and lists but the similarity end pretty quick. If you wanted an advanced application that looked native and worked on both you would be severely limited in your choice of widgets.

    1. Re:Where have you been?(wasRe:x86 VM) by j3110 · · Score: 2

      yea, a clever reply! :)

      I'll just start by saying that I'm not just a Java programmer. I have about 5 years of experience in C++. I did mainly server side programming and no real GUI, just moving around data.

      C/C++ do not give you complete control over execution. You can't tell me you don't link to libraries. If you don't, then you are throwing away hours of time that your competition is adding features. At some level, you have to deal with an OS that may or may not work the way you expact as well.

      Java does manage to do garbage collection for about 20% penalty, and LISP isn't bad at all itself. If other people can do it right, then why not C/C++? It really doesn't have to be as bad as people make it out to be. Think about the logistics of it sometime. It wouldn't be difficult or too taxing to keep a hierarchy of pointers in a central class/table and call a cleanup function every 10 seconds or so to check where pointers have changed and which memory addresses allocated are no longer being referenced. I would like for it to be done at the language level because frankly, the people who would care enough to do such a thing to begin with would probable not have memory leaks anyhow. Those that do debug their software should be writting more good software and features instead of debugging something that is unneccisary. Not that GC should be forced, but it should at least be an option!

      Just because there is an ISO/ANSI standard for C/C++ doesn't mean that people follow it, yet they still call it C or C++. At least with Java, if it has the cup, you know it passed the certification. Don't get me wrong though, it's not that I don't think it should be open to the public, I just don't think it should be called C or C++ when it isn't really. Honestly, do you think that GCC is perfectly ANSI compliant? I don't see how since v3 caused everyone to fix some of their non-ANSI code. It still supports multi-line string literals despite the ANSI standard. There's as much of an ANSI standard for C/C++ as there is for SQL. It's very difficult to write SQL or C/C++ code that works on multiple compilers in the way you intend. ISO/ANSI has been a complete failure in ensuring that the standard is followed.

      I think that even for the user's sake there needs to be some consistancy between GUI's. Native GUI's are a terrible thing in most cases. Just because it looks like the host operating system doesn't make it a good thing. Really, the most successful programs are skinnable and look nothing like the host OS. Winamp and Trillian are good examples on the windows side where massive amounts of people have adopted programs that don't look like windows. Also, I would say, gkrellm is a great example for Linux. Native GUI's aren't really all that good of a thing.

      Don't be so afraid of Java. ISO/ANSI are independant companies for profit themselves. I fail to see the difference between them and the JCP. Java applets that I wrote as a student 6 years ago still work today, can you say the same for all of your C++ programs? Do they still compile? Do they still run in binary form? Yes to both on the Java side of things. The world is going to GC whether C/C++ wants to go or not. Micrsoft, IBM, SUN, Apple, and even Oracle know it.

      --
      Karma Clown
    2. Re:Where have you been?(wasRe:x86 VM) by elflord · · Score: 1
      Not that GC should be forced, but it should at least be an option!

      gc is an option, because there are gc implementations for C++. It's not in the standard, but the standard doesn't say that you can't use gc.

      Just because there is an ISO/ANSI standard for C/C++ doesn't mean that people follow it, yet they still call it C or C++.

      There's no rule saying that you have to follow the standard, but there are standards compliance test suites, and in practice, implementations are good enough that you can usually code to the standard and expect your code to work.

      Honestly, do you think that GCC is perfectly ANSI compliant? I don't see how since v3 caused everyone to fix some of their non-ANSI code.

      gcc had substantial standards compliance issues prior to the release of gcc 3.0.

      There's as much of an ANSI standard for C/C++ as there is for SQL. It's very difficult to write SQL or C/C++ code that works on multiple compilers in the way you intend. ISO/ANSI has been a complete failure in ensuring that the standard is followed.

      Sorry, completely and utterly false. The standard has been succesful, and because of it, there are a number of compiler vendors who are rapidly converging to conforming implementations. It's taken some time for vendors to implement the C++ standard, because it is a very complex standard that is difficult to implement correctly. But to dismiss it as a "failure" on the grounds that it took a while to implement is dishonest or stupid.

      I think that even for the user's sake there needs to be some consistancy between GUI's. Native GUI's are a terrible thing in most cases. Just because it looks like the host operating system doesn't make it a good thing. Really, the most successful programs are skinnable and look nothing like the host OS.

      False, false and false. Native GUIs are good, because platforms need a consistent interface, and what's appropriate on one platform may not be appropriate on another (eg PDA vs PC). Consistent look is not the issue, consistent feel is. Most succesful programs are not skinnable (but even then, that's a change of look and not feel.

      Don't be so afraid of Java. ISO/ANSI are independant companies for profit themselves.

      No, they aren't "companies".

      I fail to see the difference between them and the JCP.

      Apparently Sun does see a substantial difference, because it was not willing to accept the loss of control that would have resulted from turning Java over to a non-partisan standards organisation.

      Java is a great technology, but that doesn't excuse your ignorance about ANSI/ISO.

    3. Re:Where have you been?(wasRe:x86 VM) by j3110 · · Score: 2

      Implementations are NOT good. Take the top compilers used today, (Intel's, MS VC++, GCC, Borland) and see how many programs compile on all of them! This is precisely why it's a failure. ISO/ANSI itself is a failure because there are relatively no standards that they have produced that have been followed such that code is portable.

      GC that isn't at least a compile time option (preferably a run-time option), is useless to those who actually need it. One spec implementation is worth a hundred good other implementations. Reasons: 1) Not tied to different licences. 2) All compilers will support it on all platforms. 3) It would actually be used where needed.

      In the example that you site as a good place for native GUI's is the most ignorant arguement I've seen on slashdot to date. Not even Java promised that you wouldn't have to rewrite the GUI for PDA's. (Don't quote hype, find a trusted source where SUN claimed you could run the same code on a PDA) The GUI's are fundamentally different in that case. The look AND the feel of the program should be customizable by the user. That is the promise of Java's LNF. You can choose native if you want, but the LNF is seperate from the code, therefore, you don't have to rewrite the GUI to make it look or feel different. The user ultimately should decide how the program behaves. Any arguement to the contrary is ridiculous.

      http://www.iso.ch/iso/en/aboutiso/annualreports/ 20 01/index.html
      excuse me but I think the fact that they have a financial statement is enough proof that they are a for profit entity. Though ANSI is nonprofit, the only real spec they are known for is the one that causes my ls to be colorful :) At least it seems to be the only one that stuck. Besides, if the ANSI standard was so hard to implement, one could argue that the tools used to implement it where inferior. Just think about that one for a moment.

      This loss of control as you would call it is what ensures that my program will run on ANY Java runtime environment. Can you say that your C/C++ code will compile on ANY C/C++ compiler??? Don't be so ignorant to ask SUN to destroy something good. They have a JCP that decides the fate of Java, and SUN makes sure that it is implemented properly or not at all. If SUN wasn't in control, C# would have been J++ and not a single thing SUN or the JCP would have done could have mattered. SUN has and is making it possible for open source implementations of Java to be certified. Have you not been reading the Apache-Sun conversations? Soon there will be free test suites for nonprofit and open source implementations of the Java specs. Not that you can't implement the spec all you want, you just can't say it's certified if it isn't. You can create uncertified open source java all day, Apache and JBoss has been doing it for years. You can derive it to be whatever you want. You just can't call it certified until it passes the tests. I only wished C/C++ was like that. That alone would be enough that I would still be using it. There's the difference that SUN sees between ISO/ANSI and the JCP.

      C++ was a great technology and may be again someday and still has it's place, but that doesn't excuse your ignorance about the JCP/SUN.

      --
      Karma Clown
    4. Re:Where have you been?(wasRe:x86 VM) by elflord · · Score: 1
      Implementations are NOT good. Take the top compilers used today, (Intel's, MS VC++, GCC, Borland) and see how many programs compile on all of them!

      A lot of programs compile on all of them. Pick a random C++ textbook, and nearly all the code in that book will compile on all major compilers. I'm not sure what your complaint is.

      Of course, there are extensions, and one vendors extensions will not be the same as another vendors, but this doesn't mean that the standard "is a failure". Actually, it's just a reflection of the fact that in C++, there is a clear distinction between "language" and "platform", while in Java there is not. This is a design tradeoff that java makes, not a free lunch.

      In the example that you site as a good place for native GUI's is the most ignorant arguement I've seen on slashdot to date. Not even Java promised that you wouldn't have to rewrite the GUI for PDA's. (Don't quote hype, find a trusted source where SUN claimed you could run the same code on a PDA) The GUI's are fundamentally different in that case. The look AND the feel of the program should be customizable by the user. That is the promise of Java's LNF.

      Try to understand my argument before launching into name-calling. I know Sun didn't promise that you could use the same GUI code for PDAs and desktops. But different platforms do have different looks and feels Claims that these "should" be customisable by the user are contentious at best. I'm not going to get drawn into this argument, but it's certainly not as obvious as you make it sound.

      excuse me but I think the fact that they have a financial statement is enough proof that they are a for profit entity.

      Not at all. You can have financial statements without being for profit. Financial statements imply revenue and operating costs, but not profit.

      ANSI is nonprofit, the only real spec they are known for is the one that causes my ls to be colorful :)

      They are also known for C and C++ (-;

      Besides, if the ANSI standard was so hard to implement, one could argue that the tools used to implement it where inferior. Just think about that one for a moment

      Seriously, the spec is hard to implement because of its complexity. There are a lot of good tools available (including java, which apparently didn't prove to be useful to any known implementor)

      This loss of control as you would call it is what ensures that my program will run on ANY Java runtime environment.

      No it doesn't. The JVM spec is what provides this assurance. Submitting java to a non-partisan standards body would not hurt this goal.

      If SUN wasn't in control, C# would have been J++ and not a single thing SUN or the JCP would have done could have mattered.

      Do you think it is better that we have C# as opposed to J++ ?

      You just can't call it certified until it passes the tests. I only wished C/C++ was like that. That alone would be enough that I would still be using it. There's the difference that SUN sees between ISO/ANSI and the JCP.

      Regarding C, all recent compilers should be able to compile conforming ANSI 1990 C code. Portability issues have to do with platform specific code (eg implementation defined extensions), not the language itself. Regarding C++, the main issue here is that it has taken a long time to implement the standard. A certification process would not have resulted in vendors implementing the standard any faster.

  58. C++ cross platform GUI by Anonymous Coward · · Score: 0

    I guess you've never heard of Qt.
    Get a clue.
    C++ will do just fine without your support.
    Go back to coding in the lowest common denominator.

  59. Valgrind Rox by msevior · · Score: 1

    Hi everyone,
    I'd just like to reitterate the "Valgrind rox" sentiment flowing through here. We've used valgrind extensively on AbiWord with excellent effect.

    This is a great program. BTW the $0 price really helps us as where 100% volenteer.

    The author is great too. He is very quick to respond to issues.

    Cheers

    Martin Sevior
    AbiWord Eveloper

    1. Re:Valgrind Rox by Anonymous Coward · · Score: 0

      > where 100% volenteer.

      Time to work on that AbiWord spell checker. ;-)

    2. Re:Valgrind Rox by msevior · · Score: 1

      He He :-) Spellecking is one reason I use AbiWord at work everyday.

  60. What a hammer! by Animats · · Score: 2
    Valgrind makes you realize how much excess CPU time and memory we have available today. The thing has huge memory and speed overheads, yet today's machines are fast enough, and have enough memory, that valgrind's big-hammer approach to the problem works.

    Still, why not do it that way? Machine resources are cheap.

    1. Re:What a hammer! by Anonymous Coward · · Score: 0

      sounds like a stupid developer, throw hardware at a problem.

    2. Re:What a hammer! by MassacrE · · Score: 1

      It is much more stupid to throw developers (money) at a problem. Premature optimization is a problem many developers face. Write the code first, then optimize areas your profiling tools say are hotspots if you need more performance. Assembly is often overkill, even though it quite '1337.

    3. Re:What a hammer! by cant_get_a_good_nick · · Score: 2
      From The Art of Unix Programming, Chapter 1
      Programmer time is expensive; conserve it in preference to machine time,

      In the early minicomputer days of Unix, this was still a fairly radical idea (machines were a great deal slower and more expensive then). Nowadays, with every development shop and most users (apart from the few modeling nuclear explosions or doing 3D movie animation) awash in cheap machine cycles, it may seem too obvious to need saying.

      Somehow, though, practice doesn't seem to have quite caught up with reality. If we took this maxim really seriously throughout software development, the percentage of application written in higher-level languages like Perl, TCL, Python, Java, and Lisp that ease the programmer's burden by doing their own memory management would be rising fast.

      And indeed this is happening within the Unix world, though outside it most applications shops still seem stuck with the archaic Unix strategy of coding in C (or C++). Later in this book we'll discuss this strategy and its tradeoffs in detail.

      One other obvious way to conserve programmer time is to teach machines how to do more of the low-level work of programming. This leads to...
    4. Re:What a hammer! by elflord · · Score: 2, Insightful
      Somehow, though, practice doesn't seem to have quite caught up with reality. If we took this maxim really seriously throughout software development, the percentage of application written in higher-level languages like Perl, TCL, Python, Java, and Lisp that ease the programmer's burden by doing their own memory management would be rising fast.

      Many of these high level languages have problems of their own. Languages like Python, Perl, and TCL lack any sort of compile time checking, which makes them error prone, and less scalable. This is why you don't see many applications that are millions of lines long developed in these languages. Simply put, memory management is not the only issue that programmers deal with maintainability is very important, and robust compile time checks, and the clarity that comes from having to explicitly declare interfaces and having the compiler check types is a maintenance benefit.

      And indeed this is happening within the Unix world, though outside it most applications shops still seem stuck with the archaic Unix strategy of coding in C (or C++).

      Another fallacy -- that C++ is somehow "equivalent" to C. C++ does not make memory management as simple as java, but it is certainly simpler than C, and arguably, for nontrivial applications, it is at least as good as languages that force a reference counted system on the user (python, perl) as reference counting is often not an appropriate memory management model.

    5. Re:What a hammer! by BillGodfrey · · Score: 2

      Eric Reymond clearly isn't an embedded programmer.

    6. Re:What a hammer! by Anonymous Coward · · Score: 0

      Ok, I'll bite, the webshop I work on is well over 40 MB of source lines in Perl.

      This all runs on a typical Linux server without too much crap (just perl, db and webserver).

      I can make changes and have them online in 3 minutes tested and all! Now try that with your favourite compiled language ;-)

    7. Re:What a hammer! by dvdeug · · Score: 2

      Eric Raymond may not be an embedded programmer, but neither are most of the programmer's he's talking to. He clearly recognizes there are exceptions to the rule - "Nowadays, with every development shop and most users (apart from the few modeling nuclear explosions or doing 3D movie animation) awash in cheap machine cycles". In any case, embedded programming tends to worry about trading cycles for reliability, which has some of the same principles.

    8. Re:What a hammer! by elflord · · Score: 1
      I can make changes and have them online in 3 minutes tested and all! Now try that with your favourite compiled language ;-)

      Easy to do with good design. Use dynamically loaded modules. Decouple interface from implementation by using "handle" classes. Use interpreted languages to write "outer layers" of your application, etc. Minor changes in implementation do not require big recompiles. Changes in important interfaces do (but then, they usually also require code updates.)

      40MB of perl, huh ? Just thinking about that makes my head hurt. Perl was the first language I learned, but I'm glad to have left it behind.

    9. Re:What a hammer! by BillGodfrey · · Score: 2

      Well, so much for distributed computing.

      I'm hoping that soon, someone will run a distributed project, paying people for work done instead of just a chart of top workers.

      Idle cycles would be worth something.

      Bill, ho hum.

  61. what purify lacks by Anonymous Coward · · Score: 0

    It would be extremely useful if Purify gave you the stack trace of the last piece of code to access leaked memory. Having it show when this memory was first allocated is interesting, but not nearly as useful as who used it last.

    1. Re:what purify lacks by jreiser · · Score: 1

      Even better than the last piece of code to touch the leak, would be the exact instant when the block became unreachable. It can be done!

    2. Re:what purify lacks by Anonymous Coward · · Score: 0

      Even better than the last piece of code to touch the leak, would be the exact instant when the block became unreachable.

      It is the same thing.

      It can be done, but you'd have to keep a stack trace for all free() calls. That would be fairly expensive. But it would be worth it in some cases.

    3. Re:what purify lacks by mce · · Score: 1

      But the overhead would make it near unusable.

      Tracking the last access can be done with reasonable overhead. I know this for sure, because I actually worked on stuff that can track all accesses (full stack trace) and that could easily be altered to single out the final one.

      But deciding when something became unreachable is a whole lot harder. Even more so if, as is the case with Purify, you do not know the semantics of of the blobs of memory that you're toying with.

    4. Re:what purify lacks by mce · · Score: 1

      It is the same thing.

      No, it's not. Time of last access to an dynamically allocated block is when you last directly accessed it. Time of leaking is when you, possibly indirectly, caused it to become unreachable by accesssing some other block that looks totally unrelated unless you know a lot more about the program than Purify does.

    5. Re:what purify lacks by Anonymous Coward · · Score: 0

      Indirectly or directly - from the point of view of a malloc debugger it is the same thing. A malloc debug tool cannot make these subtle distinctions.
      In any event it would be useful if Purify or some malloc debug tool could give me the stack trace of the last bit of code that accessed the memory before it was leaked.

    6. Re:what purify lacks by jreiser · · Score: 1

      No, "the last touch" and "becoming unreachable" are distinctly different, and a suitable tool could tell the difference. For instance, a memory read operation [in and of itself] cannot cause an allocated block to become unreachable, but it could be the last touch. Think about exactly what causes leaks of allocated blocks.

    7. Re:what purify lacks by mce · · Score: 1
      Indirectly or directly - from the point of view of a malloc debugger it is the same thing. A malloc debug tool cannot make these subtle distinctions.

      The (in)directness has nothing to do with the core point I was making. It's just an additional example of why tracking point-of-leak also is computationally more difficult than tracking point-of-access.

      My real point is that to track point-of-leak, you need to cover at a lot more possibilitties. For instance, you need to cover the case where A leaks because B, which happens to hold a pointer a A hidden in between a lot of ints, chars, floats, structs, and unions (!) leaks. But B might leak only at the point where part of C is accidently overwritten (note: not freed or leaked!) due to some dangling pointer D being followed. In contrast, to just only track the location of the last access to B, you only need to worry about code that accesses B directly on the one hand, and dangling pointers "into B" (yes, I'm simplifying for the sake of not turning this post into an essay) on the other. Tools such as Purify could relatively easily be extended to give you the last access. The same does not hold for the exact location of the leak. The latter functionality can be implemented, but it's a lot more involved.

      Trust me, I do know what I'm talking about. I've been writing tools to track and optimise memory accesses for a living for nearly 5 years now and have actually implemented a lot of the stuff that I mention above.

  62. Being wrong != being a troll by Sanity · · Score: 2, Insightful
    You give a great explanation of why he is wrong, but I don't think that justifies a troll moderation. In fact, I really wish that Troll and Flamebait moderations were removed, since they are just begging people to moderate based on agreement/disagreement, rather than their actual intent.

    Moderation privs should not be used to suppress opinions with which you disagree.

    1. Re:Being wrong != being a troll by Anonymous Coward · · Score: 0

      Being deliberately wrong == being a TROLL.

    2. Re:Being wrong != being a troll by Anonymous Coward · · Score: 0

      who decides that a poster is wrong or _deliberately_ wrong?

    3. Re:Being wrong != being a troll by Anonymous Coward · · Score: 0

      who decides that a poster is wrong or _deliberately_ wrong?

      moderators.

  63. Other Operating Systems by Anonymous Coward · · Score: 0

    What is preventing this program from being ported to other operating systems like FreeBSD and MacOS X?? It seems like a useful tool, is there a short explanation why it is Linux-only?

  64. I don't know about you... by Akardam · · Score: 2

    ... but I try not to dream in and/or about C/C++. It hurts. :)

    On the other hand, dreaming in perl is probably pretty close to the programmers version of an acid trip. The colors!

  65. Anyone Tried Mozilla with Valgrind? by Anonymous Coward · · Score: 0

    Just wondering if this would be an ideal tool for mozilla to use. Know if any developer has tried this?

    1. Re:Anyone Tried Mozilla with Valgrind? by mce · · Score: 1

      The Mozilla people use Purify.

    2. Re:Anyone Tried Mozilla with Valgrind? by Salsaman · · Score: 1

      But according to trhe story, Purify only works with 'doze.

    3. Re:Anyone Tried Mozilla with Valgrind? by mce · · Score: 1

      Nope. Purify works with several commercial Unices: HP-UX, Solaris, AIX, and I think even SGI's concoction. And with 'doze, of course, but who cares about those guys. :-)

  66. Of course you can just avoid those errors... by voodoo1man · · Score: 2, Informative

    For most applications, it just makes better sense to avoid these errors altogether by using a good garbage collector.

    An excellent implementation is the Boehm-Demers-Weiser (commonly referred to as just "Boehm gc") conservative gc. It can be used for C/C++, and is highly portable. It's a real-time, non-compacting (so you still get heap fragmentation like managing memory by hand, but the collection time is shorter and it's more portable), and uses a conservative mark-sweep algorithm (briefly, treats anything that looks like a pointer as a pointer, to avoid costly checks or increase portability in the case of C/C++.)

    For a moderately large amount of garbage, the incremental collection pauses take less than about 5-10 milliseconds (hence why it's a real-time collector) on a PIII-500, the algorithm scales fairly well, and it's suitable for all but the most time-critical (anything video related) or memory-thrashing (I really don't know of any app that needs to be) programs. GC will speed up development time tremendously, and can eliminate segmentation faults and memory leaks for most programs. I really don't understand why more projects don't use it.

    That being said, Valgrind does seem extremely useful for projects that do need to allocate memory manually. It looks very convenient to use, and the thoroughness of the checks is impressive. The implementation does seem a little uncomfortable to me - it's certainly a lot of effort to write a whole virtual machine just for the task! The portability prospects aren't appealing either.

    --

    In the great CONS chain of life, you can either be the CAR or be in the CDR.

    1. Re:Of course you can just avoid those errors... by JoeBuck · · Score: 2

      valgrind isn't just a GC, it detects use of unitialized variables as well, and that is, if anything, more important.

    2. Re:Of course you can just avoid those errors... by clard11 · · Score: 1

      Not that there is anything wrong with using a garbage collector, but my experience with customer applications based on java application servers is that you are really exchanging one set of C/C++ memory errors for another type (object leaks where you still maintain references to a portion of the object graph, preventing the objects from being collected, through application errors) and in a lot of production type environment the tools for figuring out object leaks either don't exist or are not as mature as those for figuring out "traditional" storage leaks.

      --
      catch (ModDownException mde) {post.modUp("Interesting")}
  67. excuse me, but... by sinserve · · Score: 2

    (let ((I (get '*lisp* 'programmer)))
    `(been I ,no-worry-about-GC)
    (setf (get 'I 'skill) '(good programming techniques))
    (with-carelessness
    (learnt (have I) 'to-code
    (with-no-worry-about
    :memory-management
    :optimization
    :ease-of-use t))))

    1. Re:excuse me, but... by jtdubs · · Score: 2

      Amen brother...

      Justin Dubs

    2. Re:excuse me, but... by Anonymous Coward · · Score: 0

      looks like shit, is formatted badly and is hard to follow..
      yeah, it must be lisp.

    3. Re:excuse me, but... by Anonymous Coward · · Score: 0

      (define your-comment 'unscalable)

    4. Re:excuse me, but... by PissingInTheWind · · Score: 1
      Cheers to that.

      If only they knew too...

      --

      A message from the system administrator: 'I've upped my priority. Now up yours.'
  68. WxWindows by Anonymous Coward · · Score: 0

    Yes, WxWindows is portable, but it's broken by design and severely lacks features - not to mention that WxGTK is poorly maintained. Have you ever used WxWindows? You're better off just writing your own graphics API and writing a frontend for each platform you want to run on.

  69. Crutches! by Ordure · · Score: 0

    There is a problem with C/C++, and this isn't the solution. THIS is the solution.

  70. More than just a GC. by sconeu · · Score: 2

    A lot of people seem to be saying, "Just use a good GC".

    But from reading the Valgrind docs, it's more than just a GC. It checks for accessing memory through uninitalized variables, too... Very cool.

    Disclaimer: I have not used valgrind yet, just read the online docs

    --
    General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    1. Re:More than just a GC. by HalcyonBlue · · Score: 1

      How can it be more than just a GC when it's not a GC at all? A GC is totally different approach to solving this problem by preventing it before it happens as opposed to detecting the problem and then fixing it. I'm sure you probably already know this.. and if you do - fantastic. I have used valgrind.. and I'm wondering if there's any way to get it to tell us what line of code the leaked block was allocated on. I know it shows the function it was allocated in- but is this thing capable of telling me more? I've used tools like dbx and purify.. (dbx far more recently) and dbx could definitely give me this kind of info.

  71. Linux and glibc impediments to programming tools by jreiser · · Score: 2, Interesting
    Win32 has a not-so-secret advantage: VirtualQuery(), a random-access, binary structure interface to /proc/pid/maps. It's painful being required to parse a sequential text file that does not quote filenames in order to ascertain the status of the address space.

    And wouldn't you really rather be told when the dynamic linker has added or removed modules? The current interface to DT_DEBUG, _r_debug.r_brk, _dl_debug_state might be suitable for a controlling process, but it's painful for a same-process debugger. For instance, on x86 there might be only one byte of code at _dl_debug_state(), so you cannot easily overwrite it with an arbitrary transfer of control. And if you use an int3 and SIGTRAP handler, then you cannot run gdb at the same time.

  72. more please! by Anonymous Coward · · Score: 0

    please post more!

    I beg of you...as I stand naked in front of the mirror...

  73. Re:MOD UP +999999 INSIGHTFUL by Anonymous Coward · · Score: 0

    ah yes.

    it's great the heter's are re-claiming slashdot's posting. Katz will be last to go 'cause he is one stubborn homo posting-nazi.

    It is a good day to say...boiing

  74. Re:Market for commercial programming tools for Lin by jreiser · · Score: 1
    (1) What would you say is a reasonable price for tsprof today?

    (2) In the case of valgrind and my other tool, it looks like it takes free software about 2.5 to 3 years to catch up. So such a tool is worth only $30 to $40 per year?

  75. Re:BACKDOOR in Valgrind - Please Read by michael · · Score: 0, Offtopic

    For a long time, CmdrTaco was special-cased in the code: he posted at score:3 by default. :)

  76. Re:Awesome by nathanh · · Score: 2
    We have had this in the Microsoft runtime library for umm... ten years or something...

    No we haven't. MSRT bundles a fairly normal bounds checker. From reading the documentation it seems valgrind is a CPU emulator with memory read/writes logged and analysed.

    I can see a troll moderation coming on.

    And you deserved it.

    In our world, we are moving towards garbage collection. It rocks. The simple truth is that C-style memory allocation is well understood, sub-optimal, and obsolete.

    Perhaps, but until we have finished moving there will be a need for tools like this.

  77. Re:PurifyPlus+MSDEV.EXE+icl.exe has yet to be beat by Doomdark · · Score: 2
    nothing beats an XP box with Visual Studio 7, Intel C/C++ 6 and Rational PurifyPlus.

    Valgrind, alas, does nothing much to help.

    Um, Valgrind apparently can more or less replace PurifyPlus, which is not available on Linux. PP was one of 3 dev components you mentioned. Thus, one third of the problem solved (or alleviated).

    So how is not doing much to help?!?! You think it's ok to have have 3 (somewhat) separate tools on Windows, but in Linux one tool needs to do it all? What am I missing herE?

    --
    I like paying taxes. With them I buy civilization -- Oliver Wendell Holmes
  78. valgrind can handle static libraries by JoeBuck · · Score: 2

    I've used Purify for nearly a decade, and have been banging on valgrind for several months as well. I think that two of your three criticisms of valgrind are off base.

    valgrind copes with static libraries. The only requirement is that the executable be linked to at least one dynamic library, and glibc will do. This is needed to allow valgrind to get control. Since for Purify you need to have the .o files so you can link, in the analogous situation with valgrind you can always link dynamically with the C library.

    Valgrind has a suppression file that is much like that of Purify.

    The only point you raise that is completely valid is that valgrind is x86-only. Those who really care might want to work on a port to other architectures, though it's a big job: you need a complete virtual processor.

    Purify's GUI can be quite useful, but it would be preferable, if someone wants to do the same for valgrind, to implement any GUI as a completely separate program. That way the KDE and Gnome people can assure that there are at least two of them. :-)

    Finally, to be fair I suspect that a Purify'd executable is faster. But then, you don't have to do a special, expensive link step, so the compile-debug-recompile flow feels faster with valgrind.

  79. Re:Market for commercial programming tools for Lin by Wumpus · · Score: 2

    I've never heard of tsprof until I read your post here. Maybe that's part of your problem. When I searched Google for 'Linux profiler', It didn't show up in the first fifty results or so. This means I wouldn't have found it had I been looking for a profiler right now. Maybe the text on your web page should include the word "profiler"? I would assume that most people looking for a profiler would search for it by that name.

    You could try getting more people to link to your web page, or find other ways to get the word out. Unfortunately, you have pretty tough competition, and you can't beat their price. I don't know what you've done to market tsprof, but it was probably not enough, or it was done the wrong way.

    Your Flat profile window looks awsome, by the way. Would have been cool if you colored it using only 4 colors, though...

    Good luck!

  80. Servlets/J2EE/JDBC are the dominant use for Java by adam_megacz · · Score: 1

    The amount of Servlet/J2EE/JDBC Java code out there vastly exceeds the amount of AWT code.

    Sun's entire java.sun.com site runs on J2EE, which does not use AWT. Sure, the applets use AWT, simply because it's impossible to create an applet that doesn't use AWT (java.applet.Applet extends java.awt.Component).

  81. Re:Awesome by bernie+shifman+troll · · Score: 0
    In our world, we are moving towards garbage collection. It rocks. The simple truth is that C-style memory allocation is well understood, sub-optimal, and obsolete. Well honed algorithms beat brute force in almost all cases...
    ahh.. do you have any experience optimizing applications for performance? i thought now. GC is the way of the future? i'll believe that little tidbit when the Honourable John Carmack starts coding in Java. you, fool, wouldn't know a well-honed algorithm from your own well-worn asshole. do you even know what brute force is, in this context? (not talking about homosexual gang-rape perpetrated on imbeciles like yourself)

    [Emperor]Your feeble skills are no match for the power of C. You will pay the price for your lack of vision.[/Emperor]
  82. Idiot by Anonymous Coward · · Score: 0

    it's "I do hope the moderator who is labeling these posts as 'trolls'...", not "whom". If you're going to be a pretentious fuckhead and use "whom", at least use it correctly!

    1. Re:Idiot by mrm677 · · Score: 1

      If you are going to be a pretentious fuckhead and insult someone on Slashdot, at least use an actual account instead of AC.

  83. Are they stupid? by Anonymous Coward · · Score: 0

    Have they any idea of how rich they can (and would) get on a tool like this???

    This kinds of tools are highly valuated if it's good and people pay good money for it.

    Dumbasses... :)

  84. Re:BACKDOOR in Valgrind - Please Read by jsse · · Score: 0, Offtopic

    Just score:3? Interesting, I believe I saw some people posting with score:4 by default. They must be some big guys out there. :)

  85. No silver bullet by Pseudonym · · Score: 2

    OK, first, what we seem to agree on...

    • Yes, GC makes your code cleaner.
    • Yes, GC is easy to use.
    • Yes, GC usually does not slow down your code. (That is, what you gain in the ability to use better algorithms is usually greater than the cost of running a garbage collector.)

    However:

    • It does not solve all of your memory problems. C++ still lets you write out of the end of memory blocks. (Not that you should be using C-style arrays in C++ if you can at all avoid it.)
    • It does not interact well with several well-used C++ idioms, such as the resource acquisition is object creation idiom.

    The latter, IMO, is the more serious of the two. If an object holds a resource, then until it is destroyed, the resource is held. Even the best general-purpose garbage collectors you can find today do not guarantee a maximum time between an object becoming unreferenced and being cleaned up. This goes double for conservative GC, where the resource might not be freed until everything which looks like a pointer to the resource-holding object disappears.

    So in summary: I'm a big fan of GC, but it doesn't solve all my problems, and that's especially true in C++.

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  86. Re:Linux and glibc impediments to programming tool by spitzak · · Score: 2
    I'm not sure if this is the same as VirtualQuery() but I think it would be nice if a lot of the structured files were divided down into many more and much smaller files. So for instance that filename you want is actually the contents of a single file. I would expect this is easy with proc(). It should also be done with all the machine configuration but I expect reiserfs would be needed for that to be efficient. This would give the few advantages of the Windows calls (ie the registry calls do get you a single field without any more parsing needed) but also allow normal filesystem tools to be used.

    Of course I'm not sure if there is any chance of this happening because it will break all the tools everybody is using now...

  87. Valgrind chokes on this simple program by Anonymous Coward · · Score: 0
    Someone please drop a note to Julian Seward. This simple program chokes Valgrind:
    int main {
    asm ( "shl %cl,%al" );

    return 0;
    }
    Actually, any instruction with a 0xD2 op code will choke it: sal, shl, rcr, shr, most of your shift and rotate instructions on byte operands. Kind of tricky to emulate because a lot of them set the carry flag *and* the overflow flag (the latter based on the sign bit - weird!). By the way, this Valgrind bug showed up in one of the GNU Ada string libraries. It's a real example.
  88. Hey cool, Pan for OSX .. [OT] by torpor · · Score: 1, Offtopic

    This is pretty dope:

    http://pan.rebelbase.com/screenshots/osx.png

    Gotta say, OSX seems sexier and sexier, every day ...

    --
    ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
  89. This shows the weak spot of C++ by Otis_INF · · Score: 2

    No offence, but if you need a 3rd party tool to check if the output of the compiler, which was produced after the compiler found that the input (your code) was correct, is correct, perhaps it's time to take a step back and think about a better solution that will fix what I call the 'weak spot' of C++: you have too many stuff to take care of, it backfires on you.

    Today, the software that's used to develop software should be there to help developers write solid code from the start without overhead, without the necessity to program the plumbing code which makes your program logic run in the first place.

    Some people here have suggested that GC is a better solution than just feed your compiled binary to another tool in the chain of tools and I agree. When you look at .NET and the Java platform, you'll see that there isn't a necessity for the overhead you have to program with C++, so there's also no need for tools like purify or valgrind.

    For solutions where C++ is the only way to go, it's probably a welcome addition to the set of tools to work with, but for C++ in general it isn't IMHO, it only shows where C++ should be improved, or better: where the RTE of C++ should be improved so these tools are obsolete in the future.

    --
    Never underestimate the relief of true separation of Religion and State.
    1. Re:This shows the weak spot of C++ by Anonymous Coward · · Score: 0

      Such a lack of diversity in what people choose to use to produce software. The gap between all the cool technology which is available and that which is actually used in mainstream work is staggering. I mean you have Scheme, CLU, Eiffel, Modula3, Ada95, SmallTalk, ocamel, haskell, Java, to name a few that offer certain improvements over C/C++. There is a lot of really good compiler technology available. It would be nice of more people availed themselves to it.

    2. Re:This shows the weak spot of C++ by Gumpu · · Score: 2, Interesting

      It's not so much a problem of C++ as a problem of the sloppyness of the programmer. Keep track of all the new and deletes in C++ is difficult. However GC, as found in Java, is not a magic bullet.

      It is possible to leak memory in Java too (by making circular structures).

      Even worse, because objects stay around until the last reference to it is gone, it is possible to have several copies of the same object lying around. This can lead to very hard to find errors.

      For instance:

      An object A might contain a reference to object B.
      An object A2 might also contain a reference to object B, but to an older version. (Due to update error or so).

      You think they both point to the same object B, and use A and A2 accordingly. Your program will not crash, because both references point to a valid object, but it won't function correctly either. It might fail only after a very long time, due to other errors that are induced by this error. This will make it very hard to find the error.

      Have fun,
      Frans.

    3. Re:This shows the weak spot of C++ by Shillo · · Score: 1

      > It is possible to leak memory in Java too (by making circular structures).

      GC present in just about any Java VM handles circular structures just fine (hint: They don't use refcounting).

      --

      --
      I refuse to use .sig
    4. Re:This shows the weak spot of C++ by Otis_INF · · Score: 2

      It's not a magic bullet as in 'take this pill and you're free of trouble!', but it's a great start to finally do something about it.

      What I find fascinating is that when it comes to the lack of help provided by C++ for the programmer, the frase 'but it's the sloppy programmer!' comes up a lot as the possible reason why programs written in C++ have memleaks and other crappyness.

      This is totally a proof a lot of people are 'in denial'. True, memory leaks are possible in Java and f.e. also in .NET (CLR boxing stuff can lead to memleaks, albeit small), but most developers using these platforms like Java and .NET will not create code that can lead to a memleak or buffer overflows, stackcorruption, memory corruption etc.

      C++ forces the developer to create EXTRA code to make it run perfectly (i.e.: without memleaks, stack corruption etc). To me, that's fine when there is no other choice (read: technology isn't on a level where a RTE can be fault tolerant and fault preventing) but in 2002, technology IS at that level where RTE's will make sure developers don't make mistakes and languages using these RTE's are nowadays able to provide a working environment for the developer where that developer doesn't have to write that EXTRA code to make the logic run correctly, that's already in place, provided by the language/compiler combo and / or the RTE.

      Perhaps C++ will get extended to meet those requirements, but I fear a lot of those self-called 'Elitists' now using C++ will not use these extra features simply because (according to them) then 'everybody' can use C++ and thus C++ will 'degrade' to a language of choice for the 'average' programmer, not stay a divider of who's good and who's not.

      --
      Never underestimate the relief of true separation of Religion and State.
    5. Re:This shows the weak spot of C++ by Gumpu · · Score: 1

      So why do they have tools to find:
      Leaks them? They are mentioned at the bottom of the page. The main text of the page explains how memory leaks in Java can occur.

      Don't get me wrong, Java is a wonderful language, but every solution to sloppy programmers will also have disadvantages....

    6. Re:This shows the weak spot of C++ by Shillo · · Score: 1

      Checked the article. They describe the case where a program inadvertantly builds a (potentially) infinite data structure - they plonked every object (of a certain kind) into a hashtable that wasn't weak. This isn't a memory leak, really, just shoddy logic - I'd prefer if the article called it for what it really was.

      Furthermore, GC is not a solution for shoddy programming, it's a tool that allows a different approach to programming (my favorite feature: exceptions become *VERY* cheap, as they reduce to, basically, a longjmp - no stack rollbacks). And it does make memory-related bugs very rare (modulo programmer stupidity :) ).
      --

      --
      I refuse to use .sig
    7. Re:This shows the weak spot of C++ by Gumpu · · Score: 1

      Agree with all points.

      > Furthermore, GC is not a solution for shoddy programming

      That was the point I was trying to make.
      (But didn't really succeed in :)

      Both GC and explicit memory allocation have their place...

      I think the real weak spots of C++ are:
      (1) the very cryptic error messages you get when using the STL, and (2) having to figure out, over and over again, which files to include where... one would think an compiler could take care of that.

      Have fun,
      Frans.

  90. Re:PurifyPlus+MSDEV.EXE+icl.exe has yet to be beat by Shillo · · Score: 1

    > Sorry guys, but as far as C/C++ development goes, nothing beats an XP box with Visual Studio 7, Intel C/C++ 6 and Rational PurifyPlus.

    How about XEmacs, gcc 3.1, Valgrind and a summer vacation on a tropical island of your choice, for the same price?

    --

    --
    I refuse to use .sig
  91. Just like ZeroFault by Mask · · Score: 1
    ZeroFault on AIX has been using a virtual machine for ages. I first came across ZeroFault around 96-97, so you can't say this technology is extremely new.

    It is a nice technology and execution speed is reasonable. Yet, it has several gotchas. Most of them due to semantics lost at compilation:
    • The compiler may generate code that speculatively accesses/mutate data. This operation is later discarded if the speculation was wrong. The speculative access/mutation may result in uninitialized data access.
    • In C++, empty classes are common (e.g. functors). These classes have sizeof > 0. Now, the compiler may generate code to copy these dummy structures. Because these structures are not initialized, you may get lots of warnings on uninitialize access.
    • ZeroFault has pending patents. This puts Valgrind in a dangerous position.
  92. No debug cycle by Per+Abrahamsen · · Score: 2
    I used valgrind for a heavy numeric program, and while it took hours to run even a simple test case, I don't consider it much of a problem given the alternative. Tracking down memory errors can take days and is extremely frustrating.

    Valgrind is a program I run if I suspect a memory error, and maybe every half year just to feel safe. It is used a lot less than the debugger, as memory errors are far less common than logical errors, at least for me. But when I need valgrind, it is godsend.

    And of course, the really cool thing about valgrind is that it takes no human time to use. You just type

    valgrind yourprogram -your arguments
    in some terminal window, and go back to working on something else. No special compile or build options, or any manual intervention needed. When it is finished, maybe next day, you read the problem repport.
    1. Re:No debug cycle by Anonymous Coward · · Score: 0

      Please note that valgrind performs a lot better on integer code than the FPU ops -- for the latter, it must essentially runs the operations, and save the state of the entire FPU, for the former, it is able to handle the operations far more efficiently through uop recompilation

  93. Offtopic by Dacobi · · Score: 1
    > VisualStudio.NET bombs the Linux developer right back to the stone age.

    I've seen your signature many times, but I've never understood what you mean.
    What exactly does VisualStudio.NET have to do with Linux developers?

    --
    .NOT
  94. NJAMD by Anonymous Coward · · Score: 0


    So, just curious, what does this do that NJAMD doesn't?

    (NJAMD == Not Just Another Malloc Debugger,
    search freshmeat.net.)

  95. Re:Market for commercial programming tools for Lin by jreiser · · Score: 1
    Thank you for the suggestions.

    Those who actually search for software can also look in freshmeat.net and newsgroup comp.os.linux.announce and linuxapps.com and a buyer's guide.

  96. Earth to angry person: by Anonymous Coward · · Score: 0

    Earth to angry person: Please don't bring your anger to Slashdot.

  97. Re:Market for commercial programming tools for Lin by Wumpus · · Score: 2

    True, but searching freshmeat for "profiler" doesn't bring up your project. OProfile does show up, though, so I guess most people don't go any further.

  98. Re:PurifyPlus+MSDEV.EXE+icl.exe has yet to be beat by Anonymous Coward · · Score: 0

    The real strength of fix and continue is in tweaking UI/reports of programs that have long startup times.

  99. Re:Too slow to always enable (correction) by mce · · Score: 1

    Now that I am awake again, I have to correct the above figures: please read 250 instead of 25 and 500 instead of 50. Those are the ones I meant to post in the first place anyway.

    Sorry.

  100. Definately by adam_megacz · · Score: 1

    Yep, I much prefer Haskell to Java. Only problem is that every time I mention it, I spend the next hour explaining what it is and why functional programming is a good idea =)

  101. Re:Market for commercial programming tools for Lin by rblum · · Score: 0

    But that's not the point. It does not matter where it shows up if you miss out on the one MAJOR search engine of the internet.

    Especially if it is returning hits for the competition.

    As another suggestion, you might want to look to the game console market to leverage the knowledge you gained. God knows there are a lot of people out there who would pay $600 for a decent PS2 or Gamecube profiler....