Slashdot Log In
C# Memory Leak Torpedoed Princeton's DARPA Chances
Posted by
Zonk
on Saturday November 17, @05:22AM
from the omg-a-tumbleweed dept.
from the omg-a-tumbleweed dept.
nil0lab writes "In a case of 20/20 hindsight, Princeton DARPA Grand Challenge team member Bryan Cattle
reflects on how their code failed to forget obstacles it had passed. It was written in Microsoft's C#, which isn't supposed to let you have memory leaks. 'We kept noticing that the computer would begin to bog down after extended periods of driving. This problem was pernicious because it only showed up after 40 minutes to an hour of driving around and collecting obstacles. The computer performance would just gradually slow down until the car just simply stopped responding, usually with the gas pedal down, and would just drive off into the bush until we pulled the plug. We looked through the code on paper, literally line by line, and just couldn't for the life of us imagine what the problem was.'"
Related Stories
C# Memory Leak Torpedoed Princeton's DARPA Chances
|
Log In/Create an Account
| Top
| 560 comments
(Spill at 50!) | Index Only
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
|
2
I'll show you mine if you.. (Score:4, Funny)
(http://www.legalresourcecentre.ca/)
Re:I'll show you mine if you.. (Score:5, Insightful)
This just tells us once again that our wonderful editors on /. don't even try to understand what's behind an article, but they just find some sensationalistic title (the more AntiMS, the better) and done. This results in more comments of the type... "See, M$ id teh SuCkS", or "thanks god for my Linuzzz."..., so they got more profit for their /. ads (oh, the irony often MS ads, BTW).
Yellow press..... yes, I know, /. is not supposed to have any credibility like any other parasite news sites, but anyway....
Re:I'll show you mine if you.. (Score:5, Funny)
(Last Journal: Friday October 19, @09:21PM)
Re:I'll show you mine if you.. (Score:5, Insightful)
(http://slashdot.org/journal.pl?op=list&uid=911325 | Last Journal: Saturday November 10, @12:25PM)
...
O.K., I'll bite, what part of that line do you not understand? If /. billed itself as a "blog" then I'd understand your point. However, /. is a corporate based, self-billed "News" site. Whether reader submission driven or not, it is a news site. You are wrong. But, thanks for your thoughts.
Slashdot not a news source? Agree! (Score:5, Interesting)
(Last Journal: Sunday July 29, @12:15PM)
People complain that Slashdot sucks: the headlines are sensationalistic, the editors get commissions based on the number of dupes they post, and articles about 6-month-old events get posted as "news".
So why do I even bother visiting Slashdot? The answer is two things: the community of posters, and Slashcode moderation.
The value of Slashdot is in its community. You and I, dear Slashdotters. Our collective mind will pick through the various articles, point out their flaws, expose sensationalist FUD for what it is (and, surprisingly, will do this equally for anti-Linux and anti-MS FUD), debate various trends, and provide a signficantly international (though heavily USA-centric) perspective.
This value is enhanced by Slashdot's moderating system, so that information and insight can bubble to the top among the mass of inane posts. Metamoderation limits the amount of crack that the moderators can be on.
So, Slashdot editors, take note! *WE* are the reason we are here. *YOU* are not. Many of us don't even bother to read the articles any more, preferring to soak up the collective wisdom of techies from varying age groups and fields. If you piss us off, and the collective community of Slashdot deteriorates, then there's no reason for me (or others) to keep coming back.
Think about it.
Re:I'll show you mine if you.. (Score:5, Insightful)
However I take exception to your use of the world "Editor". Slashdot does not have Editors. They have guys who accept submissions.
They don't read The Fucking Articles, They don't check links, The don't edit submissions...
Re:I'll show you mine if you.. (Score:5, Informative)
(http://www.autobotcity.net/)
I wonder is MS could sue Slashdot for slander?
Slashdot *does* have editors. When I submitted... (Score:4, Interesting)
Re:I'll show you mine if you.. (Score:5, Interesting)
The Slashdot editor who posted it moved the link so it looked like I was linking to the original study, not the article about the study. It's like they felt compelled to make a change, so they made one even if the change didn't improve the quality of the article.
I will say that the rest of the text remained unchanged, and really the only problem with the submission is that people who thought they were going to a study were actually going to a newspaper article about a study, but the point is Slashdot editors *do* make changes all the time.
in the URL (Score:5, Insightful)
(http://jamesjustinharrell.com/)
http://www.codeproject.com/showcase/IfOnlyWedUsedANTSProfiler.asp
"IfOnlyWedUsedANTSProfiler"? That didn't raise any flags?
Of course, I'm trying to assume good faith and not just conclude that the editors knew this was an advertisement, but they sure are making that difficult.
Re:I'll show you mine if you.. (Score:5, Informative)
Perpetual motion machine vendors (Score:5, Funny)
I was working at a coal-fired power plant which needed a new pollution control device before 2010. There, I would dig through the literature, and try to find suitable products and operating conditions for this device. Anyway, this involved a lot of meetings, conference calls, and business lunches with the suppliers in question.
Then there was Joe.
Joe was our Alstom sales rep: portly, humorless, slow to speak and slower to understand. He was also a devote Utahnian.
Well, one day, we were killing time while waiting on a conference call, my supervisor left the room, and we started talking about universities. Then he dropped the bomb:
"In my Senior year, I worked on developing perpetual motion machines."
My supervisor then reentered the room, and we got back to work. I felt like I'd just seen a dancing frog.
Re:I'll show you mine if you.. (Score:5, Informative)
Re:I'll show you mine if you.. (Score:5, Interesting)
(http://theravensnest.org/ | Last Journal: Tuesday November 27, @07:07AM)
Well, there's your problem! (Score:5, Funny)
(http://www.fodors.org/)
Re:Well, there's your problem! (Score:5, Funny)
Re:Well, there's your problem! (Score:5, Funny)
(Last Journal: Wednesday August 14 2002, @12:33PM)
Re:Well, there's your problem! (Score:4, Insightful)
(http://www.vastheman.com/ | Last Journal: Monday May 02 2005, @01:30AM)
It obviously doesn't work in situations like this where the bug is in the runtime and not the application.
Re:Well, there's your problem! (Score:5, Informative)
there are very clear constructs in place in the language/runtime to allow any object to unregister itself from event registrations it initiated.
this was VERY MUCH a bug in the end-user software, not the runtime (i've written code almost IDENTICALLY to this and blew lots of time having made this same mistake).
the only thing the runtime could do to protect the idiot developer (myself included) is automagically make all event references WEAK references, but that has plenty of undesirable side-effects too... in clr, you can do this yourself if you're so inclined... (just like in a JVM)
cheers.
Peter
Re:Well, there's your problem! (Score:5, Interesting)
(http://davenjudy.org/)
I first ran into this sort of problem in 1983 when working on a CDC mainframe. The only way to find the bug was the line by line analysis method since even compiling the code with debug caused it to run slower and the nature of the problem changed. That's as much detail as I remember.
I expect to see a lot more of these kinds of errors pop up as multi-core CPUs become more prevalent (true parallel execution) and people continue to assume that they can just crank out code without taking the time to understand the design. I'd also expect the prevalence of multi-core processors to create a demand for more parallelism. If you don't take advantage of the additional cores, your program will only be as fast as if it were on a single core system. If the competition can create a program that uses the additional cores, your program will seem slow.
Cheers,
Dave
Re:Well, there's your problem! (Score:5, Informative)
(http://freegamer.blogspot.com/)
Re:Well, there's your problem! (Score:4, Funny)
(Last Journal: Thursday August 03 2006, @09:15PM)
Slashvertisement (Score:5, Informative)
Re:Slashvertisement (Score:5, Interesting)
(http://www.luminance.org/ | Last Journal: Wednesday April 24 2002, @05:35PM)
Re:Slashvertisement (Score:4, Insightful)
Re:Slashvertisement (Score:5, Insightful)
(http://slashdot.org/~slashdot.org/journal/ | Last Journal: Friday August 27 2004, @07:32PM)
But I do believe that articles written by companies pretending to be written by end-users are not terribly useful and probably shouldn't end up on
I mean, the article clearly states at the top "By Red Gate Software.".
So where did the "Bryan Cattle reflects on
Seriously.
"One of our team members downloaded the 14-day trial of ANTS Profiler"
"To our amazement, it was only minutes before we realized that our list of detected obstacles was never getting garbage collected"
"If Only We Had Used It Earlier..."
ANTS Profiler helped us fix a problem in minutes that would have taken us weeks to track down. If only we'd thought of it before the competition, we would most likely have finished the entire race and had a chance at the top prize money.
All this stuff sounds either very naive or very marketing. You choose.
Re:Slashvertisement (Score:5, Insightful)
(Last Journal: Thursday July 28 2005, @08:28PM)
Some old Visual Basic programmer jokes come to mind when I read this article. People use to make fun of Visual Basic programmers because it was to easy to write programs in VB. They thought it would produce sloppy code with errors, and other similar things. To some extent, it appears that same case could be made for C#, and to a lesser extent Java. In the end this is simply a case of not stress testing their event stack.
Re:Slashvertisement (Score:5, Insightful)
(Last Journal: Tuesday December 02 2003, @06:03AM)
Agreed. I was a good VB programmer. But my VB experience was an eight-month interval between C++ jobs. I've knocked out minor MS Office applications when needed since then, but that's it. I'm sorry to say that most of the VB programmers I've worked with were very poor engineers. Admittedly I've not worked in VB for wealthy companies whilst I have in C++, so that colours things somewhat. I don't doubt that there are some good VB programmers out there. But in the cases of most of those I worked with, I could very clearly see how VB led them to be poor engineers. The amount of shortcuts and wizards and instances where they would start their program by dragging a form object onto the design panel and dumping form objects onto it was obviously a leading reason for their poor skills. VB *led* them to take this approach. It works for small Excel apps, barely for database front-ends and not well at all for large projects.
As is common with the lower end of Microsoft products, the selling point is that they make it very easy to do what they think you want to do. The ability of VB to knock out an interactive form with near-zero knowledge of programming has encouraged a lot of colleges to sell people the idea that a ten-week course of dragging and dropping text box objects is programming whilst a lot of cheap or ignorant employers have taken the graduates at their word and plunged them in over their heads.
VB is a poor language in many ways and not, imo, suited to a large or sophisticated project. But you can find good VB programmers (was one). It's just that it encourages bad ones.
Oh, the summary is also wrong. C# hasn't started springing leaks. The programmers missed a reference to objects that they were creating and the garbage collection therefore never triggered to unallocate the memory. I don't doubt it's not easy to automate a vehicle to drive any even 9 miles, but this could have been detected with more thorough debugging. At any rate, the article submitter and overseeing editor should be ashamed of twisting this into an anti-Microsoft jab. I'm a Linux programmer. I can tell you that Linux can compete happily without sinking to the level of lies and misinformation.
Don't Slashvertise. Ever. (Score:5, Insightful)
(Last Journal: Tuesday August 07, @01:18PM)
You may think you're pulling one over on the editors, and maybe you are. But you aren't pulling one over on us, and I think after all these years, the editors know this. So, just don't. Unless your product or service is absolutely bulletproof people here are more likely to shoot it full of holes than rush out and buy it.
Re:Slashvertisement (Score:4, Informative)
The company I worked for, in the efforts to get something out the door, deployed a product to a customer site that had a similar flaw (but, not a
In my own work, I wrote NT services that HAD to run 24x7 and were not allowed to crash - especially due to memory leaks. The components we purchased and used, contrary to their marketing ploy, often had memory and resource leaks - we won't even begin to talk about the runtime library that shipped with the compiler.
I used a variety of freely available memory managers and commercial QA tools to track down most of the "leaks" and fixed them. If I didn't have source to the component in question, I replaced them or rewrote them from scratch taking time to make sure it didn't leak. Guess what? It worked and those applications/services run 24x7 (well, until they restart server for some other reason).
Moral of the story - if something is critical - take the time to profile your code and use QA tools to find other potential problems BEFORE you deploy.
RD
Stupid Slashdot headline (Score:5, Interesting)
It's not C#'s fault. The team had references to the obstacle list (event handlers), which prevented garbage collection. The
Re:Stupid Slashdot headline (Score:5, Interesting)
Re:Stupid Slashdot headline (Score:5, Insightful)
(http://idunno.org/)
I think you're getting hung up on the method name. There is no standard "delete" function that marks something as unused (dispose on the other hand sort of gets there). The article itself is unclear but I would assume that they were simply deleting the collision objects from a collection of potential hazards. Whilst that would remove the object from the collection itself it is *not* a delete. As references to the object existed elsewhere the object still exists (look ma, no null pointer exceptions) no delete happens. You cannot specifically say to the GC "We're done with this, delete it", the GC sweeps on a regular basis looking for objects with no references. <