Valgrind 1.0.0 Released 301
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."
wow, top ten (Score:1)
Any reviews? (Score:5, Interesting)
GDB is BIG and old valgrind help's (Score:2)
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
Re:Any reviews? (Score:5, Informative)
Things I like better in Valgrind:
Things I like better in Purify:
Re:Any reviews? (Score:2)
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.
valgrind can handle static libraries (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.
Re:Any reviews? (Score:2, Informative)
Details about Valgrind suppressions at:
http://developer.kde.org/~sewardj/docs/manua
Re:Any reviews? (Score:5, Interesting)
If there's a secret "Don't Run Slow" switch to Purify, let me know what it is.
Re:Any reviews? (Score:2)
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
No debug cycle (Score:2)
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.An excellent tool (Score:5, Interesting)
Wow! (Score:2)
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.
Too slow to always enable (Score:2, Troll)
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.
Re:Too slow to always enable (Score:5, Insightful)
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.
Re:Too slow to always enable (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?
Re:Buy a faster computer? (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".
Re:Buy a faster computer? (Score:2)
recursivity (Score:4, Funny)
[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.
Use garbage collection (Score:2, Informative)
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.
Re:Use garbage collection (Score:2)
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.
Re:Use garbage collection (Score:5, Interesting)
Be was written in C++, and so is K42 [ibm.com], 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.
Re:Use garbage collection (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.
Re:Use garbage collection (Score:2)
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.
Re:Use garbage collection (Score:2)
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.
No silver bullet (Score:2)
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++.
Correct md5sum (Score:2, Informative)
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!
Could Valgrind be an alternative to Bochs? (Score:2, Interesting)
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.
Re: (Score:2)
Wow, Debian version already updated (Score:2, Informative)
Cool.
What a hammer! (Score:2)
Still, why not do it that way? Machine resources are cheap.
Re:What a hammer! (Score:2)
Re:What a hammer! (Score:2, Insightful)
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.
Re:What a hammer! (Score:2)
Eric Reymond clearly isn't an embedded programmer.
Re:What a hammer! (Score:2)
Re:What a hammer! (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.
I don't know about you... (Score:2)
On the other hand, dreaming in perl is probably pretty close to the programmers version of an acid trip. The colors!
Of course you can just avoid those errors... (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 [hp.com]. 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 [hp.com] (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.
Re:Of course you can just avoid those errors... (Score:2)
valgrind isn't just a GC, it detects use of unitialized variables as well, and that is, if anything, more important.
excuse me, but... (Score:2)
`(been I
(setf (get 'I 'skill) '(good programming techniques))
(with-carelessness
(learnt (have I) 'to-code
(with-no-worry-about
Re:excuse me, but... (Score:2)
Justin Dubs
More than just a GC. (Score:2)
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
Linux and glibc impediments to programming tools (Score:2, Interesting)
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.
Re:Linux and glibc impediments to programming tool (Score:2)
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 shows the weak spot of C++ (Score:2)
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.
Re:This shows the weak spot of C++ (Score:2, Interesting)
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.
Re:This shows the weak spot of C++ (Score:2)
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
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.
But but but... (Score:3, Funny)
It's not a leak damnit! The Operating System happens to either "Like" the program more, or feel sorry for it.
Some OS's are more generous than others. Windows often is willing to sacrifice itself and die to keep its program's memory fed. A trait rarely seen in humans.
Leave it to programmers to make memory allocation sound like such a cold thing. And leave it it up to a program that sounds like "Meat Grinder" to undermine your OS's generosity.
Bastards. Cold, heartless, ruthless bastards!
why no binary instrumentation tools? (Score:3)
ATOM, from DEC, is a wonderful tool that allows you to instrument existing binaries at nearly any level of granularity, but it only works on the Alpha. You can do amazing things with binary instrumentation tools, going way beyond the kind of low-overhead profiling I'm talking about. Etch, from Washington, seemed to fill some of that niche but appears to be dead and gone. I know that some at Microsoft Research would like to eventually release their improved version of ATOM called Vulcan (which can instrument running executables!), but in the meanwhile, I'm surprised that the open source community hasn't jumped in.
Oh Good! (Score:2)
Hopefully this will be used as a tool to check and repair rather than a tool to allow for crappier code.
Re:Valgrid is not as complete as Purify (Score:2)
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?
Re:Valgrid is not as complete as Purify (Score:2, Interesting)
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.
Re:Valgrid is not as complete as Purify (Score:4, Insightful)
How about showing us that list?
Re:Valgrid is not as complete as Purify (Score:2)
Re:Valgrid is not as complete as Purify (Score:4, Interesting)
Excellent point. It's also another reason why I've found Parasoft's Insure++ [parasoft.com] to be superior to Purify.
I'm sincerely looking forward to checking out Valgrind. Can someone post a feature comparison of these three?
Re:Valgrid is not as complete as Purify (Score:3, Informative)
- 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.
Re:Valgrid is not as complete as Purify (Score:3, Interesting)
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.
Re:Valgrid is not as complete as Purify (Score:3, Informative)
Re:Valgrid is not as complete as Purify (Score:2)
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++ [parasoft.com]. 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.
Re:Valgrid is not as complete as Purify (Score:3, Informative)
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.
Market for commercial programming tools for Linux (Score:2, Interesting)
Today BitWagon offers a profiling product tsprof [bitwagon.com] 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.
Re:Market for commercial programming tools for Lin (Score:2, Informative)
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]
Re:Market for commercial programming tools for Lin (Score:2)
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!
Re:Market for commercial programming tools for Lin (Score:2)
Re:What's the fun in that? (Score:2)
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.
Re:What's the fun in that? (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 >>.
Re:What's the fun in that? (Score:4, Funny)
So you *are* stupid after all!
Re:What's the fun in that? (Score:2, Interesting)
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.
Re:What's the fun in that? (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.
Re:What's the fun in that? (Score:2)
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!
Re:What's the fun in that? (Score:2)
Re:What's the fun in that? (Score:2, Insightful)
Re:What's the fun in that? (Score:2)
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...
Re:What's the fun in that? (Score:2, Insightful)
but write the code directly to the compiler input stream. They don't need debugging tools either.
Re:BACKDOOR in Valgrind - Please Read (Score:4, Informative)
Re:Strangeness (Score:2, Offtopic)
Re:Strangeness (Score:2, Informative)
Re:Strangeness (Score:2, Funny)
I actually wasted about 15 minutes looking into this.
Re:Strangeness (Score:3, Informative)
Still, I would appreciate it if the maintainer could check out vg_scheduler.c and see if there's something amiss there. Thanks.
Re:Strangeness (Score:3, Informative)
(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):
What the... (Score:2)
Re:What the... (Score:2)
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.
Why your post is a troll (Score:5, Insightful)
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.
Being wrong != being a troll (Score:2, Insightful)
Moderation privs should not be used to suppress opinions with which you disagree.
Garbage collection vs direct allocation/release (Score:3, Insightful)
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).
Re:Garbage collection vs direct allocation/release (Score:2)
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.
Re:Awesome (Score:2)
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.
Re:PurifyPlus+MSDEV.EXE+icl.exe has yet to be beat (Score:2)
Re:PurifyPlus+MSDEV.EXE+icl.exe has yet to be beat (Score:2)
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?
Re:If you're worried about threading/memory bugs (Score:2)
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...
I think you're confused (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.
Re:If you're worried about threading/memory bugs (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...
Re:If you're worried about threading/memory bugs (Score:3, Funny)
Re:Call me ignorant if you like... (Score:2)
Re:What can I say: Linux is the best (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 [gecapital.com] 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.
Re:Where have you been?(wasRe:x86 VM) (Score:2)
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.
Re:Where have you been?(wasRe:x86 VM) (Score:2)
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
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
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.
Re:C/C++? (Score:2)
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.
Re:C/C++? (Score:2)
Yes, it was. And do you know how long ago that was, and how much the languages have both changed since then?
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++".
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.
Re:C/C++? (Score:2)
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...
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?
Re:C/C++? (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.