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."
sorry, that was off topic, but this C++ this is happy news for me
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).
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)
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?
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.
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).
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.
Linux user since early January 1992.
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.
Nope, sorry!
But I guess that's what happens when you only develop software and not see girls...
^_^
I bet you can't say that backwards ;o)
[JJ]
"Insert Dead Smart n Clever Sig Here So I Look Brainy"
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.
"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.
"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.
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.
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.
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.
They've made a virtual machine that copies x86 architecture - all the benefits of Java debugging bought to C/C++. Nice.
-- Mike
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
Especially since purify doesn't run on linux...
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.
Linux user since early January 1992.
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.
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...
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?
http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_s
And contrary to what you may think, it's qiute easy to use:
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.
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.
I'm on a bellsouth adsl connection
halcyon:~$ md5sum valgrind-1.0.0.tar.bz2
76c59f7f9c57ca78d733bd956b4d94ae valgrind-1.0.0.tar.bz2
halcyon:~$
(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):
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 >>.
i've been using valgrind for a couple months now. it's great!
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.
Even open source developers get mod points sometimes...
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.
Hi,
. bz2. md5sum
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
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!
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/
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.
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.
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.
Trolls are busy at work today I see.
I actually wasted about 15 minutes looking into this.
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
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.
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
in Java, and that if you write
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
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.
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?
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?
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."
1.0 is available in unstable.
Cool.
So you *are* stupid after all!
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
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:
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.
Linux user since early January 1992.
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.
What is this "C/C++" language? I've heard of C, and I've heard of C++, but not C/C++.
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.
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...
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.
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.
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
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/
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.
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"?
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.
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
Still, why not do it that way? Machine resources are cheap.
Moderation privs should not be used to suppress opinions with which you disagree.
... 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!
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!
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.
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.
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.
Linux user since early January 1992.
(let ((I (get '*lisp* 'programmer))) ,no-worry-about-GC)
:memory-management
:optimization
:ease-of-use t))))
`(been I
(setf (get 'I 'skill) '(good programming techniques))
(with-carelessness
(learnt (have I) 'to-code
(with-no-worry-about
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.
Linux user since early January 1992.
The Mozilla people use Purify.
Linux user since early January 1992.
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
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.
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.
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.
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.
Linux user since early January 1992.
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) 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?
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!
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.
And you deserved it.
Perhaps, but until we have finished moving there will be a need for tools like this.
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.
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
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.
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!
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).
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 ?
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.
OK, first, what we seem to agree on...
However:
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});
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...
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. --
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.
.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.
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
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.
Real programmers does not use compilers, they program using small magnets directly on the harddisk surface. :-)
But according to trhe story, Purify only works with 'doze.
> 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
> 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.
It is a nice technology and execution speed is reasonable. Yet, it has several gotchas. Most of them due to semantics lost at compilation:
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
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.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!"); }
The patent on breathing was awarded to IBM last year. They make you sign license agreements when you go through customs.
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
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.
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!
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.
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. :-)
Linux user since early January 1992.
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.
Linux user since early January 1992.
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 =)
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.
If you are going to be a pretentious fuckhead and insult someone on Slashdot, at least use an actual account instead of AC.
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.